Skip to content

v0.3.44

v0.3.44 #288

Workflow file for this run

name: release
on:
release:
types: [published]
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@v5
with:
go-version: 1.19.10
- name: Docker Login
uses: docker/login-action@v3
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@v4
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@v4
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: setup Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Build wheels
uses: pypa/cibuildwheel@v2.16.2
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: |
python -m pip install wheel
python 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@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: Docker Buildx
run: |
./base-images/build.sh
envd_starship_publish:
name: Push starship image to Docker Hub
runs-on: ubuntu-latest
needs: goreleaser
steps:
- uses: actions/checkout@v4
- name: Docker Login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERIO_USERNAME }}
password: ${{ secrets.DOCKERIO_TOKEN }}
- name: Docker Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
push: true
file: base-images/envd-starship/envd-starship.Dockerfile
platforms: linux/amd64,linux/arm64
tags: tensorchord/starship:v0.0.1
cache-from: type=gha
cache-to: type=gha,mode=max
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@v3
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@v4
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@v3
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