refactor: agent state machine, deterministic result passing, overflow… #8
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| BINARY_NAME: loopal | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: aarch64-apple-darwin | |
| os: macos-14 | |
| archive: tar.gz | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| archive: tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-24.04-arm | |
| archive: tar.gz | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| archive: zip | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install system dependencies (Linux) | |
| if: runner.os == 'Linux' | |
| run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config | |
| - name: Setup Bazel | |
| uses: bazel-contrib/setup-bazel@0.14.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: release-${{ matrix.target }} | |
| repository-cache: true | |
| - name: Build release binary | |
| run: bazel build //:loopal -c opt | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| ARCHIVE_DIR="${BINARY_NAME}-${{ github.ref_name }}-${{ matrix.target }}" | |
| mkdir -p "${ARCHIVE_DIR}" | |
| BIN_PATH=$(bazel cquery --output=files //:loopal -c opt 2>/dev/null) | |
| cp "${BIN_PATH}" "${ARCHIVE_DIR}/" | |
| cp README.md "${ARCHIVE_DIR}/" 2>/dev/null || true | |
| cp LICENSE "${ARCHIVE_DIR}/" 2>/dev/null || true | |
| tar czf "${ARCHIVE_DIR}.tar.gz" "${ARCHIVE_DIR}" | |
| echo "ASSET=${ARCHIVE_DIR}.tar.gz" >> "$GITHUB_ENV" | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $archiveDir = "$env:BINARY_NAME-${{ github.ref_name }}-${{ matrix.target }}" | |
| New-Item -ItemType Directory -Path $archiveDir -Force | |
| $binPath = (bazel cquery --output=files //:loopal -c opt 2>$null).Trim() | |
| Copy-Item $binPath "$archiveDir/" | |
| if (Test-Path "README.md") { Copy-Item "README.md" "$archiveDir/" } | |
| if (Test-Path "LICENSE") { Copy-Item "LICENSE" "$archiveDir/" } | |
| Compress-Archive -Path "$archiveDir" -DestinationPath "$archiveDir.zip" | |
| echo "ASSET=$archiveDir.zip" | Out-File -Append $env:GITHUB_ENV | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ env.BINARY_NAME }}-${{ matrix.target }} | |
| path: ${{ env.ASSET }} | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: List artifacts | |
| run: ls -la artifacts/ | |
| - uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |