Skip to content

Commit e0065e9

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

File tree

1 file changed

+10
-41
lines changed

1 file changed

+10
-41
lines changed

.github/workflows/publish.yml

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,26 @@
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

2116
- name: Set up pnpm
2217
uses: pnpm/action-setup@v4
2318
with:
2419
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
20+
- uses: actions/setup-node@v4
3721
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
22+
node-version: '24'
23+
registry-url: 'https://registry.npmjs.org'
24+
- run: pnpm install
25+
- run: npm test
26+
- run: npm publish

0 commit comments

Comments
 (0)