chore(deps): bump docker/setup-buildx-action from 2 to 3 #274
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: | |
- 'v*' | |
pull_request: | |
paths: | |
- '.github/workflows/release.yml' | |
- '.goreleaser/' | |
- '.goreleaser.yaml' | |
jobs: | |
goreleaser: | |
if: github.repository == 'tensorchord/envd' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.19.10 | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v4 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: upload gobin | |
uses: actions/upload-artifact@v3 | |
with: | |
name: gobin_${{ github.event.release.tag_name }} | |
retention-days: 1 | |
path: | | |
dist/envd_linux_amd64_v1/envd | |
dist/envd_darwin_all/envd | |
if-no-files-found: error | |
pypi_publish: | |
needs: goreleaser | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 20 | |
strategy: | |
matrix: | |
os: [macos-11, ubuntu-20.04] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get gobin | |
uses: actions/download-artifact@v3 | |
with: | |
name: gobin_${{ github.event.release.tag_name }} | |
path: dist/ | |
- name: Configure linux build environment | |
if: runner.os == 'Linux' | |
run: | | |
mkdir -p bin | |
mv dist/envd_linux_amd64_v1/envd bin/envd | |
chmod +x bin/envd | |
- name: Configure macOS build environment | |
if: runner.os == 'macOS' | |
run: | | |
mkdir -p bin | |
mv dist/envd_darwin_all/envd bin/envd | |
chmod +x bin/envd | |
- name: Build wheels | |
uses: pypa/cibuildwheel@v2.15.0 | |
env: | |
CIBW_ARCHS_MACOS: arm64, x86_64 | |
CIBW_ARCHS_LINUX: auto64 | |
CIBW_SKIP: pp* | |
- name: Build source distribution | |
if: runner.os == 'Linux' # Only release source under linux to avoid conflict | |
run: | | |
python3 -m pip install wheel | |
python3 setup.py sdist | |
mv dist/*.tar.gz wheelhouse/ | |
- name: Upload to PyPI | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install twine | |
python -m twine upload wheelhouse/* | |
image_publish: | |
name: Build & push images | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: goreleaser | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Docker Buildx | |
run: | | |
./base-images/build.sh | |
envd_image_push: | |
name: Build & push envd images | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
needs: goreleaser | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Docker Buildx | |
run: | | |
./base-images/envd/build.sh | |
cache_publish: | |
name: Build & Push the remote cache | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build_func: ["build", "build_gpu_11_2", "build_gpu_11_3", "build_gpu_11_6"] | |
include: | |
- build_func: build | |
tag_suffix: "" | |
- build_func: build_gpu_11_2 | |
tag_suffix: "-cuda-11.2.2-cudnn-8" | |
- build_func: build_gpu_11_3 | |
tag_suffix: "-cuda-11.3.1-cudnn-8" | |
- build_func: build_gpu_11_6 | |
tag_suffix: "-cuda-11.6.2-cudnn-8" | |
needs: image_publish | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Get gobin | |
uses: actions/download-artifact@v3 | |
with: | |
name: gobin_${{ github.event.release.tag_name }} | |
path: dist/ | |
- name: Configure linux build environment | |
if: runner.os == 'Linux' | |
run: | | |
mv dist/envd_linux_amd64_v1/envd /usr/local/bin/envd | |
chmod +x /usr/local/bin/envd | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERIO_USERNAME }} | |
password: ${{ secrets.DOCKERIO_TOKEN }} | |
- name: Build and push | |
run: ./base-images/remote-cache/build-and-push-remote-cache.sh | |
env: | |
BUILD_FUNC: ${{ matrix.build_func }} | |
TAG_SUFFIX: ${{ matrix.TAG_SUFFIX }} | |
ENVD_BUILD_OWNER: 1000 |