Skip to content

Commit 7333ff4

Browse files
committed
test: test npm Trusted Publisher
1 parent 2f9ad22 commit 7333ff4

File tree

1 file changed

+9
-45
lines changed

1 file changed

+9
-45
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,21 @@
1-
name: Publish package to NPM
1+
name: Publish Package
22

33
on:
4-
workflow_call:
4+
workflow_dispatch:
55

66
permissions:
77
id-token: write # Required for OIDC
8+
contents: read
89

910
jobs:
1011
publish:
11-
name: Publish package to NPM
1212
runs-on: ubuntu-latest
13-
1413
steps:
15-
- name: Check out repository
16-
uses: actions/checkout@v6
17-
with:
18-
fetch-depth: 0
19-
persist-credentials: false
14+
- uses: actions/checkout@v4
2015

21-
- name: Set up pnpm
22-
uses: pnpm/action-setup@v4
16+
- uses: actions/setup-node@v4
2317
with:
24-
version: 10
25-
run_install: false
26-
27-
- name: Set up Node.js
28-
uses: actions/setup-node@v6
29-
with:
30-
node-version-file: .node-version
31-
registry-url: https://registry.npmjs.org/
32-
cache: pnpm
33-
34-
- name: Restore cache
35-
id: dependencies-cache
36-
uses: actions/cache@v5
37-
with:
38-
path: |
39-
**/node_modules
40-
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
41-
restore-keys: |
42-
${{ runner.os }}-pnpm-
43-
44-
- name: Install Dependencies 🔧
45-
if: steps.dependencies-cache.outputs.cache-hit != 'true'
46-
run: |
47-
pnpm install
48-
49-
- name: Build ☕️
50-
run: |
51-
pnpm build
52-
53-
- name: Publish to NPM
54-
run: |
55-
npm publish
56-
env:
57-
NPM_CONFIG_PROVENANCE: true
18+
node-version: '24'
19+
registry-url: 'https://registry.npmjs.org'
20+
- run: npm test
21+
- run: npm publish

0 commit comments

Comments
 (0)