Skip to content

Commit 82ba866

Browse files
committed
ci: move npm publish job from build to release workflow
1 parent 4f5ea8c commit 82ba866

2 files changed

Lines changed: 32 additions & 33 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -95,36 +95,3 @@ jobs:
9595
gh workflow run release.yml --ref $new_tag
9696
env:
9797
GH_TOKEN: ${{ github.token }}
98-
99-
publish:
100-
name: Publish to npm
101-
needs: [changelog]
102-
runs-on: ubuntu-latest
103-
if: github.ref_type != 'tag' && inputs.release_type != null
104-
steps:
105-
- name: Checkout code
106-
uses: actions/checkout@v4
107-
with:
108-
token: ${{ github.token }}
109-
110-
- name: Setup Node.js
111-
uses: actions/setup-node@v4
112-
with:
113-
node-version: '22'
114-
registry-url: 'https://registry.npmjs.org'
115-
116-
- name: Setup pnpm
117-
uses: pnpm/action-setup@v4
118-
with:
119-
version: 10.4.1
120-
121-
- name: Install dependencies
122-
run: pnpm install --frozen-lockfile
123-
124-
- name: Build package
125-
run: pnpm build
126-
127-
- name: Publish to npm
128-
run: npm publish --access public
129-
env:
130-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,38 @@ permissions:
77
actions: read
88

99
jobs:
10+
publish:
11+
name: Publish to npm
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
ref: ${{ github.ref }}
18+
token: ${{ github.token }}
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '22'
24+
registry-url: 'https://registry.npmjs.org'
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 10.4.1
30+
31+
- name: Install dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Build package
35+
run: pnpm build
36+
37+
- name: Publish to npm
38+
run: npm publish --access public
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
1042
release:
1143
name: Create GitHub release
1244
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)