-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore(release): stop overwriting npm latest
dist-tag
#1977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes the npm release process by ensuring the v4 branch is assigned its own dist-tag and its releases are restricted to the 4.x version range, preventing them from overwriting the npm latest tag.
- Removed the explicit branch filter from the semantic-release command
- Updates the release workflow to potentially rely on a separate branch configuration for v4
Files not reviewed (1)
- .releaserc.json: Language not supported
Comments suppressed due to low confidence (1)
.github/workflows/release.yml:31
- The removal of the '--branches v4' flag may cause v4 maintenance releases to be merged with the default release channel. Consider verifying that the semantic-release configuration properly restricts the v4 branch to the 4.x version range, for instance via a configuration file.
run: npx semantic-release
Assigns the v4 branch its own dist-tag (`v4`) and restricts it to the 4.x version range. This prevents v4 maintenance releases from overwriting the latest major version in the default npm channel.
latest
dist-taglatest
dist-tag
"@semantic-release/npm", | ||
"@semantic-release/github" | ||
], | ||
"publish": ["@semantic-release/npm", "@semantic-release/github"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick search suggests that we should use distTag so that we don't set any version to latest. Can you please verify if this makes sense?
So we would have something like:
"publish": ["@semantic-release/npm", "@semantic-release/github"], | |
"publish": [ | |
["@semantic-release/npm", { | |
"npmPublish": true, | |
"distTag": "v4-latest" | |
}], | |
"@semantic-release/github" | |
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of hardcoding values in the releaserc file we should look into accepting the semantic release arguments from the CI workflow (and based on the branch), so we don't have to manually do this for every branch and run the risk of forgetting to update the next version branch.
Assigns the v4 branch its own dist-tag (
v4
) and restricts it to the 4.x version range. This prevents v4 maintenance releases from overwriting the latest major version in the default npm channel.#1974