v0.4.3 #295
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: | |
release: | |
types: [published] | |
workflow_dispatch: | |
jobs: | |
goreleaser: | |
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: 'stable' | |
- name: Login to Docker | |
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 | |
python_build: | |
needs: goreleaser | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [macos-13, ubuntu-22.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/[email protected] | |
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 artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pypi_${{ github.event.release.tag_name }}_${{ matrix.os }} | |
path: wheelhouse/ | |
retention-days: 1 | |
pypi_publish: | |
needs: python_build | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-24.04 | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: pypi_${{ github.event.release.tag_name }}_* | |
merge-multiple: true | |
path: dist/ | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
verbose: true | |
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@v4 | |
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 | |
# only trigger on main repo when tag starts with v | |
if: github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v') | |
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@v6 | |
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@v4 | |
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: | |
include: | |
- build_func: build | |
tag_suffix: "" | |
- 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@v4 | |
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 |