Skip to content

Commit 8d68445

Browse files
Enable npm trusted publishing on 0.85 (#57712)
* [LOCAL] Set stagingProfileId to com.facebook * Enable npm trusted publishing on 0.85 * Complete trusted publishing repository metadata * Fix trusted publishing Flow types * Use shared repository metadata type --------- Co-authored-by: Nicola Corti <ncor@meta.com>
1 parent 32fdcf2 commit 8d68445

20 files changed

Lines changed: 560 additions & 300 deletions

File tree

.github/actions/build-npm-package/action.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ inputs:
44
release-type:
55
required: true
66
description: The type of release we are building. It could be nightly, release or dry-run
7-
gha-npm-token:
8-
required: false
9-
description: The GHA npm token, required only to publish to npm
10-
default: ''
117
gradle-cache-encryption-key:
128
description: The encryption key needed to store the Gradle Configuration cache
139

@@ -38,6 +34,9 @@ runs:
3834
cache-encryption-key: ${{ inputs.gradle-cache-encryption-key }}
3935
- name: Setup node.js
4036
uses: ./.github/actions/setup-node
37+
with:
38+
node-version: '24'
39+
registry-url: 'https://registry.npmjs.org'
4140
- name: Install dependencies
4241
uses: ./.github/actions/yarn-install
4342
- name: Build packages
@@ -46,12 +45,9 @@ runs:
4645
- name: Build types
4746
shell: bash
4847
run: yarn build-types --skip-snapshot
49-
# Continue with publish steps
50-
- name: Set npm credentials
51-
if: ${{ inputs.release-type == 'release' ||
52-
inputs.release-type == 'nightly' }}
53-
shell: bash
54-
run: echo "//registry.npmjs.org/:_authToken=${{ inputs.gha-npm-token }}" > ~/.npmrc
48+
# `npm publish` below authenticates via npm Trusted Publishing (OIDC).
49+
# The caller (the `publish-npm.yml` workflow) MUST grant `id-token: write`;
50+
# this composite action runs inside that job.
5551
- name: Publish NPM
5652
shell: bash
5753
run: |

.github/actions/setup-node/action.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,19 @@ inputs:
55
description: 'The node.js version to use'
66
required: false
77
default: '22.14.0'
8+
registry-url:
9+
description: |
10+
Optional npm registry URL passed through to actions/setup-node. Set on
11+
jobs that publish to npm so setup-node writes a `.npmrc` configured to
12+
pick up the OIDC-minted token from npm Trusted Publishing.
13+
required: false
14+
default: ''
815
runs:
9-
using: "composite"
16+
using: 'composite'
1017
steps:
1118
- name: Setup node.js
1219
uses: actions/setup-node@v6
1320
with:
1421
node-version: ${{ inputs.node-version }}
1522
cache: yarn
23+
registry-url: ${{ inputs.registry-url }}

.github/workflows/bump-podfile-lock.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55

66
jobs:
77
bump-podfile-lock:
8-
runs-on: macos-latest
8+
runs-on: macos-15
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v6

.github/workflows/nightly.yml

Lines changed: 0 additions & 96 deletions
This file was deleted.

.github/workflows/publish-bumped-packages.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)