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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: "ioredis robot"
GIT_AUTHOR_EMAIL: "[email protected]"
run: npx semantic-release --branches v4
run: npx semantic-release
13 changes: 8 additions & 5 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
{
"branches": ["v4"],
"branches": [
{
"name": "v4",
"tag": "v4",
"channel": "v4"
}
],
"verifyConditions": [
"@semantic-release/npm",
"@semantic-release/changelog",
Expand All @@ -23,10 +29,7 @@
]
}
],
"publish": [
"@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.

"analyzeCommits": {
"preset": "angular",
"releaseRules": [
Expand Down
Loading