Update ci.yaml

This commit is contained in:
Joseph Garrone 2021-05-05 14:08:19 +02:00 committed by GitHub
parent e16e7f77be
commit 93c73f28a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,12 +128,12 @@ jobs:
- uses: actions/setup-node@v2.1.3 - uses: actions/setup-node@v2.1.3
with: with:
node-version: '15' node-version: '15'
registry-url: https://registry.npmjs.org/
- run: | - run: |
PACKAGE_MANAGER=npm PACKAGE_MANAGER=npm
if [ -f "./yarn.lock" ]; then if [ -f "./yarn.lock" ]; then
PACKAGE_MANAGER=yarn PACKAGE_MANAGER=yarn
fi fi
if [ "$PACKAGE_MANAGER" = "yarn" ]; then if [ "$PACKAGE_MANAGER" = "yarn" ]; then
yarn install --frozen-lockfile yarn install --frozen-lockfile
else else
@ -149,13 +149,11 @@ jobs:
echo "This version is already published" echo "This version is already published"
exit 0 exit 0
fi fi
if [ "$NPM_TOKEN" = "" ]; then if [ "$NODE_AUTH_TOKEN" = "" ]; then
echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets" echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
false false
fi fi
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
npm publish npm publish
rm .npmrc
env: env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }} VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }}