chore(master): release 0.9.0 (#69) #180
This file contains hidden or 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: Build images | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| jobs: | |
| build-images: | |
| outputs: | |
| version: ${{ steps.meta.outputs.version }} | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| arch: | |
| - amd64 | |
| - arm64 | |
| include: | |
| - arch: amd64 | |
| runner: ubuntu-latest | |
| - arch: arm64 | |
| runner: ubuntu-24.04-arm | |
| runs-on: ${{ matrix.runner }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ghcr.io/${{ github.repository }}/zkboost | |
| tags: | | |
| type=sha,prefix=,format=short,enable=${{ github.ref == 'refs/heads/master' || github.event_name == 'pull_request' }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build zkboost image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: docker/Dockerfile | |
| push: ${{ github.event_name == 'push' }} | |
| platforms: linux/${{ matrix.arch }} | |
| tags: ghcr.io/${{ github.repository }}/zkboost:${{ steps.meta.outputs.version }}-${{ matrix.arch }} | |
| cache-from: type=gha,scope=zkboost-${{ matrix.arch }} | |
| cache-to: type=gha,mode=max,scope=zkboost-${{ matrix.arch }} | |
| check-git-tag: | |
| name: Check whether git tag exists | |
| if: github.event_name == 'push' | |
| needs: build-images | |
| runs-on: ubuntu-latest | |
| outputs: | |
| exists: ${{ steps.check-git-tag.outputs.exists }} | |
| semver: ${{ steps.check-git-tag.outputs.semver }} | |
| steps: | |
| - name: Check whether tag exists | |
| id: check-git-tag | |
| run: | | |
| TAG=$(git ls-remote --tags "https://github.com/${{ github.repository }}" "v*" \ | |
| | awk '$1 == "${{ github.sha }}" { sub("refs/tags/", "", $2); sub(/\^\{\}$/, "", $2); print $2; exit }') | |
| echo "exists=$([[ -n "$TAG" ]] && echo true || echo false)" >> "$GITHUB_OUTPUT" | |
| echo "semver=${TAG#v}" >> "$GITHUB_OUTPUT" | |
| merge-manifests: | |
| permissions: | |
| contents: read | |
| packages: write | |
| needs: [build-images, check-git-tag] | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| steps: | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push multi-arch manifest | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}/zkboost:${{ needs.build-images.outputs.version }} \ | |
| ghcr.io/${{ github.repository }}/zkboost:${{ needs.build-images.outputs.version }}-amd64 \ | |
| ghcr.io/${{ github.repository }}/zkboost:${{ needs.build-images.outputs.version }}-arm64 | |
| - name: Tag semver and latest | |
| if: needs.check-git-tag.outputs.exists == 'true' | |
| run: | | |
| docker buildx imagetools create \ | |
| -t ghcr.io/${{ github.repository }}/zkboost:${{ needs.check-git-tag.outputs.semver }} \ | |
| -t ghcr.io/${{ github.repository }}/zkboost:latest \ | |
| ghcr.io/${{ github.repository }}/zkboost:${{ needs.build-images.outputs.version }} |