File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66 release-version :
77 description : Enter version to release (e.g., 1.0.1).
88 required : false
9+ permissions :
10+ # Required for OIDC. See https://docs.npmjs.com/trusted-publishers#step-2-configure-your-cicd-workflow
11+ id-token : write
12+ contents : write
913jobs :
1014 perform :
1115 if : github.event_name == 'workflow_dispatch' && github.repository_owner == 'spring-io'
@@ -14,13 +18,13 @@ jobs:
1418 - name : Checkout
1519 uses : actions/checkout@v4
1620 - name : Install Node.js
17- uses : actions/setup-node@v3
21+ uses : actions/setup-node@v4
1822 with :
1923 node-version : ' 16'
24+ registry-url : ' https://registry.npmjs.org'
2025 cache : ' npm'
2126 - name : Set up release environment
2227 run : |
2328 echo RELEASE_VERSION=${{ github.event.inputs.release-version }} >> $GITHUB_ENV
24- echo RELEASE_NPM_TOKEN=${{ secrets.NPM_TOKEN }} >> $GITHUB_ENV
2529 - name : Build, tag, and publish npm package
2630 run : ./npm/release.sh
Original file line number Diff line number Diff line change 55if [ ! -v RELEASE_USER ]; then
66 export RELEASE_USER=$GITHUB_ACTOR
77fi
8- # if [ ! -v RELEASE_NPM_TOKEN ]; then
9- # declare -n RELEASE_NPM_TOKEN="RELEASE_NPM_TOKEN_$RELEASE_USER"
10- # fi
11- if [ -z " $RELEASE_NPM_TOKEN " ]; then
12- echo No npm token specified for publishing to npmjs.com. Stopping release.
13- exit 1
14- fi
158export RELEASE_BRANCH=${GITHUB_REF_NAME:- main}
169RELEASE_GIT_NAME=$( curl -s https://api.github.com/users/$RELEASE_USER | jq -r .name)
1710RELEASE_GIT_EMAIL=$RELEASE_USER @users.noreply.github.com
3427git config --local user.name " $RELEASE_GIT_NAME "
3528git config --local user.email " $RELEASE_GIT_EMAIL "
3629
37- # configure npm client for publishing
38- echo -e " //registry.npmjs.org/:_authToken=$RELEASE_NPM_TOKEN " > $HOME /.npmrc
39-
4030# release!
4131(
4232 set -e
@@ -54,9 +44,6 @@ echo -e "//registry.npmjs.org/:_authToken=$RELEASE_NPM_TOKEN" > $HOME/.npmrc
5444
5545exit_code=$?
5646
57- # nuke npm settings
58- rm -f $HOME /.npmrc
59-
6047# check for any uncommitted files
6148git status -s -b
6249
You can’t perform that action at this time.
0 commit comments