Skip to content

Commit

Permalink
feat(ci): automate publishing npm package
Browse files Browse the repository at this point in the history
  • Loading branch information
themightychris committed Dec 9, 2024
1 parent 096e1fe commit 8e8675f
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish npm package

on:
push:
tags: [ 'v*' ]


jobs:
publish-npm:
runs-on: ubuntu-latest
steps:

- uses: actions/setup-node@v1
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- uses: actions/checkout@v3

- name: Place tag in environment
run: |
echo "SOURCE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
- name: Setting package.json version
run: npm version --no-git-tag-version "${SOURCE_TAG#v}"

- run: npm install

- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
**/test/
**/.vscode/
.github/**
.eslintrc.json

0 comments on commit 8e8675f

Please sign in to comment.