From fd976b4025501f35645e1960fe2d03dd7dd9928c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Mon, 2 Nov 2026 03:45:01 -0800 Subject: [PATCH] Build the SwiftPM CI apps with RN_STRICT_API (#59225) Summary: Run `spm add` with `RN_STRICT_API=1` in the three SwiftPM CI jobs (RN-Tester, helloworld and the new-app flow), so the SwiftPM opt-in is exercised the way an app enables it. `spm add` records the choice in `.spm-injected.json` and defines `RN_STRICT_API` for the app target, the `spm.modules` packages (RN-Tester's sample native modules) and the app's codegen package. This depends on the C++ stable API guards being `textual header` members of the prebuilt `ReactNativeHeaders` module map. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D126331456 --- .github/workflows/test-ios-spm-helloworld.yml | 2 +- .github/workflows/test-ios-spm-newapp.yml | 2 +- .github/workflows/test-ios-spm-rntester.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-ios-spm-helloworld.yml b/.github/workflows/test-ios-spm-helloworld.yml index bf835a8f0fa3..75111b354057 100644 --- a/.github/workflows/test-ios-spm-helloworld.yml +++ b/.github/workflows/test-ios-spm-helloworld.yml @@ -85,7 +85,7 @@ jobs: - name: Convert the app to SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }} - run: npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip + run: RN_STRICT_API=1 npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip - name: Assert the app is on SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }} diff --git a/.github/workflows/test-ios-spm-newapp.yml b/.github/workflows/test-ios-spm-newapp.yml index 62e66395bae1..005c841ae20c 100644 --- a/.github/workflows/test-ios-spm-newapp.yml +++ b/.github/workflows/test-ios-spm-newapp.yml @@ -96,7 +96,7 @@ jobs: - name: Convert the app to SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }} - run: npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip + run: RN_STRICT_API=1 npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip - name: Assert the app is on SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }} diff --git a/.github/workflows/test-ios-spm-rntester.yml b/.github/workflows/test-ios-spm-rntester.yml index 60bfbf0d941e..f60df4a6a473 100644 --- a/.github/workflows/test-ios-spm-rntester.yml +++ b/.github/workflows/test-ios-spm-rntester.yml @@ -85,7 +85,7 @@ jobs: - name: Convert the app to SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }} - run: npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip + run: RN_STRICT_API=1 npx react-native spm add --deintegrate --artifacts /tmp/spm-artifacts --download skip - name: Assert the app is on SwiftPM shell: bash working-directory: ${{ env.APP_IOS_DIR }}