Scoop bucket setup#
This folder is a reference bundle, rendered here for convenience — it is
not consumed by nur itself. Copy its contents into your
hasansezertasan/scoop-bucket repository to receive automated Scoop manifest
bumps on every release.
How it works#
On each release, this project’s bump-scoop job (in release.yml) sends a
repository_dispatch event of type update-manifest (payload:
{package, version}) to hasansezertasan/scoop-bucket. The listener workflow
in this folder receives that event, validates the payload, runs the bucket’s
manifest updater, and opens a pull request against the bucket — all inside the
bucket repository, using the bucket’s own GITHUB_TOKEN.
One-time bucket setup#
Create the bucket repository. The easiest starting point is
ScoopInstaller/BucketTemplate, which already shipsbin/checkver.ps1andbin/auto-pr.ps1:gh repo create hasansezertasan/scoop-bucket --public \ --template ScoopInstaller/BucketTemplate \ --description "Scoop bucket for hasansezertasan packages"
hasansezertasan/scoop-bucketis a working bucket built on this listener that also provides thescripts/update_manifests.pyupdater the workflow below calls — use it as a concrete reference for that script.Clone the bucket locally and
cdinto it — the manifest edits below operate on files inside this checkout:gh repo clone hasansezertasan/scoop-bucket cd scoop-bucket
Add the initial manifest(s) under
bucket/. Each JSON block below shows only the package-specific fields (checkver/autoupdate/installerplus the identifying fields) — a complete Scoop manifest also needs the standard install fields (top-levelversion,url,hash,bin, etc.). Copy a full example from the reference buckethasansezertasan/scoop-bucket(bucket/nur.json/bucket/nur-pipx.jsonshapes) and adapt it, rather than trying to complete these fragments by hand:A pipx manifest for the PyPI install —
installer.scriptrunspipx install nur==$version, andcheckverpolls PyPI for the latest release:{ "checkver": { "url": "https://pypi.org/pypi/nur/json", "jsonpath": "$.info.version" }, "installer": { "script": "pipx install nur==$version --force" } }
See keycast’s
bucket/keycast-pipx.jsonfor a full manifest to copy and adapt.
Provision the updater script the listener calls,
scripts/update_manifests.py <package>— the listener does not ship this script itself, and without it a dispatched update has nothing to run. Copyscripts/update_manifests.py(and its dependencies) from the reference buckethasansezertasan/scoop-bucketlinked above.Alternatively, base the bucket on
ScoopInstaller/BucketTemplateand adapt itsbin/checkver.ps1/bin/auto-pr.ps1updater flow instead — but if you do, the listener workflow (step 5 below) must be edited to invoke thatcheckver.ps1/auto-pr.ps1flow rather thanscripts/update_manifests.py, since the two updater flows are not interchangeable.Commit the listener workflow from this folder,
update-manifest-dispatch.yml, to the bucket’s.github/workflows/directory. It expects the bucket to provide thescripts/update_manifests.py <package>updater from the previous step.Push everything so the bucket repository actually contains the listener and the initial manifest(s) before any release fires a dispatch:
git add -A git commit -m "Add nur + release listener" git push
Token setup (in this project’s repo)#
In this project’s repository — hasansezertasan/nur — add
a fine-grained personal access token as the SCOOP_BUCKET_TOKEN secret, scoped
to hasansezertasan/scoop-bucket with Contents: write permission only.
That is all the POST /dispatches API requires; the bucket opens its own pull
request with its own GITHUB_TOKEN, so Pull requests: write is not needed
on the PAT.
gh secret set SCOOP_BUCKET_TOKEN --repo hasansezertasan/nur
When SCOOP_BUCKET_TOKEN is unset, the bump-scoop job skips with a notice —
it never fails the release.
Reference implementation#
hasansezertasan/scoop-bucket
is a working bucket built with this same listener, kept as a live reference.