Skip to content

Commit

Permalink
chore: update npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
weareoutman committed Oct 24, 2020
1 parent 7ab0763 commit 3b1470b
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
on:
push:
branches:
- master
name: npm-publish
on:
release:
types: [created]
jobs:
npm-publish:
build:
runs-on: ubuntu-latest
steps:
# The logic below handles the npm publication:
- uses: actions/checkout@v2
# these if statements ensure that a publication only occurs when
# a new release is created:
if: ${{ steps.release.outputs.release_created }}
- uses: actions/setup-node@v1
with:
node-version: 12
registry-url: 'https://registry.npmjs.org'
if: ${{ steps.release.outputs.release_created }}
- run: yarn install --frozen-lockfile
if: ${{ steps.release.outputs.release_created }}
- run: yarn build
if: ${{ steps.release.outputs.release_created }}
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
if: ${{ steps.release.outputs.release_created }}
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v1
with:
node-version: '12.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install --frozen-lockfile
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 3b1470b

Please sign in to comment.