Skip to content

Commit

Permalink
[ci] Fix incorrect tags being pushed for compiler releases
Browse files Browse the repository at this point in the history
ghstack-source-id: 812e49333ce19c3d13adb6cc87154fb83d7639b0
Pull Request resolved: #30620
  • Loading branch information
poteto committed Aug 6, 2024
1 parent 030d83b commit feec8f1
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions compiler/scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,8 @@ async function main() {
})
.option('tags', {
description: 'Tags to publish to npm',
type: 'choices',
choices: ['experimental'],
default: ['experimental'],
type: 'string',
default: 'experimental',
})
.help('help')
.parseSync();
Expand Down Expand Up @@ -178,27 +177,29 @@ async function main() {
spinner.succeed(`Successfully published ${pkgName} to npm`);

spinner.start('Pushing tags to npm');
for (const tag of argv.tags) {
try {
let opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag];
if (otp != null) {
opts.push(`--otp=${otp}`);
if (typeof argv.tags === 'string') {
for (const tag of argv.tags.split(',')) {
try {
let opts = ['dist-tag', 'add', `${pkgName}@${newVersion}`, tag];
if (otp != null) {
opts.push(`--otp=${otp}`);
}
if (argv.debug === true) {
spinner.info(`dry-run: npm ${opts.join(' ')}`);
} else {
await spawnHelper('npm', opts, {
cwd: pkgDir,
stdio: 'inherit',
});
}
} catch (e) {
spinner.fail(e.toString());
throw e;
}
if (argv.debug === true) {
spinner.info(`dry-run: npm ${opts.join(' ')}`);
} else {
await spawnHelper('npm', opts, {
cwd: pkgDir,
stdio: 'inherit',
});
}
} catch (e) {
spinner.fail(e.toString());
throw e;
spinner.succeed(
`Successfully pushed dist-tag ${tag} for ${pkgName} to npm`
);
}
spinner.succeed(
`Successfully pushed dist-tag ${tag} for ${pkgName} to npm`
);
}
}

Expand Down

0 comments on commit feec8f1

Please sign in to comment.