Checksum the published tarball for Homebrew instead of waiting on npm's CDN - #118
Merged
Merged
Conversation
…'s CDN The tap step polled the tarball URL for five minutes right after npm publish and failed on four of the last seven tag pushes, each fixed by a later dispatch. The job now packs once, publishes that file, and pins the formula to its sha256 once its sha512 matches the registry's recorded integrity. A resumed run, which has no local copy, downloads the tarball and checks it against the same integrity. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The publish workflow's "Update Homebrew tap" step failed on four of the last seven tag pushes (v0.5.3, v0.5.6, v0.5.7, v0.5.8). Each time it exhausted its 5-minute poll of the npm tarball URL ("tarball never became reachable in 5 minutes"), and each time a
workflow_dispatchof the same tag a few minutes later succeeded. The step polled the CDN URL immediately afternpm publish, so a release went red by default and needed a manual resume.The step no longer waits on the CDN when it doesn't have to:
npm packonce into$RUNNER_TEMPandnpm publish <that file>, so the job holds the exact bytes npm received. The build has already run, so--ignore-scriptson the pack skips nothing needed (prepublishOnlyis the build,prepareis lefthook).dist.integrityfrom the registry metadata (which appears within seconds of a publish), and if the published file's sha512 matches, pin the formula to its sha256 directly.Worked with: Varun, who asked for the fix after seeing the failure on every sweep.
Not done: nothing else in the workflow changes; npm publish, binaries, signing and the GitHub Release steps are as before.
Type of change
Public API
Unchanged.
Test plan
The new tap-step script ran in a
node:24container against the real v0.5.8 release, in two cases:7e3022522ef639820b2631feb24196fa0ba60011425050906e5bc99ca3c75241, the formula's current value.npm pack --pack-destinationunder npm 11.19.0 prints the tarball filename as its last stdout line, which the publish step relies on. The next tag push is the end-to-end check.Checklist