Add release job to CI: build aidlcli for arm64 and amd64 on tag push #16
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: CI | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| go-version: ['1.25.x'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: ${{ matrix.go-version }} | |
| - name: Unit tests | |
| run: go test -v -race $(go list -e ./tools/pkg/... | grep -v /3rdparty/) ./binder/ ./parcel/ | |
| - name: Vet | |
| run: go vet $(go list -e ./tools/pkg/... ./tools/... | grep -v /3rdparty/) ./binder/ ./parcel/ ./kernelbinder/ ./servicemanager/ ./errors/ | |
| - name: Build commands and tools | |
| run: go build ./tools/cmd/... | |
| - name: Build examples | |
| run: | | |
| for d in examples/*/; do | |
| echo "Building $d..." | |
| go build "./$d" | |
| done | |
| - name: Verify generated code is up to date | |
| run: | | |
| make clean | |
| make generate | |
| make smoke | |
| make readme | |
| git diff --exit-code | |
| release: | |
| needs: test | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 1 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.25.x' | |
| - name: Build aidlcli binaries | |
| run: | | |
| CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o aidlcli-linux-arm64 ./cmd/aidlcli/ | |
| CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o aidlcli-linux-amd64 ./cmd/aidlcli/ | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| aidlcli-linux-arm64 | |
| aidlcli-linux-amd64 | |
| generate_release_notes: true |