fix: manual release runs should version pending changesets and always re-deploy - #1394
Conversation
|
… new A release run (manual workflow_dispatch or a real push) can legitimately land on a commit with no new tags to process - e.g. dispatching manually against a commit that isn't a version bump, or re-running after everything's already published. `changeset publish` correctly creates no new tags in that case; create-release-from-tags shouldn't treat "nothing new" as a hard failure.
c2478fc to
a2f5442
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit 33111f9 to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## master #1394 +/- ##
=======================================
Coverage 91.59% 91.59%
=======================================
Files 127 127
Lines 4142 4142
Branches 1033 1033
=======================================
Hits 3794 3794
Misses 348 348
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
publish and deploy-cdn each ran their own full build independently (yarn build --force inside yarn release, and yarn . build inside release:cdn) - double the build time, and no guarantee the two destinations ever got the exact same bits, since each build was a separate yarn install + compile on a separate runner. Adds a build job that runs once (after test passes), uploads packages/*/dist and packages/consent/*/dist as a single GitHub Actions artifact. publish and deploy-cdn now both depend only on build (not on each other, so they run in parallel) and download that same artifact instead of rebuilding: - release:publish-only (new script) is `release` minus the clean+build - just changeset publish, tag push, and CDN cache purge. - release:cdn:no-build (new script, packages/browser) is release:cdn minus the `yarn . build` prefix. Both now publish/deploy the identical, single build produced by the build job.
…hs (#1395) ## Summary The first real `workflow_dispatch` test of the shared-build-artifact setup (#1394) failed: `deploy-cdn` and `purge-cdn-cache:consent` both errored on a missing `.../dist/umd` directory, even though the `build` job's own build step produced it correctly - confirmed locally, a clean `yarn build --force` does produce `packages/browser/dist/umd` and `packages/consent/*/dist/umd`. ## Root cause `upload-artifact` was given two separate glob patterns: ```yaml path: | packages/*/dist packages/consent/*/dist ``` With more than one path pattern, it computes a shared least-common-ancestor root across all matched files and strips it from the archived paths. Since `packages/consent/*/dist` sits one directory level deeper than `packages/*/dist`, the LCA came out as `packages/` and got stripped inconsistently - on `download-artifact`'s side, the restored files landed one level too shallow (e.g. `./browser/dist/umd` instead of `./packages/browser/dist/umd`). ## Fix Tar the exact same paths into a single file in the `build` job (`tar` preserves relative paths exactly - no LCA-guessing involved), upload/download that one file instead of raw directory globs, then extract it after download in `publish` and `deploy-cdn`. ## Verification Reproduced and confirmed the fix locally: ``` tar -czf release-dist.tar.gz packages/*/dist packages/consent/*/dist tar -xzf release-dist.tar.gz -C /tmp/extract-test ls /tmp/extract-test/packages/browser/dist/umd/index.js # exists ls /tmp/extract-test/packages/consent/consent-wrapper-onetrust/dist/umd/ # populated ``` Both land at the exact expected paths. ## Test plan - [ ] Manual `workflow_dispatch` run: `build` uploads the tarball, `publish` and `deploy-cdn` both extract it and find `dist/umd` present at the expected path this time 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Manually
workflow_dispatch-ing this workflow to testdeploy-cdn(against a non-release commit - no pending changeset, no version bump) surfacedcreate-release-from-tagsthrowingNo git tags found, sincechangeset publishcorrectly produced zero new tags (nothing new to publish). That's an expected outcome for a no-op release run, not a failure - it now logs and returns instead of throwing.Deploy to CDNnever got a chance to run in that failed run, since it depends onpublishsucceeding - this fix is what actually letsdeploy-cdnrun on a manual dispatch that isn't a real version bump, so the current build gets re-uploaded to the CDN.What this PR does NOT do (reverted from an earlier version)
An earlier version of this PR also had a manual
workflow_dispatchrun version pending changesets directly and push a "Version Packages" commit straight tomaster, bypassing PR review. That was wrong: a release should be a read-only operation against a commit already onmaster- tag it, publish it to npm, cut a GitHub release, deploy it to the CDN - never a vehicle for landing new code (a version bump is a code change and belongs in a reviewed PR like every other change). That step has been removed.The correct fix for "how does a new version actually get released" is making the normal, reviewed path work again:
release-creator.ymlopens a "Version Packages" PR for pending changesets, someone reviews and merges it, and that merge is the commit a release tags and publishes.Also: build once, share the artifact between npm publish and CDN deploy
publishanddeploy-cdneach ran their own full build independently (yarn build --forceinsideyarn release, andyarn . buildinsiderelease:cdn) - double the build time, and no guarantee the two destinations ever got the exact same bits, since each build was a separateyarn install+ compile on a separate runner.Added a
buildjob that runs once (aftertestpasses), uploadspackages/*/distandpackages/consent/*/distas a single GitHub Actions artifact (actions/upload-artifact/download-artifact- both GitHub-owned, no allowed-actions issue).publishanddeploy-cdnnow both depend only onbuild(not on each other, so they run in parallel) and download that same artifact instead of rebuilding:release:publish-only(new script) isreleaseminus the clean+build - justchangeset publish, tag push, and CDN cache purge.release:cdn:no-build(new script,packages/browser) isrelease:cdnminus theyarn . buildprefix.Both now publish/deploy the exact same, single build the
buildjob produced.Separately found, not fixed here
release-creator.yml(opens the "Version Packages" PR) has failed withstartup_failureon every run since at least 2026-07-16 - 0 jobs run, consistent with a workflow-level rejection rather than a step failure. Strong suspicion:changesets/action@a45c4d594is a third-party action, likely hitting the same allowed-actions restriction fixed foraws-actions/configure-aws-credentialsin #1393. Fixing that is the actual path to cutting new releases again - not addressed in this PR.Test plan
scripts/create-release-from-tags/__tests__/index.test.tsstill passestscclean repo-wide (pre-push hook, 14/14 packages)workflow_dispatchrun against currentmaster(no pending version bump) completesbuild,publish, anddeploy-cdnwithout error, withpublish/deploy-cdnrunning in parallel and neither rebuilding🤖 Generated with Claude Code