diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec0cfb6d0..6ad5aeac0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,49 @@ env: IMAGE_PREFIX: ${{ github.repository }} jobs: + # ============================================================================ + # Job 0: Generate protobuf code (required by all builds) + # ============================================================================ + generate-proto: + name: Generate Protobuf Code + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Setup protoc + uses: arduino/setup-protoc@v3 + with: + version: '25.x' + repo-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Install protoc-gen-go + run: | + go install google.golang.org/protobuf/cmd/protoc-gen-go@latest + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest + + - name: Install buf + uses: bufbuild/buf-setup-action@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: Generate protobuf code + run: make proto-go + + - name: Upload generated proto code + uses: actions/upload-artifact@v4 + with: + name: proto-generated + path: pkg/plugin/gen/ + retention-days: 1 + # ============================================================================ # Job 1: Build release and debug binaries for all platforms # ============================================================================ @@ -38,6 +81,7 @@ jobs: name: Build Binaries (${{ matrix.service }}-${{ matrix.os }}-${{ matrix.arch }}) runs-on: ${{ matrix.runner }} timeout-minutes: 20 + needs: generate-proto strategy: fail-fast: false @@ -63,6 +107,12 @@ jobs: with: fetch-depth: 0 # Full history for version info + - name: Download generated proto code + uses: actions/download-artifact@v4 + with: + name: proto-generated + path: pkg/plugin/gen/ + - name: Setup Go uses: actions/setup-go@v5 with: @@ -186,6 +236,7 @@ jobs: name: Build Rust Proxy (${{ matrix.target }}) runs-on: ${{ matrix.runner }} timeout-minutes: 30 + needs: generate-proto strategy: fail-fast: false @@ -214,6 +265,12 @@ jobs: with: fetch-depth: 0 + - name: Download generated proto code + uses: actions/download-artifact@v4 + with: + name: proto-generated + path: pkg/plugin/gen/ + - name: Setup Rust uses: dtolnay/rust-toolchain@stable with: