Most of our JS repos use semantic-release to release to NPM, which handles semantic versioning based on commit types. While the rest of the non-JS repos have also conformed to standard commit types (e.g., feat, fix, etc.), only a small subset of commit types will actually trigger a release to NPM:
Any other commit types (e.g., chore) does not trigger an NPM release with the default semantic-release configuration. This makes sense, though, as not every commit should trigger a release.
That said, it would be helpful for our JS repos to have a way to indicate to engineers who author/review PRs which version, if any, will be released by semantic-release based on the commit type(s) used in the branch. This would give an extra sanity check to ensure merging a PR will have the intended outcome regarding NPM releases.
Some repos have attempted to include a step in their CI workflows to output the results from a dry-run of semantic-release.
- Working example in
frontend-enterprise (source), though this is a monorepo managed by Lerna, which uses semantic-release behind-the-scenes.
- Non-working example in
paragon (source), using vanilla semantic-release. Results in the following error: This run was triggered by a pull request and therefore a new version won't be published.
AC
Most of our JS repos use
semantic-releaseto release to NPM, which handles semantic versioning based on commit types. While the rest of the non-JS repos have also conformed to standard commit types (e.g.,feat,fix, etc.), only a small subset of commit types will actually trigger a release to NPM:fixfeatperfAny other commit types (e.g.,
chore) does not trigger an NPM release with the defaultsemantic-releaseconfiguration. This makes sense, though, as not every commit should trigger a release.That said, it would be helpful for our JS repos to have a way to indicate to engineers who author/review PRs which version, if any, will be released by
semantic-releasebased on the commit type(s) used in the branch. This would give an extra sanity check to ensure merging a PR will have the intended outcome regarding NPM releases.Some repos have attempted to include a step in their CI workflows to output the results from a dry-run of
semantic-release.frontend-enterprise(source), though this is a monorepo managed by Lerna, which usessemantic-releasebehind-the-scenes.paragon(source), using vanillasemantic-release. Results in the following error:This run was triggered by a pull request and therefore a new version won't be published.AC
semantic-releaseto preview what version (if any) would be released after merging a given PR.semantic-release(intentionally not includefrontend-enterprisehere because it uses Lerna and has a working solution already). Sampling of repos:@edx/frontend-build@edx/frontend-platform@edx/paragon@edx/browserslist-config@edx/frontend-component-header@edx/frontend-component-header-edx@edx/frontend-component-footer@edx/frontend-component-footer-edx