fix: build browser-lib bundle after version bump in release job - #1002
Merged
naveenkumar-sunkaraSFDC merged 2 commits intoSep 16, 2026
Conversation
The release job ran `yarn build` before semantic-release bumped the package versions. Because @sa11y/browser-lib stamps `sa11y.version` into the minified bundle from package.json at rollup time, the published sa11y.min.js self-reported the previous version instead of the version just released. Move the build to run after semantic-release (gated on .release-created, same as npm publish) so the published bundle reports the correct version. This keeps sa11y.version in the bundle in sync with the npm package version that downstream consumers pin against. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1002 +/- ##
==========================================
- Coverage 94.88% 94.72% -0.17%
==========================================
Files 27 35 +8
Lines 626 815 +189
Branches 137 178 +41
==========================================
+ Hits 594 772 +178
- Misses 32 43 +11 🚀 New features to boost your workflow:
|
vanshika-sharmaSFDC
approved these changes
Sep 16, 2026
vanshika-sharmaSFDC
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks for the change.
|
🎉 This PR is included in version 8.1.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
Problem
The published
@sa11y/browser-libbundle self-reports the wrong version. Theminified bundle stamps
sa11y.versioninto its footer, but the value lags theactual npm package version by one release.
Root cause is step ordering in the
releasejob of.github/workflows/nodejs.yml:yarn buildruns first and stamps the bundle from the current on-diskpackage.jsonversion.semantic-releasethen runslerna version <next>, which rewritespackage.jsonto the released version.npm publishuploads the bundle that was built in step 1 — stamped with thepre-bump version.
Because
rollup.config.mjsreads the version frompackage.jsonat build time(
getPackageVersion()→ footersa11y.version = '<pkgVersion>'), the bundlemust be built after the version bump to stamp the correct value.
Fix
Move the single
yarn buildto run aftersemantic-releasehas bumped theversions, gated on
.release-created(the same condition already used by thepublish step). The pre-bump build is removed — it was redundant with the
lint-build-testjob that gates this one.After this change:
semantic-releasebumps the on-diskpackage.jsonto the released version.yarn buildstamps the bundle with that value.npm publishuploads the correctly-stamped bundle.No new inputs are introduced and the release remains gated on
.release-created,so behavior on non-release pushes is unchanged.
🤖 Generated with Claude Code