feat: distribute the CLI via Scoop - #691
Conversation
Serves Scoop from a bucket repo we own, OctopusDeploy/scoop-octopus, as the official ScoopInstaller/Main bucket only accepts widely-adopted tools. As with the homebrew tap, goreleaser writes the manifest and the Octopus deployment process commits it into the bucket. The manifest covers 64bit and arm64, making Scoop the only Windows package manager through which we ship a native ARM build. Closes the last unticked box on #37. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| New-Item -ItemType Directory -Path "bucket" -Force | Out-Null | ||
| Copy-Item -Path "$extractedPath/scoop/*" -Filter "*.json" -Destination "bucket" -Force | ||
|
|
||
| git diff-index --quiet HEAD || (git commit -a -m "Update for release $packageVersion" ` |
There was a problem hiding this comment.
The first release through this step can never publish the manifest: in a fresh clone the copied bucket/octopus-cli.json is a new untracked file, and git diff-index HEAD only compares tracked files — it exits 0 and the || branch is skipped, so nothing is committed or pushed and the step still goes green. Because every deploy starts from a fresh --depth 1 clone, this repeats on every release until someone commits the manifest to the bucket repo by hand. Even when the guard does fire, git commit -a also only stages tracked-file changes, so it would fail on an untracked manifest anyway ("nothing added to commit but untracked files present").
Suggested fix — stage first, then guard on the index:
git add bucket
git diff-index --quiet --cached HEAD || (git commit -m "Update for release $packageVersion" `
&& git push --repo $origin `
)| write-host "Using: packageVersion $packageVersion from $extractedPath" | ||
| } | ||
|
|
||
| git clone --depth 1 $origin octopus-scoop-bucket |
There was a problem hiding this comment.
Unlike the sibling homebrew step, this script sets no $ErrorActionPreference = "Stop" and never checks $LASTEXITCODE, so failures degrade into a silent green step instead of a clean error. Concretely: if Copy-Item fails (bad path, package layout change), the error is non-terminating, git diff-index then sees a clean tree and exits 0, and the deployment reports success having pushed nothing. A failed git clone cascades similarly — Set-Location fails non-terminating and the rest of the script runs in the wrong directory.
Suggest mirroring the homebrew step: $ErrorActionPreference = "Stop" at the top, plus if ($LASTEXITCODE -ne 0) { throw "..." } after the clone and push.
…green The scoop step set no $ErrorActionPreference and never checked $LASTEXITCODE, so a failed Copy-Item or git clone was non-terminating: the tree then looked clean, git diff-index exited 0 and the deployment reported success having published nothing. Mirror the homebrew step - stop on errors, throw on a failed clone, commit or push, and report the no-op case explicitly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
In a fresh --depth 1 clone of an empty bucket repo the copied bucket/octopus-cli.json is untracked, and `git diff-index HEAD` only compares tracked files - it exits 0, the publish is skipped and the step still goes green, on every release until someone commits the manifest by hand. `git commit -a` would not have staged it either. Stage bucket/ first and guard on the index. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Part of #37 — Scoop was the last unticked box on the package manager list.
Change
Adds a
scoopsblock to.goreleaser.yamland a deployment process step that pushes the generated manifest.Scoop is served from a bucket repository we own, OctopusDeploy/scoop-octopus, rather than the official
ScoopInstaller/Mainbucket, which only accepts widely-adopted tools (500+ stars, 150+ forks). This mirrors the homebrew tap: goreleaser generates the manifest butskip_uploadstops it publishing, and the Octopus deployment process commits it intobucket/.Unlike the homebrew step, the scoop step commits straight to the default branch instead of raising a PR — a bucket is machine-maintained, there is nothing for a human to review.
The manifest covers both
64bitandarm64, so Scoop becomes the only Windows package manager through which we ship a native ARM build (winget and chocolatey are x64 only).Why draft
The bucket repository has to exist, and
Publish:Scoop:Username,Publish:Scoop:UserEmailandPublish:Scoop:ApiKeyhave to be set on the Octopus project, before this can be merged. Nothing here is verifiable end to end until a release runs.🤖 Generated with Claude Code