From 33fa525cfa9735f2ab211470a4477dc1fcc744f9 Mon Sep 17 00:00:00 2001 From: pruthvidhodda Date: Thu, 11 Jun 2020 17:13:47 -0700 Subject: [PATCH 1/2] Modify workflow to publish npm package --- .github/workflows/build.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67489c07..d9457e0c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,21 +5,27 @@ name: Node.js CI on: push: - branches: [ master ] - tags: [v*] + branches: + - master + - release-* + tags: + - v* pull_request: - branches: [ master ] + branches: + - master + - release-* jobs: build: runs-on: ubuntu-latest - + env: + NODE_VER: 10 steps: - uses: actions/checkout@v2 - name: Use Node.js uses: actions/setup-node@v1 with: - node-version: 10 + node-version: ${{ env.NODE_VER }} - run: npm ci env: @@ -31,11 +37,11 @@ jobs: - name: Is Release? if: startswith(github.ref, 'refs/tags/v') - run: echo "##[set-env name=DEPLOY_PACKAGE;]true" + run: echo "::set-env name=DEPLOY_PACKAGE::true" - name: Publish to npm if: env.DEPLOY_PACKAGE == 'true' - run: npm set registry https://registry.npmjs.org/ && npm publish + run: npm set registry https://registry.npmjs.org/ && npm publish --access public env: NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 4e59434b537a3eaadb192defcd4e878592904b84 Mon Sep 17 00:00:00 2001 From: pruthvidhodda Date: Wed, 17 Jun 2020 14:39:20 -0700 Subject: [PATCH 2/2] Uppercase for token --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9457e0c..c25bec44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,10 +43,10 @@ jobs: if: env.DEPLOY_PACKAGE == 'true' run: npm set registry https://registry.npmjs.org/ && npm publish --access public env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - name: Publish to github if: env.DEPLOY_PACKAGE == 'true' run: npm set registry https://npm.pkg.github.com/ && npm publish env: - NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}