From 5c2ff0dca9e090c785eed1aef18b28d61dfa69be Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 30 Sep 2026 18:44:23 +0200 Subject: [PATCH] build: add Gitea release wrapper --- docs/releasing.md | 17 +++++++++++++++++ release.sh | 36 ++++++++++++++++++++++++++++++++++++ tasks.md | 10 ++++++++++ 3 files changed, 63 insertions(+) create mode 100755 release.sh diff --git a/docs/releasing.md b/docs/releasing.md index bc24b58..66e21f0 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -39,3 +39,20 @@ which must be recorded or controlled by the release environment. The packaging smoke test produced byte-identical archives in two consecutive runs on the Milestone 7 development host and validated both archive and internal checksums. + +## Publish with rust_realease + +Install [`rust_realease`](https://proxy.dandaedre.com/gitea/idle-org/rust_realease), +then pass the path of a readable Gitea token file to the repository wrapper: + +```sh +./release.sh /path/to/token.txt --dry-run +./release.sh /path/to/token.txt +``` + +The wrapper keeps the token out of command-line arguments, exports it as +`GITEA_TOKEN` only to `rust_realease`, selects the `john_slop` workspace package, +and publishes raw binary artifacts. Additional arguments are forwarded, so use +`--dry-run` before publication and `--replace-assets` only after reviewing an +existing release collision. The checkout must be clean and its local and remote +`vX.Y.Z` tags must match the package version as required by `rust_realease`. diff --git a/release.sh b/release.sh new file mode 100755 index 0000000..8052796 --- /dev/null +++ b/release.sh @@ -0,0 +1,36 @@ +#!/bin/sh +set -eu + +usage() { + echo "usage: $0 [rust_realease options...]" >&2 + exit 2 +} + +[ "$#" -ge 1 ] || usage +token_file=$1 +shift + +if [ ! -f "$token_file" ] || [ ! -r "$token_file" ]; then + echo "token file is not a readable regular file: $token_file" >&2 + exit 2 +fi + +if ! command -v rust_realease >/dev/null 2>&1; then + echo "rust_realease is not installed or not available in PATH" >&2 + exit 2 +fi + +GITEA_TOKEN= +IFS= read -r GITEA_TOKEN <"$token_file" || : +if [ -z "$GITEA_TOKEN" ]; then + echo "token file is empty: $token_file" >&2 + exit 2 +fi +export GITEA_TOKEN + +repository_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) +exec rust_realease \ + "$repository_dir" \ + --package john_slop \ + --artifact-format binary \ + "$@" diff --git a/tasks.md b/tasks.md index c5909f9..83916e1 100644 --- a/tasks.md +++ b/tasks.md @@ -719,6 +719,16 @@ can rebuild the same release commit with an earlier `dist/` bundle or legacy SBOM intermediates still present; the locked dependency graph passes the configured audit and deny policies. +## Post-milestone release publishing + +- [x] Add a small `release.sh` wrapper that reads a Gitea token from a supplied + file, keeps it out of process arguments, and delegates the tagged `john_slop` + release to `rust_realease` with optional arguments such as `--dry-run`. + +Acceptance: missing, unreadable, and empty token files fail before publication; +the token reaches `rust_realease` through `GITEA_TOKEN`, never an argument; and +the wrapper selects the root workspace package and binary artifact mode. + ## Deferred by design - Statistical or model-based authorship classification.