chore: bump version to v0.1.2 #3
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: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| needs: create-release | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| use_cross: false | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| use_cross: true | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Cache cargo registry | |
| uses: actions/cache@v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.target }}-cargo- | |
| - name: Install cross | |
| if: matrix.use_cross | |
| run: cargo install cross --locked | |
| - name: Build release binary | |
| run: | | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build --release --locked --target ${{ matrix.target }} | |
| else | |
| cargo build --release --locked --target ${{ matrix.target }} | |
| fi | |
| - name: Package binary | |
| run: tar czf bl-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release bl | |
| - name: Generate checksum | |
| run: | | |
| if command -v sha256sum >/dev/null 2>&1; then | |
| sha256sum bl-${{ matrix.target }}.tar.gz > bl-${{ matrix.target }}.tar.gz.sha256 | |
| elif command -v shasum >/dev/null 2>&1; then | |
| shasum -a 256 bl-${{ matrix.target }}.tar.gz > bl-${{ matrix.target }}.tar.gz.sha256 | |
| else | |
| echo "Error: neither sha256sum nor shasum is available." >&2 | |
| exit 1 | |
| fi | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| bl-${{ matrix.target }}.tar.gz | |
| bl-${{ matrix.target }}.tar.gz.sha256 | |
| tag-latest: | |
| name: Update latest tag | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Update latest tag | |
| run: | | |
| git tag -f latest | |
| git push origin latest --force |