Skip to content

Commit 2471908

Browse files
committed
fix ci
1 parent b9509f2 commit 2471908

File tree

1 file changed

+13
-39
lines changed

1 file changed

+13
-39
lines changed

.github/workflows/publish.yml

Lines changed: 13 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,25 @@
1-
name: Publish
1+
name: Publish Package
22

33
on:
4-
workflow_dispatch:
5-
release:
6-
types: [published]
4+
push:
5+
tags:
6+
- "v*"
77

88
permissions:
9+
id-token: write # Required for OIDC
910
contents: read
10-
id-token: write
1111

1212
jobs:
1313
publish:
1414
runs-on: ubuntu-latest
15-
1615
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v4
19-
with:
20-
fetch-depth: 0
21-
22-
- name: Set up pnpm
23-
uses: pnpm/action-setup@v4
24-
with:
25-
version: latest
26-
run_install: false
16+
- uses: actions/checkout@v4
2717

28-
- name: Install Node.js
29-
uses: actions/setup-node@v4
18+
- uses: actions/setup-node@v4
3019
with:
31-
node-version: 24
32-
cache: "pnpm"
33-
cache-dependency-path: pnpm-lock.yaml
34-
registry-url: https://registry.npmjs.org/
35-
36-
- name: Install dependencies
37-
run: pnpm install --frozen-lockfile
38-
39-
- name: Check trusted publishing prerequisites
40-
run: |
41-
node --version
42-
npm --version
43-
if [ -n "${NODE_AUTH_TOKEN:-}" ] || [ -n "${NPM_TOKEN:-}" ]; then
44-
echo "NODE_AUTH_TOKEN/NPM_TOKEN is set. Remove token auth to use npm trusted publishing."
45-
exit 1
46-
fi
47-
48-
- name: Build and publish to npm
49-
run: |
50-
pnpm build
51-
npm publish --access public --provenance
20+
node-version: "24"
21+
registry-url: "https://registry.npmjs.org"
22+
- run: npm ci
23+
- run: npm run build --if-present
24+
- run: npm test
25+
- run: npm publish

0 commit comments

Comments
 (0)