From e15eed460e6afe461f7bf23d62ffc59a9bc7c95a Mon Sep 17 00:00:00 2001 From: Fernando Alonso Pecina Date: Mon, 26 Oct 2026 15:40:10 +0000 Subject: [PATCH 1/4] ci: add OSS Exit Gate npm release workflow Signed-off-by: Fernando Alonso Pecina --- .github/workflows/publish.yml | 62 +++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..33f11e0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,62 @@ +name: Publish to npm via OSS Exit Gate + +on: + release: + types: [published] + workflow_dispatch: + +permissions: {} + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 + with: + persist-credentials: false + + - name: Set up Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 + with: + node-version: 20 + + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed + with: + workload_identity_provider: 'projects/305452601764/locations/global/workloadIdentityPools/builders/providers/github' + + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f + + - name: Build and stage @google/react-native-make-payment to OSS Exit Gate + run: | + yarn install --immutable || npm install + yarn prepare || npm run prepare --if-present + cat << 'EOF' > .npmrc + registry=https://us-npm.pkg.dev/oss-exit-gate-prod/rn-make-payment--npm/ + //us-npm.pkg.dev/oss-exit-gate-prod/rn-make-payment--npm/:always-auth=true + EOF + npx --yes google-artifactregistry-auth --repo-config=.npmrc --credential-config="$HOME/.npmrc" + VERSION="$(jq -r .version package.json)" + npm publish --provenance=false --registry="https://us-npm.pkg.dev/oss-exit-gate-prod/rn-make-payment--npm/" + cat << EOF > manifest.json + { + "publish_all": false, + "publishing_groups": [ + { + "packages": [ + { + "name": "@google/react-native-make-payment", + "version": "${VERSION}" + } + ] + } + ] + } + EOF + gcloud storage cp manifest.json \ + "gs://oss-exit-gate-prod-projects-bucket/rn-make-payment/npm/manifests/manifest-${{ github.run_id }}-${{ github.run_attempt }}.json" From b046975121838e53494bd9ad537b934409d41206 Mon Sep 17 00:00:00 2001 From: alonsopf89 Date: Wed, 4 Nov 2026 11:34:37 -0800 Subject: [PATCH 2/4] ci: clean up stale releases from staging repo before publishing --- .github/workflows/publish.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 33f11e0..85754d7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,6 +32,25 @@ jobs: - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@e427ad8a34f8676edf47cf7d7925499adf3eb74f + - name: Clean up stale releases from staging repo + run: | + # clean up stale releases from staging repo + packages=$(gcloud artifacts packages list \ + --project="oss-exit-gate-prod" \ + --location="us" \ + --repository="rn-make-payment--npm" \ + --format="value(name)" 2>/dev/null) + + echo "${packages}" | xargs -r -I {} sh -c ' + package_name=$(basename "{}") + echo "Deleting package: $package_name..." + gcloud artifacts packages delete "{}" \ + --project="\'"oss-exit-gate-prod"\'" \ + --location="\'"us"\'" \ + --repository="\'rn-make-payment--npm\'" \ + --quiet + ' + - name: Build and stage @google/react-native-make-payment to OSS Exit Gate run: | yarn install --immutable || npm install From 978e4800198d098a4bc884a575e47ddafa1b7156 Mon Sep 17 00:00:00 2001 From: alonsopf89 Date: Wed, 4 Nov 2026 21:40:05 +0000 Subject: [PATCH 3/4] ci(release): fix quote syntax in stale release cleanup step --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 85754d7..2ffe305 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,9 +45,9 @@ jobs: package_name=$(basename "{}") echo "Deleting package: $package_name..." gcloud artifacts packages delete "{}" \ - --project="\'"oss-exit-gate-prod"\'" \ - --location="\'"us"\'" \ - --repository="\'rn-make-payment--npm\'" \ + --project=""oss-exit-gate-prod"" \ + --location=""us"" \ + --repository="rn-make-payment--npm" \ --quiet ' From cd9b6eb230194ea5b2ce06b685230cd3124d0c0c Mon Sep 17 00:00:00 2001 From: alonsopf89 Date: Wed, 4 Nov 2026 19:57:34 -0800 Subject: [PATCH 4/4] ci: fix quote syntax in staging repo cleanup step --- .github/workflows/publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2ffe305..008bbed 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -45,8 +45,8 @@ jobs: package_name=$(basename "{}") echo "Deleting package: $package_name..." gcloud artifacts packages delete "{}" \ - --project=""oss-exit-gate-prod"" \ - --location=""us"" \ + --project="oss-exit-gate-prod" \ + --location="us" \ --repository="rn-make-payment--npm" \ --quiet '