Skip to content

Commit

Permalink
Merge pull request #21 from TysonMN/GitHub_workflow_for_npm-publish
Browse files Browse the repository at this point in the history
added GitHub workflow to publish to NPM's public registry
  • Loading branch information
loreanvictor authored Sep 15, 2020
2 parents 3c8d289 + 409cbba commit 657afcd
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Based on template copied from https://github.com/marketplace/actions/publish-to-npm#usage
name: npm-publish
on:
push:
branches:
- master
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Set up Node.js
uses: actions/setup-node@master
with:
node-version: 12.0.0
- name: Build the package
run: npm run build
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with: # Documentation of inputs https://github.com/marketplace/actions/publish-to-npm#inputs
tag_name: "v%s"
tag_message: "v%s"
commit_pattern: "^Release (\\S+)"
workspace: "."
env: # Documentation of environment variables https://github.com/marketplace/actions/publish-to-npm#environment-variables
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # Must be set in repo settings

0 comments on commit 657afcd

Please sign in to comment.