From 4f168ec48f50d89f64b89e8554603ef1b30cd914 Mon Sep 17 00:00:00 2001 From: John Mitsch Date: Wed, 10 Jun 2026 21:13:16 -0400 Subject: [PATCH] Add release-update-scoop-bucket Justfile recipe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors release-update-homebrew-tap: a maintainer-run command that syncs a Scoop manifest to a local clone of quicknode/scoop-bucket. Until we have a SCOOP_BUCKET_TOKEN PAT to automate the push, this is the manual path. The generated bucket/qn.json includes `checkver = "github"` and an `autoupdate` block, so once a user has tapped the bucket, `scoop update` finds new versions on its own — no recurring manual push needed for every release. We still run the recipe to bump the canonical `version` field (so `scoop search qn` is honest about what's current) and to surface the hash for offline verification. Usage: just release-update-scoop-bucket 0.1.4 ~/qn/scoop-bucket The recipe downloads the Windows zip's sha256 sidecar from the GitHub release, renders the manifest with the version and hash substituted, commits with a clean message, and prints the git push command (it does not push automatically — the maintainer reviews and pushes themselves). When SCOOP_BUCKET_TOKEN exists we'll add a CI publish-scoop workflow modeled on publish-deb, and this recipe becomes a manual-recovery fallback. --- Justfile | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/Justfile b/Justfile index 76a13c8..69ad3f0 100644 --- a/Justfile +++ b/Justfile @@ -84,6 +84,79 @@ release-update-homebrew-tap version tap_path: echo "Committed qn {{version}} to {{tap_path}}. To publish:" echo " git -C {{tap_path}} push" +# Manually update the Scoop bucket with a manifest for a given release. +# Use this until we have a SCOOP_BUCKET_TOKEN secret and can automate the +# push — at which point a CI job takes over and this recipe becomes a +# manual-recovery fallback. +# +# The generated manifest includes `checkver` + `autoupdate` so Scoop +# users get new versions on `scoop update` even without us pushing a +# new manifest for every release. We still push to bump the canonical +# `version` field so `scoop search` is honest about what's current. +# +# Usage: just release-update-scoop-bucket 0.1.4 ~/qn/scoop-bucket +# +# Precondition: bucket_path is a clean local clone of quicknode/scoop-bucket. +release-update-scoop-bucket version bucket_path: + #!/usr/bin/env bash + set -euo pipefail + if [[ ! -d "{{bucket_path}}/.git" ]]; then + echo "Error: {{bucket_path}} is not a git checkout. Clone quicknode/scoop-bucket there first." >&2 + exit 1 + fi + if ! git -C "{{bucket_path}}" diff --quiet || ! git -C "{{bucket_path}}" diff --cached --quiet; then + echo "Error: {{bucket_path}} has uncommitted changes. Commit or stash them first." >&2 + exit 1 + fi + sha_url="https://github.com/quicknode/cli/releases/download/v{{version}}/quicknode-cli-x86_64-pc-windows-msvc.zip.sha256" + if ! sha_line=$(curl -sfL "$sha_url"); then + echo "Error: could not download $sha_url (does the release exist?)" >&2 + exit 1 + fi + # The .sha256 sidecar is ` *`; take just the hex. + hash=$(echo "$sha_line" | awk '{print $1}') + if [[ ! "$hash" =~ ^[0-9a-f]{64}$ ]]; then + echo "Error: parsed hash '$hash' is not a 64-char hex string." >&2 + exit 1 + fi + mkdir -p "{{bucket_path}}/bucket" + cat > "{{bucket_path}}/bucket/qn.json" </dev/null 2>&1; then + git add bucket/qn.json + elif git diff --quiet bucket/qn.json; then + echo "bucket/qn.json is already at v{{version}}. Nothing to commit." + exit 0 + else + git add bucket/qn.json + fi + git commit -m "qn {{version}}" + echo + echo "Committed qn {{version}} to {{bucket_path}}. To publish:" + echo " git -C {{bucket_path}} push" + # Release Phase 1: bump → branch → PR → merge → tag → GH release → wait for CI. # Each recipe is callable on its own; release-prepare orchestrates them with prompts.