Skip to content
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

Avoid tagging 6.x releases with latest tag on npm #12605

Closed
wants to merge 1 commit into from
Closed
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
24 changes: 16 additions & 8 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ async function ensureBuildVersion(packageName, version) {
*/
function publishBuild(packageName, tag) {
let buildDir = path.join(rootDir, "packages", packageName);
let args = ["--access public", `--tag ${tag}`];
let args = ["--access public"];
if (tag) {
args.push(`--tag ${tag}`);
}
if (tag === "experimental" || tag === "nightly") {
args.push(`--no-git-checks`);
} else {
Expand Down Expand Up @@ -75,13 +78,18 @@ async function run() {
);

// 2. Determine the appropriate npm tag to use
let tag = version.includes("experimental")
? "experimental"
: version.includes("nightly")
? "nightly"
: semver.prerelease(version) == null
? "latest"
: "pre";
let tag;
if (version.includes("experimental")) {
tag = "experimental";
} else if (version.includes("nightly")) {
tag = "nightly";
} else if (version.startsWith("7.")) {
if (semver.prerelease(version) == null) {
tag = "latest";
} else {
tag = "pre";
}
}

console.log();
console.log(` Publishing version ${version} to npm with tag "${tag}"`);
Expand Down
Loading