Skip to content

chore(release): bump cli versions to 0.6.8 #69

chore(release): bump cli versions to 0.6.8

chore(release): bump cli versions to 0.6.8 #69

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
jobs:
build:
name: Build (${{ matrix.target }})
runs-on: ${{ matrix.runs_on }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
include:
- runs_on: ubuntu-latest
target: x86_64-unknown-linux-gnu
- runs_on: ubuntu-latest
target: aarch64-unknown-linux-gnu
- runs_on: macos-14
target: x86_64-apple-darwin
- runs_on: macos-14
target: aarch64-apple-darwin
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Install ripgrep
shell: bash
run: |
set -euo pipefail
if command -v rg >/dev/null 2>&1; then
rg --version
exit 0
fi
case "${RUNNER_OS}" in
Linux)
sudo apt-get update
sudo apt-get install -y ripgrep
;;
macOS)
brew install ripgrep
;;
*)
echo "error: unsupported RUNNER_OS for ripgrep install: ${RUNNER_OS}" >&2
exit 1
;;
esac
rg --version
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Cache cargo
uses: Swatinem/rust-cache@v2
- name: Regenerate third-party artifacts
shell: bash
run: |
set -euo pipefail
bash scripts/generate-third-party-artifacts.sh --write
bash scripts/generate-third-party-artifacts.sh --check
- name: Install cross
if: matrix.target == 'aarch64-unknown-linux-gnu'
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Build (release)
if: matrix.target != 'aarch64-unknown-linux-gnu'
run: cargo build --release --workspace --locked --target ${{ matrix.target }}
- name: Build (release, cross)
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: cross build --release --workspace --locked --target ${{ matrix.target }}
- name: Package
shell: bash
run: |
set -euo pipefail
tag="${GITHUB_REF_NAME}"
target="${{ matrix.target }}"
out_dir="dist/nils-cli-${tag}-${target}"
mkdir -p "${out_dir}/bin"
bins=()
while IFS= read -r bin; do
[[ -n "${bin}" ]] || continue
bins+=( "${bin}" )
done < <(bash scripts/workspace-bins.sh)
if [[ ${#bins[@]} -eq 0 ]]; then
echo "error: no workspace binaries found" >&2
exit 1
fi
for bin in "${bins[@]}"; do
src="target/${target}/release/${bin}"
if [[ ! -f "${src}" ]]; then
echo "error: missing binary: ${src}" >&2
exit 1
fi
install -m 0755 "${src}" "${out_dir}/bin/${bin}"
done
cp -R completions "${out_dir}/"
cp README.md LICENSE THIRD_PARTY_LICENSES.md THIRD_PARTY_NOTICES.md "${out_dir}/"
tarball="dist/nils-cli-${tag}-${target}.tar.gz"
tar -C dist -czf "${tarball}" "nils-cli-${tag}-${target}"
if command -v sha256sum >/dev/null 2>&1; then
sha256sum "${tarball}" > "${tarball}.sha256"
elif command -v shasum >/dev/null 2>&1; then
shasum -a 256 "${tarball}" > "${tarball}.sha256"
else
echo "error: sha256sum/shasum not found" >&2
exit 1
fi
- name: Audit release tarball third-party artifacts
shell: bash
run: |
set -euo pipefail
bash scripts/ci/release-tarball-third-party-audit.sh \
--target "${{ matrix.target }}" \
--tag "${{ github.ref_name }}"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: nils-cli-${{ matrix.target }}
if-no-files-found: error
path: |
dist/nils-cli-${{ github.ref_name }}-${{ matrix.target }}.tar.gz
dist/nils-cli-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256
release:
name: GitHub Release
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: dist
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: dist/**/*.tar.gz*