Skip to content

Commit

Permalink
ci: changed method of npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftwork committed Mar 10, 2020
1 parent 9e931b4 commit 8ebc06e
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ jobs:
registry-url: https://npm.pkg.github.com
scope: trutoo

- name: Append npm registry authentication to .npmrc
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ${NPM_CONFIG_USERCONFIG}
- name: Install dependencies using CI
run: npm ci
env:
Expand All @@ -48,14 +52,6 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used by standard npm publish
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Used for github releases through semantic release

- name: Swap registry to NPM
uses: actions/setup-node@v1
if: env.VERSION != null
with:
registry-url: https://registry.npmjs.org

- name: Publish package to NPM
run: npm publish
if: env.VERSION != null
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm publish --registry https://registry.npmjs.org
if: env.VERSION != null # Only if semantic-release publishes the package

0 comments on commit 8ebc06e

Please sign in to comment.