55
66name : Release a New Version
77
8+ permissions :
9+ id-token : write # Required for OIDC
10+ contents : write
11+
812jobs :
913 releaseandpublish :
1014 name : Release on Github and Publish on NPM
@@ -16,16 +20,40 @@ jobs:
1620 - name : ⎔ Setup node
1721 uses : actions/setup-node@v5
1822 with :
19- node-version : 22
20- always-auth : true
23+ node-version : 24
2124 registry-url : ' https://registry.npmjs.org'
2225 scope : ' @crystallize'
2326
27+ - name : ⬆️ Upgrade npm
28+ run : npm i -g npm@11
29+
30+ - name : ⎔ Set up pnpm
31+ uses : pnpm/action-setup@v4
32+ with :
33+ version : 10.14.0
34+
2435 - name : 📥 Download deps
25- run : yarn install
36+ run : pnpm install
2637
2738 - name : 🏄 Run the tests
28- run : yarn build && yarn test
39+ run : pnpm build && pnpm test
40+
41+ - name : 🧪 Debug environment
42+ run : |
43+ echo "node=$(node -v)"
44+ echo "npm=$(npm -v)"
45+ echo "repo=${GITHUB_REPOSITORY}"
46+ echo "workflow=${GITHUB_WORKFLOW}"
47+ echo "workflow_ref=${GITHUB_WORKFLOW_REF}"
48+ echo "ref=${GITHUB_REF}"
49+ echo "ref_name=${GITHUB_REF_NAME}"
50+ echo "actor=${GITHUB_ACTOR}"
51+ echo "sha=${GITHUB_SHA}"
52+ echo "event_name=${GITHUB_EVENT_NAME}"
53+ echo "registry=$(npm config get registry)"
54+ echo "userconfig=${NPM_CONFIG_USERCONFIG}"
55+ npm config get "//registry.npmjs.org/:_authToken" || true
56+ npm config list -l
2957
3058 - name : 🏷 Create Release
3159 uses : actions/create-release@v1
3866 prerelease : false
3967
4068 - name : 📢 Publish to NPM
41- run : yarn publish --new-version ${GITHUB_REF#"refs/tags/"} --no-git-tag-version
69+ run : npm publish --provenance --access public
4270 env :
43- NPM_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
44- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
71+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72+ # Use OIDC for npm authentication instead of NPM_TOKEN
73+ NODE_AUTH_TOKEN : ' '
74+ NPM_TOKEN : ' '
0 commit comments