1- name : Scoop manifest bump
1+ name : Packaging manifest bump
22
3- # Keep the in-repo Scoop bucket manifest (bucket/clauster.json) in lockstep with
4- # published releases. The manifest carries Scoop's own `checkver`/`autoupdate`
5- # blocks, but nothing INVOKES them for a self-hosted bucket (the official Scoop
6- # Excavator only services the ScoopInstaller org). Without this, `scoop install
7- # clauster` keeps serving whatever version the committed manifest pins, frozen
8- # until someone bumps it by hand.
3+ # Keep the in-repo package-manager manifests — the Scoop bucket (bucket/clauster.json),
4+ # the Homebrew formula (Formula/clauster.rb), and the Nix flake (flake.nix) — in
5+ # lockstep with published releases. Scoop's manifest carries `checkver`/`autoupdate`,
6+ # but nothing INVOKES them for a self-hosted bucket (the official Scoop Excavator only
7+ # services the ScoopInstaller org); Homebrew/Nix have no auto-update at all. Without
8+ # this, `scoop install` / `brew install` / `nix run` keep serving whatever version the
9+ # committed manifests pin, frozen until someone bumps them by hand.
910#
10- # So on every published release we regenerate the manifest's version/url/hash from
11- # the release's authoritative SHA256SUMS and open a PR. We DON'T push to main: main
12- # is branch-protected, and the bump is reviewable like any other change. release-
13- # please is deliberately NOT the mechanism — it runs at PR-prep time, before the
14- # binaries (and therefore the hash ) exist.
11+ # So on every published release we regenerate each manifest's version/url/hash from the
12+ # release's authoritative SHA256SUMS (via scripts/bump_packaging.py) and open a PR. We
13+ # DON'T push to main: main is branch-protected, and the bump is reviewable like any
14+ # other change. release- please is deliberately NOT the mechanism — it runs at PR-prep
15+ # time, before the binaries (and therefore the hashes ) exist.
1516#
16- # Trust root: the SHA256SUMS asset, fetched over GitHub TLS from our own just-
17- # published release — the same trust model the install.sh/install.ps1 one-liners
18- # use. (Optional future hardening: `cosign verify-blob` against the shipped
19- # SHA256SUMS.sigstore.json before trusting it.)
17+ # A manifest not yet on main is skipped (the helper no-ops on absent files), so this can
18+ # merge ahead of the Homebrew/Nix packaging and light them up once they land.
19+ #
20+ # Trust root: the SHA256SUMS asset, fetched over GitHub TLS from our own just-published
21+ # release — the same trust model the install.sh/install.ps1 one-liners use. (Optional
22+ # future hardening: `cosign verify-blob` against the shipped SHA256SUMS.sigstore.json
23+ # before trusting it.)
2024on :
2125 release :
2226 types : [published]
2529 workflow_dispatch :
2630 inputs :
2731 tag :
28- description : " Release tag to sync the Scoop manifest to (e.g. v0.11.0). Empty = latest published ."
32+ description : " Release tag to sync the packaging manifests to (e.g. v0.11.0). Empty = latest."
2933 required : false
3034 default : " "
3135
@@ -34,12 +38,12 @@ permissions:
3438 contents : read
3539
3640concurrency :
37- group : scoop -bump-${{ github.workflow }}
41+ group : packaging -bump-${{ github.workflow }}
3842 cancel-in-progress : false
3943
4044jobs :
4145 bump :
42- name : Sync bucket/clauster.json to the release
46+ name : Sync packaging manifests to the release
4347 # workflow_dispatch is restricted to the default branch so a dispatch from an
4448 # arbitrary ref can't run this write-capable job. (release events already use
4549 # the default branch's workflow file.)
@@ -96,85 +100,66 @@ jobs:
96100 echo "version=${tag#v}" >> "$GITHUB_OUTPUT"
97101 echo "Target tag: $tag"
98102
99- # Regenerate version/url/hash from the release's SHA256SUMS. Fails closed if
100- # the Windows asset (or its checksum) is missing — we never push a half-baked
101- # manifest. jq --indent 4 preserves the file's existing formatting.
102- - name : Regenerate Scoop manifest
103+ # Regenerate version/url/hash for every present manifest from the release's
104+ # SHA256SUMS. The helper fails closed (non-zero exit) if a present manifest's
105+ # asset is missing or a stale version would survive — we never push a
106+ # half-baked manifest. Absent manifests are skipped.
107+ - name : Regenerate packaging manifests
103108 id : regen
104109 env :
105110 GH_TOKEN : ${{ github.token }}
106111 TAG : ${{ steps.tag.outputs.tag }}
107112 VERSION : ${{ steps.tag.outputs.version }}
108113 run : |
109114 set -euo pipefail
110- manifest="bucket/clauster.json"
111- if [ ! -f "$manifest" ]; then
112- echo "::error::$manifest not found on the default branch"
113- exit 1
114- fi
115-
116115 tmp="$(mktemp -d)"
117116 gh release download "$TAG" --repo "$GITHUB_REPOSITORY" --pattern SHA256SUMS --dir "$tmp"
117+ python3 scripts/bump_packaging.py "$VERSION" "$GITHUB_REPOSITORY" "$tmp/SHA256SUMS"
118118
119- asset="clauster-${VERSION}-windows-x86_64.exe"
120- hash="$(awk -v f="$asset" '$2 == f { print $1 }' "$tmp/SHA256SUMS")"
121- if ! printf '%s' "$hash" | grep -Eq '^[0-9a-f]{64}$'; then
122- echo "::error::no valid sha256 for $asset in the $TAG SHA256SUMS (got '${hash:-<empty>}')"
123- exit 1
124- fi
125-
126- url="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG}/${asset}#/clauster.exe"
127- jq --indent 4 \
128- --arg v "$VERSION" --arg u "$url" --arg h "$hash" \
129- '.version = $v
130- | .architecture."64bit".url = $u
131- | .architecture."64bit".hash = $h' \
132- "$manifest" > "$manifest.new"
133- mv "$manifest.new" "$manifest"
134-
135- if git diff --quiet -- "$manifest"; then
136- echo "Manifest already at $VERSION — nothing to do."
119+ if git diff --quiet; then
120+ echo "Manifests already at $VERSION — nothing to do."
137121 echo "changed=false" >> "$GITHUB_OUTPUT"
138122 else
139123 echo "changed=true" >> "$GITHUB_OUTPUT"
140- git --no-pager diff -- "$manifest"
124+ git --no-pager diff --stat
141125 fi
142126
143127 # Push to a per-version branch and open (or update) a PR. Never main.
144- - name : Open Scoop bump PR
128+ - name : Open packaging bump PR
145129 if : ${{ steps.regen.outputs.changed == 'true' }}
146130 env :
147131 GH_TOKEN : ${{ steps.app-token.outputs.token }}
148132 TAG : ${{ steps.tag.outputs.tag }}
149133 VERSION : ${{ steps.tag.outputs.version }}
150134 run : |
151135 set -euo pipefail
152- branch="scoop -bump/${TAG}"
136+ branch="packaging -bump/${TAG}"
153137 case "$branch" in
154- scoop -bump/v[0-9]*) ;;
138+ packaging -bump/v[0-9]*) ;;
155139 *) echo "::error::refusing to push to unexpected branch '$branch'"; exit 1 ;;
156140 esac
157141
158142 git config user.name "clauster-ci[bot]"
159143 git config user.email "clauster-ci[bot]@users.noreply.github.com"
160144 git checkout -B "$branch"
161- git add bucket/clauster.json
162- git commit -m "chore(scoop ): bump bucket manifest to ${VERSION}"
145+ git add bucket/clauster.json Formula/clauster.rb flake.nix
146+ git commit -m "chore(packaging ): bump manifests to ${VERSION}"
163147 git push --force-with-lease \
164148 "https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" "HEAD:${branch}"
165149
166150 # Open the PR only if one isn't already open for this branch (re-run safe).
167151 existing="$(gh pr list --repo "$GITHUB_REPOSITORY" --state open --head "$branch" --json number --jq 'length')"
168152 if [ "$existing" = "0" ]; then
169153 body="$(printf '%s\n' \
170- "Auto-generated by \`scoop -bump.yml\` on release **${TAG}**." \
154+ "Auto-generated by \`packaging -bump.yml\` on release **${TAG}**." \
171155 "" \
172- "Updates \`bucket/clauster.json\` version/url/hash from the release's" \
173- "signed \`SHA256SUMS\` (Windows x86_64). Review + merge to publish the" \
174- "new version to Scoop users.")"
156+ "Regenerates the Scoop / Homebrew / Nix manifests' version, URLs, and" \
157+ "checksums from the release's signed \`SHA256SUMS\` (only manifests present" \
158+ "on main are touched). Review + merge to publish the new version to those" \
159+ "package managers.")"
175160 gh pr create --repo "$GITHUB_REPOSITORY" --base main --head "$branch" \
176- --title "chore(scoop ): bump bucket manifest to ${VERSION}" \
161+ --title "chore(packaging ): bump manifests to ${VERSION}" \
177162 --body "$body"
178163 else
179- echo "PR already open for $branch — pushed the updated manifest to it."
164+ echo "PR already open for $branch — pushed the updated manifests to it."
180165 fi
0 commit comments