📦 Build & Publish Rust Binaries #6
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: 📦 Build & Publish Rust Binaries | |
| on: | |
| push: | |
| tags: | |
| - 'v*' # triggers on tags like v0.4.1 | |
| - '[0-9]*' # catch numeric-only tags like 0.4.1 | |
| jobs: | |
| build-and-release: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Cache Cargo registry & Git data | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Install Rust stable | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| override: true | |
| - name: Build (release) | |
| run: cargo build --locked --release --all-targets | |
| - name: Package binaries | |
| run: | | |
| mkdir -p dist | |
| case "${{ matrix.os }}" in | |
| ubuntu-latest) | |
| tar -czvf dist/cliptions-linux-v${{ github.ref_name }}.tar.gz -C target/release cliptions | |
| ;; | |
| macos-latest) | |
| tar -czvf dist/cliptions-macos-v${{ github.ref_name }}.tar.gz -C target/release cliptions | |
| ;; | |
| windows-latest) | |
| zip -j dist/cliptions-windows-v${{ github.ref_name }}.zip target/release/cliptions.exe | |
| ;; | |
| esac | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| body: | | |
| ## Cliptions Core ${{ github.ref_name }} | |
| ### Single Binary Release: | |
| - `cliptions` - Unified CLI tool with subcommands for all Cliptions functionality | |
| ### Available Subcommands: | |
| - `generate-commitment` - Generate cryptographic commitments | |
| - `collect-commitments` - Collect commitments from Twitter | |
| - `reply-with-fees` - Reply with fee addresses | |
| - `collect-reveals` - Collect reveals from Twitter | |
| - `verify-commitments` - Verify commitment hashes | |
| - `calculate-scores` - Calculate scores and payouts | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |