Skip to content

chore: bump version to v0.7.6 #20

chore: bump version to v0.7.6

chore: bump version to v0.7.6 #20

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
env:
CARGO_TERM_COLOR: always
permissions:
contents: read
jobs:
create-release:
name: Create GitHub Release
runs-on: ubuntu-latest
permissions:
contents: write # create the GitHub release
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Create GitHub Release
run: gh release create "${GITHUB_REF_NAME}" --generate-notes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
needs: create-release
permissions:
contents: write # upload build artifacts to the 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@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@46268bd060767258de96ed93c1251119784f2ab6 # v1.16.1
with:
target: ${{ matrix.target }}
rustflags: ""
cache: false
- name: Install cross
if: matrix.use_cross
run: cargo install cross --locked
- name: Build release binary
shell: bash
env:
USE_CROSS: ${{ matrix.use_cross }}
TARGET: ${{ matrix.target }}
run: |
if [ "$USE_CROSS" = "true" ]; then
cross build --release --locked --target "$TARGET"
else
cargo build --release --locked --target "$TARGET"
fi
- name: Smoke test Windows binary
if: matrix.archive == 'zip'
shell: pwsh
env:
TARGET: ${{ matrix.target }}
run: |
./target/$env:TARGET/release/bl.exe --help | Out-Null
- name: Package binary (tar)
if: matrix.archive == 'tar'
env:
TARGET: ${{ matrix.target }}
run: tar czf "bl-$TARGET.tar.gz" -C "target/$TARGET/release" bl
- name: Package binary (zip)
if: matrix.archive == 'zip'
shell: pwsh
env:
TARGET: ${{ matrix.target }}
run: |
$releaseDir = "target/$env:TARGET/release"
Push-Location $releaseDir
try {
Compress-Archive -Path "bl.exe" -DestinationPath "${env:GITHUB_WORKSPACE}/bl-$env:TARGET.zip"
} finally {
Pop-Location
}
- name: Generate checksum (tar)
if: matrix.archive == 'tar'
shell: bash
env:
TARGET: ${{ matrix.target }}
run: |
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "bl-$TARGET.tar.gz" > "bl-$TARGET.tar.gz.sha256"
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 "bl-$TARGET.tar.gz" > "bl-$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
env:
TARGET: ${{ matrix.target }}
run: |
$hash = (Get-FileHash "bl-$env:TARGET.zip" -Algorithm SHA256).Hash.ToLower()
"$hash bl-$env:TARGET.zip" | Out-File -Encoding ascii "bl-$env:TARGET.zip.sha256"
- name: Upload to GitHub Release (tar)
if: matrix.archive == 'tar'
run: gh release upload "$GITHUB_REF_NAME" "bl-${TARGET}.tar.gz" "bl-${TARGET}.tar.gz.sha256"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET: ${{ matrix.target }}
- name: Upload to GitHub Release (zip)
if: matrix.archive == 'zip'
shell: pwsh
run: |
gh release upload "$env:GITHUB_REF_NAME" "bl-$env:TARGET.zip" "bl-$env:TARGET.zip.sha256"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TARGET: ${{ matrix.target }}
tag-latest:
name: Update latest tag
needs: build
runs-on: ubuntu-latest
permissions:
contents: write # force-push the latest tag
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: true
- name: Update latest tag
run: |
git tag -f latest
git push origin latest --force