fix: install protoc in CI setup action #571
Workflow file for this run
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: Publish Docker Image | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| branches: | |
| - main | |
| # You can enable the below to build on each PR push for testing, | |
| # pull_request: | |
| # branches: | |
| # - main | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: lay3rlabs/wavs | |
| jobs: | |
| build_amd64: | |
| name: Build and Push AMD64 Image | |
| runs-on: linux-8-core | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Install wkg | |
| run: cargo install wkg | |
| - name: Configure wasm-pkg registry | |
| run: | | |
| mkdir -p ~/.config/wasm-pkg | |
| cat > ~/.config/wasm-pkg/config.toml << 'EOF' | |
| default_registry = "wa.dev" | |
| EOF | |
| - name: Fetch WIT dependencies | |
| run: | | |
| cd wit-definitions/types && wkg wit fetch | |
| cd ../../wit-definitions/operator && wkg wit fetch | |
| cd ../../wit-definitions/aggregator && wkg wit fetch | |
| - name: Set IMAGE_TAG | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| TAG="${GITHUB_REF_NAME#v}" | |
| IMAGE_TAG="${TAG//[^a-zA-Z0-9_.-]/-}" | |
| elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then | |
| IMAGE_TAG="latest" | |
| else | |
| IMAGE_TAG="${GITHUB_REF_NAME//\//-}" | |
| fi | |
| echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push AMD64 image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-amd64 | |
| platforms: linux/amd64 | |
| provenance: false | |
| build_arm64: | |
| name: Build and Push ARM64 Image | |
| runs-on: arm64-builder | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| - name: Install wkg | |
| run: cargo install wkg | |
| - name: Configure wasm-pkg registry | |
| run: | | |
| mkdir -p ~/.config/wasm-pkg | |
| cat > ~/.config/wasm-pkg/config.toml << 'EOF' | |
| default_registry = "wa.dev" | |
| EOF | |
| - name: Fetch WIT dependencies | |
| run: | | |
| cd wit-definitions/types && wkg wit fetch | |
| cd ../../wit-definitions/operator && wkg wit fetch | |
| cd ../../wit-definitions/aggregator && wkg wit fetch | |
| - name: Set IMAGE_TAG | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| TAG="${GITHUB_REF_NAME#v}" | |
| IMAGE_TAG="${TAG//[^a-zA-Z0-9_.-]/-}" | |
| elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then | |
| IMAGE_TAG="latest" | |
| else | |
| IMAGE_TAG="${GITHUB_REF_NAME//\//-}" | |
| fi | |
| echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push ARM64 image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| push: true | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-arm64 | |
| platforms: linux/arm64 | |
| provenance: false | |
| create_manifest: | |
| name: Create and Push Multi-Arch Manifest | |
| runs-on: ubuntu-latest | |
| needs: [build_amd64, build_arm64] | |
| permissions: | |
| contents: read | |
| packages: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: ./.github/actions/setup | |
| - name: Set IMAGE_TAG | |
| shell: bash | |
| run: | | |
| if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then | |
| TAG="${GITHUB_REF_NAME#v}" | |
| IMAGE_TAG="${TAG//[^a-zA-Z0-9_.-]/-}" | |
| elif [[ "${GITHUB_REF_NAME}" == "main" ]]; then | |
| IMAGE_TAG="latest" | |
| else | |
| IMAGE_TAG="${GITHUB_REF_NAME//\//-}" | |
| fi | |
| echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to the 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: | | |
| export GIT_HASH=$(git rev-parse --short "$GITHUB_SHA") | |
| docker buildx imagetools create \ | |
| --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} \ | |
| --tag ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:$GIT_HASH \ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-amd64 \ | |
| ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}-arm64 |