diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..77504f7 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -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/npm-publish-action@1.3.3 + 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 \ No newline at end of file