Skip to content

Commit 2e9781a

Browse files
authored
Adjust tag name for previous version release (#1781)
Tags share a namespace with version numbers, and cannot be version numbers as a result, see: https://docs.npmjs.com/cli/v11/commands/npm-dist-tag#caveats Tags are typically used to identify upcoming versions (`beta`, `canary`, `dev`) while we're more interested in tagging previous ones. Using a `previous-` prefix to get what we need.
1 parent 3ed1d7b commit 2e9781a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tools/release-package.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,11 @@ async function releasePackage(prNumber) {
9494
};
9595
if (type.match(/\d+$/)) {
9696
// A previous version is being published and we do not want it to
97-
// replace the "latest" tag. Let's link it to a separate tag.
97+
// replace the "latest" tag. Let's link it to a separate tag. Note the
98+
// tag name cannot just be the version:
99+
// https://docs.npmjs.com/cli/v9/commands/npm-dist-tag#caveats
98100
const pinnedVersion = type.match(/\d+$/)[0];
99-
pubOptions.tag = `v${pinnedVersion}`;
101+
pubOptions.tag = `previous-v${pinnedVersion}`;
100102
}
101103
if (NPM_TOKEN) {
102104
pubOptions.token = NPM_TOKEN;

0 commit comments

Comments
 (0)