Skip to content

Commit 59b968d

Browse files
committed
chore: ci workflow with oidc
1 parent faa6762 commit 59b968d

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/npm_release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ jobs:
150150
path: ${{env.TEST_FOLDER}}/test_results.xcresult
151151
publish:
152152
runs-on: ubuntu-latest
153+
environment: npm-publish
153154
needs:
154155
- build
155156
- test
@@ -172,10 +173,17 @@ jobs:
172173
with:
173174
name: npm-package
174175
path: dist
175-
- name: Publish package
176+
- name: Publish package (OIDC trusted publishing)
177+
if: ${{ vars.USE_NPM_TOKEN != 'true' }}
176178
run: |
177-
echo "Publishing @nativescript/ios@$NPM_VERSION to NPM with tag $NPM_TAG..."
178-
npm publish ./dist/nativescript-ios-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --provenance
179+
echo "Publishing @nativescript/ios@$NPM_VERSION to NPM with tag $NPM_TAG via OIDC trusted publishing..."
180+
npm publish ./dist/nativescript-ios-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --access public --provenance
181+
182+
- name: Publish package (granular token)
183+
if: ${{ vars.USE_NPM_TOKEN == 'true' }}
184+
run: |
185+
echo "Publishing @nativescript/ios@$NPM_VERSION to NPM with tag $NPM_TAG via granular token..."
186+
npm publish ./dist/nativescript-ios-${{env.NPM_VERSION}}.tgz --tag $NPM_TAG --access public --provenance
179187
env:
180188
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
181189
github-release:

0 commit comments

Comments
 (0)