Skip to content

Commit 41432b5

Browse files
committed
ci: use npmjs.com OIDC Trusted Publisher for package release
lerna v9+ is required for OIDC support, along with manual configuration on npmjs.com to trust the publish.yml github workflow file
1 parent d33a19a commit 41432b5

File tree

3 files changed

+1184
-587
lines changed

3 files changed

+1184
-587
lines changed

.github/workflows/publish.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
timeout-minutes: 30
1414
runs-on: ubuntu-latest
1515
permissions:
16-
id-token: write # to enable use of OIDC for npm provenance
16+
id-token: write # enables OIDC for npmjs.com "Trusted Publisher" and provenance
1717
steps:
1818
- uses: actions/checkout@v4
1919
with:
@@ -37,15 +37,12 @@ jobs:
3737
git config --global user.name 'Invertase Publisher'
3838
git config --global user.email 'oss@invertase.io'
3939
- name: Publish Packages
40-
# for lerna, you must write the token out to .npmrc like this
4140
run: |
42-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
4341
git diff --exit-code
4442
yarn lerna changed
4543
yarn lerna version --yes --force-publish=*
4644
yarn lerna publish from-package --yes
4745
env:
48-
# new style token w/scope for `@react-native-firebase` required
49-
# to work with npmjs.com 2FA-or-automation-token package requirement
50-
NPM_TOKEN: ${{ secrets.MIKEHARDY_NPM_TOKEN }}
46+
# No NPM token needed, all of the packages have been configured
47+
# on npmjs.com with this workflow file as an OIDC "Trusted Publisher"
5148
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
"genversion": "^3.2.0",
9191
"google-java-format": "^2.0.1",
9292
"jest": "^30.0.5",
93-
"lerna": "^8.2.4",
93+
"lerna": "^9.0.0",
9494
"patch-package": "^8.0.0",
9595
"prettier": "^3.6.2",
9696
"regenerator-transform": "^0.15.2",

0 commit comments

Comments
 (0)