Build and Release Loadgen #2
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 and Release Loadgen | |
| on: | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build Loadgen Binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: stable | |
| - name: Build Loadgen for multiple platforms | |
| run: | | |
| cd workshop/ninja/advanced-otel/loadgen/ | |
| mkdir -p artifacts | |
| for GOOS in linux darwin windows; do | |
| for GOARCH in amd64 arm64; do | |
| OUTPUT="loadgen-${GOOS}-${GOARCH}" | |
| [ "$GOOS" == "windows" ] && OUTPUT+=".exe" | |
| GOOS=$GOOS GOARCH=$GOARCH go build -o artifacts/$OUTPUT loadgen.go | |
| done | |
| done | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: loadgen-binaries | |
| path: workshop/ninja/advanced-otel/loadgen/artifacts/* | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: loadgen-binaries | |
| path: ./artifacts | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ./artifacts/* | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false |