Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 0 additions & 1 deletion .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ jobs:
run: node tools/release-package.js ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
15 changes: 7 additions & 8 deletions tools/release-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,14 @@ async function releasePackage(prNumber) {

console.log(`- Publish packages/${type} folder to npm`);
const packageFolder = path.join(installFolder, "packages", type, "package.json");
const pubResult = await npmPublish({
package: packageFolder,
token: NPM_TOKEN
const pubOptions = {
package: packageFolder
//, debug: console.debug
});
};
if (NPM_TOKEN) {
pubOptions.token = NPM_TOKEN;
}
const pubResult = await npmPublish(pubOptions);
console.log(`- Published version was ${pubResult.oldVersion}`);
console.log(`- Version bump: ${pubResult.type}`);
console.log(`- Published version is ${pubResult.version}`);
Expand Down Expand Up @@ -155,10 +158,6 @@ if (!GH_TOKEN) {
}

const NPM_TOKEN = config?.NPM_TOKEN ?? process.env.NPM_TOKEN;
if (!NPM_TOKEN) {
console.error("NPM_TOKEN must be set to an npm token as an env variable or in a config.json file");
process.exit(1);
}

// Note: npm-publish has a bug and needs an "INPUT_TOKEN" env variable:
// https://github.com/JS-DevTools/npm-publish/issues/15
Expand Down