ci(publish): wire Scoop bucket + Homebrew tap jobs (D3 §3b/§3c)
ci / gate (push) Successful in 1m59s
ci / manifests (push) Successful in 4s

Add sibling publish.yaml jobs (scoop-bucket, homebrew-tap) that render a
manifest from the release .sha256 sidecars and idempotently push it to the
org-level lazyeval/scoop-bucket and lazyeval/homebrew-tap repos, using the
scoped lazyeval-ci bot token (LAZYEVAL_PKG_TOKEN).

Render logic lives in dependency-free bash (the CI image has no jq/ruby):
scripts/render-scoop-manifest.sh and scripts/render-homebrew-formula.sh.
scripts/test-package-renders.sh exercises both: it validates the Scoop JSON
with node and asserts fields on both manifests, and additionally runs
`ruby -c` on the formula where ruby is present (dev box), skipping it
gracefully otherwise.

A new ci.yaml `manifests` job runs that test on every push so a render
regression surfaces immediately, not at the next manual publish dispatch.
The CI image has no ruby, so in CI the gate covers the Scoop JSON (node) and
field assertions for both manifests; the formula's Ruby syntax is checked
dev-side only (the static heredoc's variable parts cannot introduce syntax
errors).

- Scoop: x64 (gnu) + arm64 (gnullvm); #/-rename fragment so the bin shim is
  version-stable; checkver, no autoupdate (the pipeline is the updater).
- Homebrew: on_macos/on_linux x arch bare-binary formula; no Windows.

Docs: ADR-0056 Amendment 2 (+ README index, requirements D3).

Unverified pending real use: scoop/brew install, the HEAD:main branch
assumption, macOS Gatekeeper-via-brew on the ad-hoc-signed binary.
This commit is contained in:
claude@clouddev1
2026-06-19 21:30:18 +00:00
parent c0531aa048
commit 6d54c1e96c
8 changed files with 474 additions and 12 deletions
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
#
# Render the Scoop manifest for rdbms-playground to stdout.
#
# Pure function of its inputs — NO network, NO jq/ruby — so it runs unchanged in
# the CI job container (node:22-bookworm-slim: bash + coreutils only). Given a
# version and the two Windows asset SHA-256 hashes it prints a complete,
# schema-valid Scoop manifest. The publish.yaml `scoop-bucket` job fetches the
# hashes from the release's .sha256 sidecars and commits the result into the
# lazyeval/scoop-bucket repository as rdbms-playground.json.
#
# Manifest updates are CI-driven (this script, per release), so the manifest
# carries `checkver` (so `scoop status` / the community excavator can see when
# the bucket lags upstream) but deliberately NO `autoupdate` — our pipeline is
# the updater, not Scoop's maintainer tooling.
#
# Usage: render-scoop-manifest.sh <version> <hash-x64> <hash-arm64>
# <version> version, with or without a leading 'v' (e.g. 0.2.0 or v0.2.0)
# <hash-x64> sha256 of the x86_64-pc-windows-gnu.exe asset
# <hash-arm64> sha256 of the aarch64-pc-windows-gnullvm.exe asset
set -euo pipefail
if [ "$#" -ne 3 ]; then
echo "usage: $0 <version> <hash-x64> <hash-arm64>" >&2
exit 2
fi
# Accept either 0.2.0 or v0.2.0; the manifest 'version' field is bare.
version=${1#v}
hash_x64=$2
hash_arm64=$3
repo="https://git.lazyeval.net/oli/rdbms-playground"
base="$repo/releases/download/v$version"
# The `#/rdbms-playground.exe` fragment tells Scoop to save the versioned asset
# under a stable filename, so the `bin` shim resolves regardless of version.
url_x64="$base/rdbms-playground-v$version-x86_64-pc-windows-gnu.exe#/rdbms-playground.exe"
url_arm64="$base/rdbms-playground-v$version-aarch64-pc-windows-gnullvm.exe#/rdbms-playground.exe"
# Note: \$.tag_name emits a literal $ (Scoop's JSONPath); the regex uses [0-9.]
# rather than \d so the manifest contains no backslashes to escape.
cat <<EOF
{
"version": "$version",
"description": "A cross-platform TUI playground for learning relational databases.",
"homepage": "https://relplay.org",
"license": "MIT OR Apache-2.0",
"architecture": {
"64bit": {
"url": "$url_x64",
"hash": "$hash_x64"
},
"arm64": {
"url": "$url_arm64",
"hash": "$hash_arm64"
}
},
"bin": "rdbms-playground.exe",
"checkver": {
"url": "https://git.lazyeval.net/api/v1/repos/oli/rdbms-playground/releases/latest",
"jsonpath": "\$.tag_name",
"regex": "v([0-9.]+)"
}
}
EOF