Skip to content

Commit 3bf3347

Browse files
authored
ci: enable npm trusted publishing with OIDC (#47)
1 parent 48ae29a commit 3bf3347

2 files changed

Lines changed: 23 additions & 25 deletions

File tree

.github/workflows/release.yaml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,43 @@
1-
# .github/workflows/release.yml
2-
31
name: Release
42

5-
permissions:
6-
contents: write
7-
83
on:
94
push:
105
tags:
116
- 'v*'
127

8+
permissions:
9+
contents: write
10+
id-token: write
11+
1312
jobs:
1413
release:
1514
runs-on: ubuntu-latest
1615
steps:
17-
- name: Checkout repository
16+
- name: Check out repository
1817
uses: actions/checkout@v6
19-
20-
- uses: actions/checkout@v6
2118
with:
2219
fetch-depth: 0
2320

24-
- uses: actions/setup-node@v6
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v6
23+
24+
- name: Set up Node
25+
uses: actions/setup-node@v6
2526
with:
26-
node-version: 18.x
27+
node-version: 24.x
28+
registry-url: https://registry.npmjs.org
29+
package-manager-cache: false
2730

28-
- run: npx changelogithub
29-
env:
30-
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
31+
- name: Install dependencies
32+
run: pnpm i --frozen-lockfile
3133

32-
npm:
33-
runs-on: ubuntu-latest
34-
35-
steps:
36-
- name: Checkout repository
37-
uses: actions/checkout@v6
34+
- name: Build packages
35+
run: pnpm build
3836

39-
- name: Setup (Install node & pnpm)
40-
uses: ./.github/actions/setup
37+
- name: Stage packages/core on npm
38+
run: pnpm pub:release
4139

42-
- name: Build Packages & Publish to npm
43-
run: pnpm build && pnpm pub:release
40+
- name: Generate GitHub Release notes
41+
run: pnpm dlx changelogithub
4442
env:
45-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

packages/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"type-check": "vue-tsc -p tsconfig.check.json --noEmit",
4848
"test": "vitest",
4949
"test-update": "vitest -u",
50-
"pub:release": "pnpm publish --no-git-checks --access public"
50+
"pub:release": "pnpm stage publish --no-git-checks --access public"
5151
},
5252
"peerDependencies": {
5353
"vue": ">= 3.5.0"

0 commit comments

Comments
 (0)