From a074cce519f7fe37b78720d5291c3a587482ec0d Mon Sep 17 00:00:00 2001 From: Zihua Li Date: Tue, 16 Jan 2024 21:34:09 +0800 Subject: [PATCH] Update npm registry --- scripts/release.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/release.js b/scripts/release.js index fcbe4de..9df217a 100755 --- a/scripts/release.js +++ b/scripts/release.js @@ -27,6 +27,10 @@ if (!process.env.CI) { exitWithError('The script should only be run in CI'); } +exec( + `echo "//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}" > ~/.npmrc`, +); + exec('git config --global user.name "Zihua Li"'); exec('git config --global user.email "635902+luin@users.noreply.github.com"'); @@ -117,7 +121,7 @@ fs.writeFileSync( exec('git add CHANGELOG.md'); exec(`npm version ${version} -f`); -const pushCommand = 'git push --tags'; +const pushCommand = `git push origin ${GITHUB_REF_NAME} --follow-tags`; if (dryRun) { console.log(`Skipping: "${pushCommand}" in dry-run mode`); } else {