Skip to content

Commit

Permalink
Publish on release
Browse files Browse the repository at this point in the history
  • Loading branch information
rautio committed Oct 2, 2023
1 parent 398a27d commit 6d7c265
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
name: NPM Publish
on:
push:
branches:
- main
release:
types: [created]
jobs:
npm-publish:
name: npm-publish
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
- name: Checkout
uses: actions/checkout@v2
- name: Publish if version has been updated
uses: pascalgn/[email protected]
with: # All of theses inputs are optional
tag_name: 'v%s'
tag_message: 'v%s'
create_tag: 'true'
commit_pattern: "^Release (\\S+)"
workspace: '.'
publish_command: 'yarn'
publish_args: '--non-interactive'
env: # More info about the environment variables in the README
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies and build 🔧
run: yarn && yarn build
- name: Publish package on NPM 📦
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 comments on commit 6d7c265

Please sign in to comment.