Skip to content

Commit

Permalink
Set NPM_TOKEN in .npmrc when publishing (babel#9735) [skip ci]
Browse files Browse the repository at this point in the history
* Set NPM_TOKEN in .npmrc when publishing [skip ci]

* Update .github/main.workflow
  • Loading branch information
nicolo-ribaudo authored Mar 24, 2019
1 parent adb4701 commit d610289
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ action "Publish to npm" {
uses = "docker://node:10"
secrets = ["NPM_TOKEN"]
runs = "make"
args = "publish"
args = "publish-ci"
env = {
CI = "true"
}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.npmrc

.DS_Store
/node_modules
/.github/actions/*/node_modules
Expand Down
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ fix-json:
./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn

clean: test-clean
rm -f .npmrc
rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist
rm -rf coverage
Expand Down Expand Up @@ -140,6 +141,17 @@ publish: prepublish
./node_modules/.bin/lerna publish from-git --require-scripts
make clean

publish-ci: prepublish
ifneq ("$(NPM_TOKEN)", "")
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
else
echo "Missing NPM_TOKEN env var"
exit 1
endif
./node_modules/.bin/lerna publish from-git --require-scripts --yes
rm -f .npmrc
make clean

bootstrap-only: clean-all
yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines
Expand Down

0 comments on commit d610289

Please sign in to comment.