Skip to content

fix: manual release runs should version pending changesets and always re-deploy - #1394

Merged
abueide merged 2 commits into
masterfrom
fix-manual-release-versioning
Aug 12, 2026
Merged

fix: manual release runs should version pending changesets and always re-deploy#1394
abueide merged 2 commits into
masterfrom
fix-manual-release-versioning

Conversation

@abueide

@abueide abueide commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Manually workflow_dispatch-ing this workflow to test deploy-cdn (against a non-release commit - no pending changeset, no version bump) surfaced create-release-from-tags throwing No git tags found, since changeset publish correctly 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 CDN never got a chance to run in that failed run, since it depends on publish succeeding - this fix is what actually lets deploy-cdn run 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_dispatch run version pending changesets directly and push a "Version Packages" commit straight to master, bypassing PR review. That was wrong: a release should be a read-only operation against a commit already on master - 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.yml opens 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

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.

Added a build job that runs once (after test passes), uploads packages/*/dist and packages/consent/*/dist as a single GitHub Actions artifact (actions/upload-artifact/download-artifact - both GitHub-owned, no allowed-actions issue). 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 exact same, single build the build job produced.

Separately found, not fixed here

release-creator.yml (opens the "Version Packages" PR) has failed with startup_failure on 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@a45c4d594 is a third-party action, likely hitting the same allowed-actions restriction fixed for aws-actions/configure-aws-credentials in #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.ts still passes
  • tsc clean repo-wide (pre-push hook, 14/14 packages)
  • Manual workflow_dispatch run against current master (no pending version bump) completes build, publish, and deploy-cdn without error, with publish/deploy-cdn running in parallel and neither rebuilding

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Aug 12, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 33111f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

… 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.
@abueide
abueide force-pushed the fix-manual-release-versioning branch from c2478fc to a2f5442 Compare August 12, 2026 16:49
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.59%. Comparing base (1e9ac21) to head (a0db5be).
⚠️ Report is 1 commits behind head on master.

⚠️ Current head a0db5be differs from pull request most recent head 33111f9

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           
Flag Coverage Δ
browser 92.51% <ø> (ø)
core 90.07% <ø> (ø)
node 89.43% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@abueide
abueide enabled auto-merge (squash) August 12, 2026 17:18
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.
@abueide
abueide merged commit 0d0238f into master Aug 12, 2026
33 of 35 checks passed
@abueide
abueide deleted the fix-manual-release-versioning branch August 12, 2026 17:27
abueide added a commit that referenced this pull request Aug 12, 2026
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants