Skip to content

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

Open
wants to merge 1 commit into
base: v4
Choose a base branch
from

Conversation

nkaradzhov
Copy link

@nkaradzhov nkaradzhov commented Apr 15, 2025

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

Copy link

@Copilot Copilot AI left a 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.
@nkaradzhov nkaradzhov changed the title fix(release): stop overwriting npm latest dist-tag chore(release): stop overwriting npm latest dist-tag Apr 16, 2025
"@semantic-release/npm",
"@semantic-release/github"
],
"publish": ["@semantic-release/npm", "@semantic-release/github"],

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:

Suggested change
"publish": ["@semantic-release/npm", "@semantic-release/github"],
"publish": [
["@semantic-release/npm", {
"npmPublish": true,
"distTag": "v4-latest"
}],
"@semantic-release/github"
],

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.

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