diff --git a/.github/workflows/actions.lock b/.github/workflows/actions.lock
index 611efb7..d93caab 100644
--- a/.github/workflows/actions.lock
+++ b/.github/workflows/actions.lock
@@ -11,15 +11,37 @@ workflows:
- 'actions/checkout@v7.0.1'
- 'actions/upload-artifact@v7.0.2'
- 'swatinem/rust-cache@v2.9.3'
+ '.github/workflows/release.yml':
+ - 'actions/attest-build-provenance@v4.2.2'
+ - 'actions/checkout@v7.0.1'
+ - 'actions/download-artifact@v8.0.2'
+ - 'actions/upload-artifact@v7.0.2'
'.github/workflows/zizmor.yml':
- 'actions/checkout@v7.0.1'
- 'zizmorcore/zizmor-action@v0.8.1'
dependencies:
+ 'actions/attest-build-provenance@v4.2.2':
+ ref: 'v4.2.2'
+ commit: 'sha1-4d101475d8b20a2381f78447822ac1eab6504dd8'
+ owner_id: 44036562
+ repo_id: 760702757
+ uses:
+ - 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d'
+ 'actions/attest@508db95dd578ae2727ebd6217d5ba78e4fbda05d':
+ ref: 'v4.2.1'
+ commit: 'sha1-508db95dd578ae2727ebd6217d5ba78e4fbda05d'
+ owner_id: 44036562
+ repo_id: 760701061
'actions/checkout@v7.0.1':
ref: 'v7.0.1'
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
owner_id: 44036562
repo_id: 197814629
+ 'actions/download-artifact@v8.0.2':
+ ref: 'v8.0.2'
+ commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333'
+ owner_id: 44036562
+ repo_id: 192626254
'actions/upload-artifact@v7.0.2':
ref: 'v7.0.2'
commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9'
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..d354a8b
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,255 @@
+# Builds libbui for every platform it ships on and publishes a GitHub Release
+# for each `v*` tag, with SHA256SUMS and build provenance. Tags are cut on
+# Tangled; .tangled/workflows/mirror.yaml forwards them here.
+#
+# Before tagging vX.Y.Z: set `version = "X.Y.Z"` in Cargo.toml and add a
+# `## [X.Y.Z]` section to CHANGELOG.md. Its text becomes the release notes.
+#
+# Downloads and attestations are only public while this repository is public;
+# install.sh and the README read releases from it.
+name: release
+
+on:
+ push:
+ tags:
+ - "v*"
+ # Builds every binary without publishing, to try a change to this file.
+ workflow_dispatch:
+
+# A tag publishes once; a second run for the same tag waits instead of racing.
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: false
+
+permissions: {}
+
+env:
+ CARGO_TERM_COLOR: always
+ CARGO_INCREMENTAL: 0
+
+jobs:
+ check:
+ name: π·οΈ Tag matches the crate
+ runs-on: ubuntu-24.04
+ timeout-minutes: 5
+ permissions:
+ contents: read # checkout repository
+
+ steps:
+ - uses: actions/checkout@v7.0.1
+ with:
+ persist-credentials: false
+
+ - name: π·οΈ Compare the tag, Cargo.toml and CHANGELOG.md
+ env:
+ REF_TYPE: ${{ github.ref_type }}
+ REF_NAME: ${{ github.ref_name }}
+ run: |
+ version="$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -n 1)"
+ if [ -z "$version" ]; then
+ echo "::error file=Cargo.toml::no workspace version found"
+ exit 1
+ fi
+ if [ "$REF_TYPE" = tag ] && [ "$REF_NAME" != "v$version" ]; then
+ echo "::error file=Cargo.toml::tag $REF_NAME does not match version $version"
+ exit 1
+ fi
+ if [ "$REF_TYPE" = tag ] && ! grep -q "^## \[$version\]" CHANGELOG.md; then
+ echo "::error file=CHANGELOG.md::no '## [$version]' section for the release notes"
+ exit 1
+ fi
+
+ build:
+ name: π¦ ${{ matrix.target }}
+ needs: check
+ runs-on: ${{ matrix.os }}
+ timeout-minutes: 60
+ permissions:
+ contents: read # checkout repository
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - target: x86_64-unknown-linux-musl
+ os: ubuntu-24.04
+ - target: aarch64-unknown-linux-musl
+ os: ubuntu-24.04
+ qemu: qemu-aarch64-static
+ - target: riscv64gc-unknown-linux-musl
+ os: ubuntu-24.04
+ qemu: qemu-riscv64-static
+ - target: aarch64-apple-darwin
+ os: macos-15
+ - target: x86_64-apple-darwin
+ os: macos-15
+ - target: x86_64-pc-windows-msvc
+ os: windows-2025
+
+ env:
+ TARGET: ${{ matrix.target }}
+ # Without it the .exe needs the Visual C++ runtime installed separately.
+ CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_RUSTFLAGS: -C target-feature=+crt-static
+
+ # No build cache: a release is built from nothing so a poisoned cache
+ # cannot reach a published binary.
+ steps:
+ - uses: actions/checkout@v7.0.1
+ with:
+ persist-credentials: false
+
+ # rust-toolchain.toml names the channel and components.
+ - name: π¦ Install the toolchain
+ shell: bash
+ run: |
+ rustup toolchain install --profile minimal
+ rustup target add "$TARGET"
+
+ # Zig is the C cross compiler for ring and aws-lc; checked by hash.
+ - name: β‘ Install Zig, cargo-zigbuild and qemu-user
+ if: runner.os == 'Linux'
+ env:
+ ZIG_VERSION: 0.17.1
+ ZIG_SHA256: 3581863e3cbcfd0fce0efc682ce7e9e93da96668a977791d356a26d2a7e9b17a
+ run: |
+ curl -fsSLo zig.tar.xz "https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz"
+ echo "${ZIG_SHA256} zig.tar.xz" | sha256sum -c -
+ mkdir -p "$HOME/zig"
+ tar -xJf zig.tar.xz -C "$HOME/zig" --strip-components=1
+ rm zig.tar.xz
+ echo "$HOME/zig" >> "$GITHUB_PATH"
+ cargo install --locked cargo-zigbuild@0.24.1
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends qemu-user-static
+
+ # Static, and run once natively or under qemu-user.
+ - name: π§ Build and smoke-test
+ if: runner.os == 'Linux'
+ env:
+ QEMU: ${{ matrix.qemu }}
+ REQUIRE_QEMU: "1"
+ run: |
+ scripts/static-linux.sh "$TARGET"
+ echo "BINARY=target/$TARGET/release/libbui" >> "$GITHUB_ENV"
+
+ - name: π Build and smoke-test
+ if: runner.os == 'macOS'
+ run: |
+ cargo build --locked --release -p libbui --target "$TARGET"
+ binary="target/$TARGET/release/libbui"
+ want="${TARGET%%-*}"
+ [ "$want" = aarch64 ] && want=arm64
+ got="$(lipo -archs "$binary")"
+ if [ "$got" != "$want" ]; then
+ echo "::error::$binary is built for $got, not $want"
+ exit 1
+ fi
+ # The runner is Apple silicon; Intel builds run under Rosetta.
+ case "$TARGET" in
+ aarch64-*) run="" ;;
+ x86_64-*) run="arch -x86_64" ;;
+ esac
+ $run "$binary" --version
+ $run "$binary" --help >/dev/null
+ HOME="$(mktemp -d)" $run "$binary" paths --json >/dev/null
+ echo "BINARY=$binary" >> "$GITHUB_ENV"
+
+ - name: πͺ Build and smoke-test
+ if: runner.os == 'Windows'
+ shell: bash
+ run: |
+ cargo build --locked --release -p libbui --target "$TARGET"
+ binary="target/$TARGET/release/libbui.exe"
+ "$binary" --version
+ "$binary" --help >/dev/null
+ echo "BINARY=$binary" >> "$GITHUB_ENV"
+
+ # libbui- Needs Rust 1.90 or newer. No system libraries required.
+ On Linux and macOS, this fetches the build made for your computer, checks it against
+ the release checksums and puts
+ Each release
+ has a ready-to-run libbui for Linux (x86_64, ARM64 and RISC-V), macOS (Apple
+ silicon and Intel) and Windows, plus a Needs Rust 1.90 or newer. No system libraries required.
Install with Cargo
- Install libbui
+ libbui in ~/.local/bin. It
+ never asks for your password, and you can read the script
+ first.
+
-
+ cargo install --locked --git https://tangled.sh/@vinnymac.dev/libbui libbui
+
+ curl -fsSL https://libbui.vinnymac.dev/install.sh | shDownload it yourself
+ SHA256SUMS file to check it
+ against. Unpack it and put libbui anywhere on your PATH.
+ Build it with Cargo
+
+
+ cargo install --locked --git https://tangled.sh/@vinnymac.dev/libbui libbui
Give it a try below
+Give it a try
-(^vDH^+fSZ*=)Q5$rb(?+m%iNFG(~yx;>i!@Z8r95Qf?9W^_JD;
z+3FJ?jAK*|oS*%-R{ibsC!!{QL#IxjdhXQ8R>{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