chore: bump version to v0.7.1 #15
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 | |
| archive: tar | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| use_cross: true | |
| archive: tar | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| archive: tar | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| use_cross: false | |
| archive: tar | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| use_cross: false | |
| archive: zip | |
| 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 | |
| shell: bash | |
| run: | | |
| if [ "${{ matrix.use_cross }}" = "true" ]; then | |
| cross build --release --locked --target ${{ matrix.target }} | |
| else | |
| cargo build --release --locked --target ${{ matrix.target }} | |
| fi | |
| - name: Smoke test Windows binary | |
| if: matrix.archive == 'zip' | |
| shell: pwsh | |
| run: | | |
| ./target/${{ matrix.target }}/release/bl.exe --help | Out-Null | |
| - name: Package binary (tar) | |
| if: matrix.archive == 'tar' | |
| run: tar czf bl-${{ matrix.target }}.tar.gz -C target/${{ matrix.target }}/release bl | |
| - name: Package binary (zip) | |
| if: matrix.archive == 'zip' | |
| shell: pwsh | |
| run: | | |
| $releaseDir = "target/${{ matrix.target }}/release" | |
| Push-Location $releaseDir | |
| try { | |
| Compress-Archive -Path "bl.exe" -DestinationPath "${env:GITHUB_WORKSPACE}/bl-${{ matrix.target }}.zip" | |
| } finally { | |
| Pop-Location | |
| } | |
| - name: Generate checksum (tar) | |
| if: matrix.archive == 'tar' | |
| shell: bash | |
| 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: Generate checksum (zip) | |
| if: matrix.archive == 'zip' | |
| shell: pwsh | |
| run: | | |
| $hash = (Get-FileHash bl-${{ matrix.target }}.zip -Algorithm SHA256).Hash.ToLower() | |
| "$hash bl-${{ matrix.target }}.zip" | Out-File -Encoding ascii bl-${{ matrix.target }}.zip.sha256 | |
| - name: Upload to GitHub Release (tar) | |
| if: matrix.archive == 'tar' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| bl-${{ matrix.target }}.tar.gz | |
| bl-${{ matrix.target }}.tar.gz.sha256 | |
| - name: Upload to GitHub Release (zip) | |
| if: matrix.archive == 'zip' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| bl-${{ matrix.target }}.zip | |
| bl-${{ matrix.target }}.zip.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 |