File tree Expand file tree Collapse file tree 5 files changed +15
-11
lines changed
Expand file tree Collapse file tree 5 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 1212 publish :
1313 name : publish
1414 runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+ id-token : write
1518
1619 steps :
1720 - uses : actions/checkout@v6
2831 - name : Publish to NPM
2932 run : |
3033 bash ./bin/publish-npm
31- env :
32- NPM_TOKEN : ${{ secrets.KERNEL_NPM_TOKEN || secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1717 - name : Check release environment
1818 run : |
1919 bash ./bin/check-release-environment
20- env :
21- NPM_TOKEN : ${{ secrets.KERNEL_NPM_TOKEN || secrets.NPM_TOKEN }}
2220
Original file line number Diff line number Diff line change 11configured_endpoints : 108
22openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel%2Fkernel-3fbe762c99e8a120c426ac22bc1fa257c9127d631b12a38a6440a37f52935543.yml
33openapi_spec_hash : 5a190df210ed90b20a71c5061ff43917
4- config_hash : 38c9b3b355025daf9bb643040e4af94e
4+ config_hash : 3b1fbbb6bda0dac7e8b42e155cd7da56
Original file line number Diff line number Diff line change 22
33errors=()
44
5- if [ -z " ${NPM_TOKEN} " ]; then
6- errors+=(" The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets" )
7- fi
8-
95lenErrors=${# errors[@]}
106
117if [[ lenErrors -gt 0 ]]; then
Original file line number Diff line number Diff line change 22
33set -eux
44
5- npm config set ' //registry.npmjs.org/:_authToken' " $NPM_TOKEN "
5+ if [[ ${NPM_TOKEN:- } ]]; then
6+ npm config set ' //registry.npmjs.org/:_authToken' " $NPM_TOKEN "
7+ elif [[ ! ${ACTIONS_ID_TOKEN_REQUEST_TOKEN:- } ]]; then
8+ echo " ERROR: NPM_TOKEN must be set if not running in a Github Action with id-token permission"
9+ exit 1
10+ fi
611
712yarn build
813cd dist
5762 TAG=" latest"
5863fi
5964
65+ # Install OIDC compatible npm version
66+ npm install --prefix ../oidc/ npm@11.6.2
67+
6068# Publish with the appropriate tag
61- yarn publish --tag " $TAG "
69+ export npm_config_registry=' https://registry.npmjs.org'
70+ ../oidc/node_modules/.bin/npm publish --tag " $TAG "
You can’t perform that action at this time.
0 commit comments