Skip to content

Release v1.9.1

Release v1.9.1 #23

Workflow file for this run

name: Release
run-name: "Release ${{ github.ref_name }}"
on:
push:
tags: ["v[0-9]+.[0-9]+.[0-9]+*"]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
jobs:
# ── E2E basic tests (gate before any release artifacts are published) ─────────
e2e-basic:
name: E2E basic tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install bats-core and Linux build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y bats libfontconfig-dev
- name: Run basic e2e tests
run: make tests/e2e/basic
# ── Linux x86_64 ─────────────────────────────────────────────────────────────
build-linux-x86_64:
name: Linux x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Linux build dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y libfontconfig-dev
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Release build
run: make release
- name: Generate shell completions
run: |
mkdir -p target/completions
target/release/sven completions bash > target/completions/sven.bash
target/release/sven completions zsh > target/completions/_sven
target/release/sven completions fish > target/completions/sven.fish
- name: Install cargo-deb
run: cargo install cargo-deb --locked
- name: Build .deb package
run: cargo deb --output target/debian/
- name: Stage artifacts
run: |
mkdir -p dist
cp target/release/sven dist/sven-linux-x86_64
cp target/release/sven-ui dist/sven-ui-linux-x86_64
cp target/debian/sven_*.deb dist/sven-linux-x86_64.deb
# Keep completions as a shared artifact for the arm64 deb build
cp -r target/completions dist/completions
- uses: actions/upload-artifact@v4
with:
name: linux-x86_64
path: dist/
# ── Linux aarch64 ────────────────────────────────────────────────────────────
# Cross-compiles via `cross` (Docker-based), reuses completions from x86 job.
# OpenSSL is vendored via the `openssl/vendored` Cargo feature in sven-node;
# Cross.toml installs `perl` in the cross container (required by OpenSSL's
# ./Configure script during the vendored source build).
# continue-on-error: the x86_64 release is never blocked by an aarch64 failure.
build-linux-aarch64:
name: Linux aarch64 [experimental]
runs-on: ubuntu-latest
needs: build-linux-x86_64
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
- uses: Swatinem/rust-cache@v2
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross --locked
- name: Build release binary (cross)
run: cross build --release --target aarch64-unknown-linux-gnu
- name: Download x86_64 completions
uses: actions/download-artifact@v4
with:
name: linux-x86_64
path: x86-artifacts
- name: Build .deb package (arm64)
run: |
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
bash scripts/build-deb.sh \
--out-dir target/debian \
--arch arm64 \
--binary target/aarch64-unknown-linux-gnu/release/sven \
--completions-dir x86-artifacts/completions
- name: Stage artifacts
run: |
mkdir -p dist
cp target/aarch64-unknown-linux-gnu/release/sven dist/sven-linux-aarch64
cp target/aarch64-unknown-linux-gnu/release/sven-ui dist/sven-ui-linux-aarch64 || true
cp target/debian/sven_*_arm64.deb dist/sven-linux-aarch64.deb
- uses: actions/upload-artifact@v4
with:
name: linux-aarch64
path: dist/
# ── macOS universal binary ────────────────────────────────────────────────────
# OpenSSL is vendored via the `openssl/vendored` Cargo feature declared in
# sven-node/Cargo.toml (which owns the webauthn-rs dependency). Cargo feature
# unification propagates `vendored` to the single openssl-sys compile unit, so
# OpenSSL is always built from source — no system library or Homebrew bottle
# required. This is the only reliable strategy when cross-compiling from the
# Apple Silicon (aarch64) macos-latest runner to x86_64, because Homebrew does
# not ship x86_64 bottles on that architecture.
build-macos:
name: macOS (universal) [experimental]
runs-on: macos-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin,aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
- name: Build x86_64
run: cargo build --release --target x86_64-apple-darwin
- name: Build aarch64
run: cargo build --release --target aarch64-apple-darwin
- name: Create universal binary
run: |
mkdir -p dist
lipo -create \
target/x86_64-apple-darwin/release/sven \
target/aarch64-apple-darwin/release/sven \
-output dist/sven-darwin-universal
# Create universal sven-ui binary if both architectures built successfully
if [[ -f target/x86_64-apple-darwin/release/sven-ui && -f target/aarch64-apple-darwin/release/sven-ui ]]; then
lipo -create \
target/x86_64-apple-darwin/release/sven-ui \
target/aarch64-apple-darwin/release/sven-ui \
-output dist/sven-ui-darwin-universal
fi
- uses: actions/upload-artifact@v4
with:
name: macos
path: dist/
# ── Windows x86_64 ───────────────────────────────────────────────────────────
# continue-on-error: Windows build failures never block the Linux release.
build-windows:
name: Windows x86_64 [experimental]
runs-on: windows-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Release build
run: cargo build --release
- name: Stage artifacts
run: |
mkdir dist
copy target\release\sven.exe dist\sven-windows-x86_64.exe
- uses: actions/upload-artifact@v4
with:
name: windows
path: dist/
# ── GitHub Release ────────────────────────────────────────────────────────────
publish:
name: Publish GitHub Release
runs-on: ubuntu-latest
# aarch64, macOS, and Windows are excluded from needs so their failures
# never block the Linux release. e2e-basic must pass — if any basic test
# fails the release is aborted.
needs: [e2e-basic, build-linux-x86_64]
steps:
- uses: actions/checkout@v4
- name: Download x86_64 artifact
uses: actions/download-artifact@v4
with:
name: linux-x86_64
path: dist
- name: Download aarch64 artifact (if available)
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: linux-aarch64
path: dist
- name: Download macOS artifact (if available)
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: macos
path: dist
- name: Download Windows artifact (if available)
uses: actions/download-artifact@v4
continue-on-error: true
with:
name: windows
path: dist
- name: List artifacts
run: ls -lh dist/
- name: Generate checksums
run: |
cd dist
# Remove the completions directory (not a release artifact)
rm -rf completions
sha256sum sven-* > checksums.txt
cat checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/*
generate_release_notes: true
fail_on_unmatched_files: false