File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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 environment : production
1619
1720 steps :
3235 - name : Publish to NPM
3336 run : |
3437 bash ./bin/publish-npm
35- env :
36- NPM_TOKEN : ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }}
Original file line number Diff line number Diff line change 1818 - name : Check release environment
1919 run : |
2020 bash ./bin/check-release-environment
21- env :
22- NPM_TOKEN : ${{ secrets.NEPTUNE_API_V2_NPM_TOKEN || secrets.NPM_TOKEN }}
2321
Original file line number Diff line number Diff line change @@ -9,4 +9,4 @@ dist-deno
99/* .tgz
1010.idea /
1111.eslintcache
12-
12+ oidc
Original file line number Diff line number Diff line change 11configured_endpoints : 49
22openapi_spec_url : https://storage.googleapis.com/stainless-sdk-openapi-specs/cryptech%2Fneptune-api-v2-99a21fdf9159c28a75eb60c0b7ad4710d01b0a98dd0474267a07e9914039fa83.yml
33openapi_spec_hash : f58f326c00c34bc45b28b09b9530566c
4- config_hash : 84d629517f39556d062170b39b3702c6
4+ config_hash : 27aff5f3f84397a9b3c2cb8a3c1d1e71
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
712pnpm 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- pnpm publish --no-git-checks --tag " $TAG "
69+ pnpm publish --npm-path " $( cd ../ && pwd ) /oidc/node_modules/.bin/npm " -- no-git-checks --tag " $TAG "
You can’t perform that action at this time.
0 commit comments