-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ab0763
commit 3b1470b
Showing
1 changed file
with
15 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |