Skip to content

Commit 950c779

Browse files
authored
Create publish action that triggers on gh release (#12)
* Create publish action that triggers on gh release This could maybe also be added in the library template. * Change secret name to match others
1 parent 29a4f17 commit 950c779

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install pnpm
13+
uses: pnpm/action-setup@v4
14+
with:
15+
version: 9
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
cache: 'pnpm'
21+
- name: Install dependencies
22+
run: pnpm install --frozen-lockfile
23+
- name: Publish package
24+
run: pnpm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)