Skip to content

Commit 6718b44

Browse files
authored
ci: migrate release to npm OIDC trusted publishing (#146)
* ci: migrate release to npm OIDC trusted publishing * chore(pnpm): migrate config to pnpm v11 format * ci: run ci and preview workflows on Node 24 for pnpm 11 * fix: lint
1 parent 31e5f8f commit 6718b44

8 files changed

Lines changed: 29 additions & 22 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
test:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1919
with:
2020
fetch-depth: 0
2121

22-
- uses: pnpm/action-setup@v4
22+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
2323

24-
- uses: actions/setup-node@v4
24+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2525
with:
26-
node-version: 20.x
26+
node-version-file: '.nvmrc'
2727
registry-url: 'https://registry.npmjs.org'
2828
cache: pnpm
2929

.github/workflows/preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
1616
with:
17-
node-version: 22.x
17+
node-version-file: '.nvmrc'
1818
registry-url: 'https://registry.npmjs.org'
1919
cache: pnpm
2020

.github/workflows/release.yml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,41 @@ on:
55
tags:
66
- 'v*'
77

8-
permissions:
9-
contents: write
8+
permissions: {}
9+
10+
concurrency:
11+
group: release-${{ github.ref_name }}
12+
cancel-in-progress: false
1013

1114
jobs:
1215
release:
1316
runs-on: ubuntu-latest
17+
environment: release
18+
permissions:
19+
contents: write
20+
id-token: write
1421
steps:
15-
- uses: actions/checkout@v4
22+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1623
with:
1724
fetch-depth: 0
1825

19-
- uses: actions/setup-node@v4
26+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
2027
with:
21-
node-version: 22.x
28+
node-version-file: '.nvmrc'
2229

2330
- run: npx changelogithub
2431
env:
2532
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2633

27-
- uses: pnpm/action-setup@v4
34+
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8
2835

29-
- uses: actions/setup-node@v4
36+
- uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
3037
with:
31-
node-version: 22.x
38+
node-version-file: '.nvmrc'
3239
registry-url: 'https://registry.npmjs.org'
3340

34-
- run: pnpm install
35-
41+
- run: pnpm install --frozen-lockfile
42+
3643
- name: Build
3744
run: pnpm build
3845

@@ -59,6 +66,4 @@ jobs:
5966
echo "Using npm tag: $NPM_TAG"
6067
6168
- name: Publish to npm
62-
run: pnpm -r publish --access public --no-git-checks --tag ${{ steps.determine_npm_tag.outputs.npm_tag }}
63-
env:
64-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
69+
run: pnpm -r publish --provenance --access public --no-git-checks --tag ${{ steps.determine_npm_tag.outputs.npm_tag }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "better-call-example",
3+
"private": true,
34
"type": "module",
45
"scripts": {
56
"build": "tsc -b"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@better-auth/root",
3-
"packageManager": "pnpm@10.28.2",
3+
"packageManager": "pnpm@11.1.1",
44
"private": true,
55
"scripts": {
66
"build": "pnpm -w --filter=./packages/* run build",

packages/better-call/src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,4 +152,4 @@ export const createClient = <
152152
};
153153
};
154154

155-
export * from "./error";
155+
export * from "./error";

pnpm-workspace.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ packages:
44

55
blockExoticSubdeps: true
66

7-
onlyBuiltDependencies:
8-
- esbuild
7+
allowBuilds:
8+
esbuild: true
99

1010
trustPolicy: no-downgrade
1111

0 commit comments

Comments
 (0)