Release #1
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
| # Build release binaries on tag push and attach them to a GitHub Release. | |
| # Targets: macOS arm64, macOS x86_64, Linux x86_64, Linux arm64. | |
| # All free via GitHub Actions — no external services. | |
| name: Release | |
| on: | |
| push: | |
| tags: ["v*"] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: macOS arm64 | |
| os: macos-latest | |
| target: aarch64-apple-darwin | |
| - name: macOS x86_64 | |
| os: macos-latest | |
| target: x86_64-apple-darwin | |
| - name: Linux x86_64 | |
| os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - name: Linux arm64 | |
| os: ubuntu-24.04-arm | |
| target: aarch64-unknown-linux-gnu | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "agent\nserver" | |
| - name: Build agent | |
| run: cargo build --release --manifest-path agent/Cargo.toml --target ${{ matrix.target }} | |
| - name: Build server | |
| run: cargo build --release --manifest-path server/Cargo.toml --target ${{ matrix.target }} | |
| - name: Package | |
| run: | | |
| mkdir -p dist | |
| for bin in tokenhud-agent tokenhud-server; do | |
| src="agent/target/${{ matrix.target }}/release/${bin}" | |
| [ ! -f "$src" ] && src="server/target/${{ matrix.target }}/release/${bin}" | |
| artifact="${bin}-${{ matrix.target }}" | |
| cp "$src" "dist/${artifact}" | |
| chmod +x "dist/${artifact}" | |
| shasum -a 256 "dist/${artifact}" > "dist/${artifact}.sha256" | |
| done | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.target }} | |
| path: dist/ | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: artifacts/* |