File tree Expand file tree Collapse file tree 1 file changed +21
-3
lines changed
Expand file tree Collapse file tree 1 file changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,7 @@ jobs:
145145 script : ./gradlew runtestsAndVerifyResults --stacktrace
146146 publish :
147147 runs-on : ubuntu-latest
148+ environment : npm-publish
148149 needs :
149150 - build
150151 - test
@@ -168,10 +169,27 @@ jobs:
168169 with :
169170 name : npm-package
170171 path : dist
171- - name : Publish package
172+ - name : Update npm (required for OIDC trusted publishing)
172173 run : |
173- echo "Publishing @nativescript/android@$NPM_VERSION to NPM with tag $NPM_TAG..."
174- npm publish ./dist/nativescript-android-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --provenance
174+ npm install -g npm@^11.5.1
175+ npm --version
176+ - name : Publish package (OIDC trusted publishing)
177+ if : ${{ vars.USE_NPM_TOKEN != 'true' }}
178+ run : |
179+ echo "Publishing @nativescript/android@$NPM_VERSION to NPM with tag $NPM_TAG via OIDC trusted publishing..."
180+ unset NODE_AUTH_TOKEN
181+ if [ -n "${NPM_CONFIG_USERCONFIG:-}" ]; then
182+ rm -f "$NPM_CONFIG_USERCONFIG"
183+ fi
184+ npm publish ./dist/nativescript-android-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --access public --provenance
185+ env :
186+ NODE_AUTH_TOKEN : " "
187+
188+ - name : Publish package (granular token)
189+ if : ${{ vars.USE_NPM_TOKEN == 'true' }}
190+ run : |
191+ echo "Publishing @nativescript/android@$NPM_VERSION to NPM with tag $NPM_TAG via granular token..."
192+ npm publish ./dist/nativescript-android-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --access public --provenance
175193 env :
176194 NODE_AUTH_TOKEN : ${{ secrets.NPM_PUBLISH_TOKEN }}
177195 github-release :
You can’t perform that action at this time.
0 commit comments