Skip to content

Commit 6d60a96

Browse files
ci: use different publish workflow
1 parent 167fafa commit 6d60a96

File tree

1 file changed

+27
-8
lines changed

1 file changed

+27
-8
lines changed

.github/workflows/npm-publish.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,34 @@
1+
name: Publish package
2+
13
on:
2-
push:
3-
branches: ['main']
4+
release:
5+
types: [published]
46

57
jobs:
6-
publish:
8+
build:
79
runs-on: ubuntu-latest
810
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-node@v3
11+
- name: Checkout
12+
uses: actions/checkout@v4
13+
14+
- uses: pnpm/action-setup@v2
15+
name: Install pnpm
1116
with:
12-
node-version: '20'
13-
- uses: JS-DevTools/npm-publish@v3
17+
version: 8
18+
run_install: false
19+
20+
- name: Install Node.js
21+
uses: actions/setup-node@v3
1422
with:
15-
token: ${{ secrets.NPM_TOKEN }}
23+
node-version-file: '.nvmrc'
24+
cache: pnpm
25+
registry-url: https://registry.npmjs.org
26+
27+
- name: Install dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Publish
31+
shell: bash
32+
run: pnpm publish --access public --no-git-checks
33+
env:
34+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)