Skip to content

chore: release v0.1.3 #3

chore: release v0.1.3

chore: release v0.1.3 #3

name: Release binaries
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
CARGO_HTTP_MULTIPLEXING: "false"
concurrency:
group: binaries-${{ github.ref }}
cancel-in-progress: false
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-14
target: x86_64-apple-darwin
- os: macos-14
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v6
- uses: dtolnay/rust-toolchain@1.89.0
with:
targets: ${{ matrix.target }}
- name: Verify tag matches crate version
shell: bash
run: |
set -euo pipefail
version="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "cliare") | .version')"
tag="${GITHUB_REF_NAME#v}"
if [[ "$tag" != "$version" ]]; then
echo "Tag v${tag} does not match Cargo.toml version ${version}."
exit 1
fi
- name: Build release binary
run: cargo build --locked --release --target "${{ matrix.target }}" --bin cliare
- name: Package archive
shell: bash
run: |
set -euo pipefail
package="cliare-${{ matrix.target }}"
mkdir -p "dist/${package}"
cp "target/${{ matrix.target }}/release/cliare" "dist/${package}/cliare"
cp README.md LICENSE "dist/${package}/"
tar -czf "dist/${package}.tar.gz" -C "dist/${package}" .
- uses: actions/upload-artifact@v4
with:
name: cliare-${{ matrix.target }}
path: dist/cliare-${{ matrix.target }}.tar.gz
if-no-files-found: error
publish:
name: Publish release assets
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Add installer and checksums
shell: bash
run: |
set -euo pipefail
cp install.sh dist/install.sh
cd dist
sha256sum cliare-*.tar.gz install.sh > SHA256SUMS
- name: Create or update GitHub release
env:
GH_TOKEN: ${{ github.token }}
shell: bash
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
if gh release view "$tag" >/dev/null 2>&1; then
gh release upload "$tag" dist/* --clobber
else
gh release create "$tag" dist/* \
--title "$tag" \
--generate-notes
fi