ci: build the Action bundle into the release PR (fix broken v0.2.1)#20
Merged
Conversation
main is protected (changes must go through a pull request), so the bot cannot push dist to main at release time — the previous release-time push was rejected (GH013) and left v0.2.1 tagged without a bundle. Instead, build the bundle into the open release PR during the same release.yml run that release-please updates it (pushing to the release PR's own branch, which protection does not cover). The release commit then already carries an up-to-date dist/ when merged, so the release tag is immediately runnable via uses:@vx, while feature PRs stay free of dist/ churn. The major tag is moved to the release commit on release. Track the bundle again (dist/index.js and runtime companions); the release workflow keeps it fresh.
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.
Background
mainis protected by a ruleset: changes must be made through a pull request (and no force-push). The previous release workflow tried to builddist/and push it directly tomainat release time — GitHub rejected it (GH013), so the v0.2.1 release tag has no bundle anduses: 7nohe/[email protected]is currently broken (npm0.2.1published fine).Approach
Build the Action bundle into the open release PR, not onto
maindirectly:release.yml'srelease-pleasejob exposes itsproutput. A newbuild-release-pr-distjob runs in the same workflow run (triggered by the human merge that updatesmain), checks out the release PR branch, rebuildsdist/, and commits it back to that branch. Pushing to the release PR's own branch is allowed because protection only coversmain. No PAT or ruleset change needed.dist/, so the release tag (which stays onmain) is immediately runnable viauses:@vX.tag-major-versionmoves the floatingv0tag to the release commit.dist/— only the release PR does.The bundle is tracked again (
dist/index.js+ map/sourcemap-register/licenses);dist/cli/and type declarations stay ignored.Why not the alternatives
disttomainat release → blocked by the PR-only rule (this is the bug being fixed).diston every feature PR → works, but adds a botdistcommit to each PR; this keeps feature PRs clean instead.After merge (manual, one-time)
v0.2.1is already tagged without a bundle. Once this merges, thev0.2.1andv0tags will be re-pointed to the merge commit (which carries the bundle built from the unchanged0.2.1source) so the Action works atv0.2.1. From the next release onward this is automatic.