Files
wanderbooks/deploy/packaging/local-release.sh
T
swaitsandClaude Fable 5.1 3058b5c229 feat(packaging): the trial's Linux column and the Linux packages (P11a steps 1 and 3)
The Linux half of the packaging trial, run on this machine and in Debian,
Fedora and Arch containers, and the recipes it produced (docs/packaging.md
holds the table and what it found):

- mise.toml pins cargo-packager 0.11.8 and cargo-generate-rpm 0.21.1, now
  that `just package-linux` calls them. cargo-packager-updater is a
  library, not a tool, so it is not pinned (update.rs does the checking
  with minisign-verify, which is what the updater uses).
- deploy/packaging/: packager.toml (.deb, AppImage, the pacman tarball and
  its PKGBUILD), the rpm table in crates/ledger-cli/Cargo.toml, the AUR's
  own PKGBUILD (repacks the release tarball), build-linux.sh,
  repo-indexes.sh (the apt and dnf indexes, unsigned until the signing
  step), local-release.sh (a throwaway-keyed feed to try `update`),
  test-linux-packages.sh (linux_packages_install_and_upgrade: install
  0.1.0, open books as an ordinary user, upgrade to 0.1.1, check the host
  restarted onto the new file, the books' last journal line unchanged and
  `update` refuses; passes on Debian trixie, Fedora and Arch). A package
  marks itself package-managed with share/wanderbooks/install-method.
- The icon is a placeholder square (the AppImage cannot be built without
  one).
- .github/workflows/release.yml: on a version tag, build on ubuntu-24.04
  (the oldest glibc the packages claim: a program linked on this machine
  needs GLIBC_2.43 and does not start on Debian 13), attach the packages to
  the release, and add them to the apt and dnf repositories on gh-pages.
  No signing and no macOS or Windows job yet.
- The release profile strips symbols.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
2026-10-29 15:12:18 -06:00

33 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
# A release folder on this machine, for trying `wanderbooks update` without
# a network or the owner's keys (P11a step 2; docs/packaging.md).
#
# local-release.sh FILE VERSION OUTDIR
#
# Makes a throwaway signing key in OUTDIR/key (never a release key), signs
# FILE with it through cargo-packager, copies it beside a manifest.json in
# the shape `wanderbooks update` reads, and leaves the key's public half in
# OUTDIR/release.pub. Then:
#
# wanderbooks update --feed file://OUTDIR/manifest.json \
# --trusted-key OUTDIR/release.pub
set -euo pipefail
file=${1:?usage: local-release.sh FILE VERSION OUTDIR}
version=${2:?usage: local-release.sh FILE VERSION OUTDIR}
out=${3:?usage: local-release.sh FILE VERSION OUTDIR}
mkdir -p "$out"
if [ ! -f "$out/key" ]; then
cargo packager signer generate --path "$out/key" --password "" --ci >/dev/null
cp "$out/key.pub" "$out/release.pub"
fi
case "$(uname -m)" in arm64) arch=aarch64 ;; *) arch=$(uname -m) ;; esac
platform="$(uname -s | tr '[:upper:]' '[:lower:]')-$arch"
name="wanderbooks-$version-$platform"
cp "$file" "$out/$name"
cargo packager signer sign "$out/$name" --private-key "$out/key" --password "" >/dev/null
sha=$(sha256sum "$out/$name" | cut -d' ' -f1)
sig=$(tr -d '\n' <"$out/$name.sig")
printf '{"version":"%s","notes":"a local release","platforms":{"%s":{"url":"%s","sha256":"%s","signature":"%s"}}}\n' \
"$version" "$platform" "$name" "$sha" "$sig" >"$out/manifest.json"
echo "feed: file://$(cd "$out" && pwd)/manifest.json key: $out/release.pub"