ci: attach .tgz to GitHub Release on npm publish#152
Merged
Conversation
When the Changesets 'version packages' PR is merged, release.yml publishes to npm and creates the GitHub Release. This adds a step, gated on the action's published output, that packs @anarchitecture/ghost and uploads the tarball to that same Release so the GitHub Release tarball channel stays in sync with npm without a separate tag push.
2 tasks
nahiyankhan
approved these changes
Jun 16, 2026
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.
What
When the Changesets "version packages" PR (e.g. #148) is merged to
main,release.ymlalready publishes@anarchitecture/ghostto npm and Changesets creates the tagged GitHub Release. This adds a step that attaches the packed.tgzto that same Release, so the GitHub Release tarball distribution channel stays in sync with npm automatically — no separate tag push or manualrelease-tarball.ymlrun.How
id: changesetsto the existing publish step to read its outputs.steps.changesets.outputs.published == 'true'so it only runs on an actual publish (not when the action is just opening/updating the version PR).publishedPackages, reconstructs the taganarchitecture-ghost@<version>(the format Changesets already uses — see the existinganarchitecture-ghost@0.1.0tag), packs the tarball, andgh release upload --clobberattaches it.Why
Today npm publish (
release.yml) and the GitHub Release tarball (release-tarball.yml) are two independent pipelines. The tarball one only fires on a manually pushed tag, so the GitHub Release tarball lags behind npm. Consumers that pin a GitHub Releaseurl+sha256(e.g. Homebrew-style manifests) end up pointing at versions that were never released as tarballs. This couples the two so a single merge keeps them aligned.Notes
release-tarball.ymlis now redundant for the tag-push path; it can be kept as a manualworkflow_dispatchfallback or have itspush: tagstrigger dropped to avoid double-runs. Left as-is for now.