Update release script for backports · rollup/rollup@9677409
@@ -14,12 +14,11 @@ import { runAndGetStdout, runWithEcho } from './helpers.js';
1414// We execute everything from the main directory
1515chdir(fileURLToPath(new URL('..', import.meta.url)));
161617-const MAIN_BRANCH = 'master';
17+const BACKPORTS_MAIN_BRANCH = 'backports-rollup-3';
1818const MAIN_PACKAGE = 'package.json';
1919const MAIN_LOCKFILE = 'package-lock.json';
2020const BROWSER_PACKAGE = 'browser/package.json';
2121const CHANGELOG = 'CHANGELOG.md';
22-const DOCUMENTATION_BRANCH = 'documentation-published';
23222423const [gh, currentBranch] = await Promise.all([
2524getGithubApi(),
@@ -34,7 +33,7 @@ const [mainPackage, mainLockFile, browserPackage, repo, issues, changelog] = awa
3433gh.getIssues('rollup', 'rollup'),
3534readFile(CHANGELOG, 'utf8')
3635]);
37-const isMainBranch = currentBranch === MAIN_BRANCH;
36+const isMainBranch = currentBranch === BACKPORTS_MAIN_BRANCH;
3837const [newVersion, includedPRs] = await Promise.all([
3938getNewVersion(mainPackage, isMainBranch),
4039getIncludedPRs(changelog, repo, currentBranch, isMainBranch)
@@ -56,7 +55,7 @@ try {
5655throw error;
5756}
585759-await releasePackages(newVersion);
58+await releasePackages();
6059await pushChanges(gitTag);
6160if (changelogEntry) {
6261await createReleaseNotes(changelogEntry, gitTag);
@@ -231,12 +230,8 @@ function getDummyLogSection(headline, pr) {
231230}
232231233232async function installDependenciesBuildAndTest() {
234-await Promise.all([runWithEcho('npm', ['ci']), runWithEcho('npm', ['audit'])]);
235-await Promise.all([
236-runWithEcho('npm', ['run', 'ci:lint']),
237-runWithEcho('npm', ['run', 'build:bootstrap'])
238-]);
239-await runWithEcho('npm', ['run', 'test:all']);
233+await Promise.all([runWithEcho('npm', ['ci'])]);
234+await Promise.all([runWithEcho('npm', ['run', 'build:bootstrap'])]);
240235}
241236242237async function waitForChangelogUpdate(version) {
@@ -293,13 +288,18 @@ async function commitChanges(newVersion, gitTag, isMainBranch) {
293288]);
294289await runWithEcho('git', ['commit', '-m', newVersion]);
295290await runWithEcho('git', ['tag', gitTag]);
296-isMainBranch && (await runWithEcho('git', ['branch', DOCUMENTATION_BRANCH, '--force', gitTag]));
297291}
298292299-function releasePackages(newVersion) {
293+async function releasePackages() {
300294const releaseEnvironment = { ...process.env, ROLLUP_RELEASE: 'releasing' };
301-const releaseTag = semverPreRelease(newVersion) ? ['--tag', 'beta'] : [];
302-const parameters = ['publish', '--access', 'public', ...releaseTag];
295+const { otp } = await inquirer.prompt([
296+{
297+message: 'Enter npm one-time password:',
298+name: 'otp',
299+type: 'input'
300+}
301+]);
302+const parameters = ['publish', '--access', 'public', '--tag', 'backports-3', `--otp=${otp}`];
303303return Promise.all([
304304runWithEcho('npm', parameters, {
305305cwd: new URL('..', import.meta.url),
@@ -315,8 +315,7 @@ function releasePackages(newVersion) {
315315function pushChanges(gitTag) {
316316return Promise.all([
317317runWithEcho('git', ['push', 'origin', 'HEAD']),
318-runWithEcho('git', ['push', 'origin', gitTag]),
319-isMainBranch && runWithEcho('git', ['push', '--force', 'origin', DOCUMENTATION_BRANCH])
318+runWithEcho('git', ['push', 'origin', gitTag])
320319]);
321320}
322321