Set NPM_TOKEN in .npmrc when publishing (#9735) [skip ci]

* Set NPM_TOKEN in .npmrc when publishing [skip ci]

* Update .github/main.workflow
This commit is contained in:
Nicolò Ribaudo 2019-03-24 01:04:44 +01:00 committed by GitHub
parent adb4701e00
commit d610289812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 1 deletions

View File

@ -17,7 +17,7 @@ action "Publish to npm" {
uses = "docker://node:10" uses = "docker://node:10"
secrets = ["NPM_TOKEN"] secrets = ["NPM_TOKEN"]
runs = "make" runs = "make"
args = "publish" args = "publish-ci"
env = { env = {
CI = "true" CI = "true"
} }

2
.gitignore vendored
View File

@ -1,3 +1,5 @@
.npmrc
.DS_Store .DS_Store
/node_modules /node_modules
/.github/actions/*/node_modules /.github/actions/*/node_modules

View File

@ -64,6 +64,7 @@ fix-json:
./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn ./node_modules/.bin/prettier "{packages,codemod}/*/test/fixtures/**/options.json" --write --loglevel warn
clean: test-clean clean: test-clean
rm -f .npmrc
rm -rf packages/babel-polyfill/browser* rm -rf packages/babel-polyfill/browser*
rm -rf packages/babel-polyfill/dist rm -rf packages/babel-polyfill/dist
rm -rf coverage rm -rf coverage
@ -140,6 +141,17 @@ publish: prepublish
./node_modules/.bin/lerna publish from-git --require-scripts ./node_modules/.bin/lerna publish from-git --require-scripts
make clean 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 bootstrap-only: clean-all
yarn --ignore-engines yarn --ignore-engines
./node_modules/.bin/lerna bootstrap -- --ignore-engines ./node_modules/.bin/lerna bootstrap -- --ignore-engines