From 3fc61e9d7062a444a34f94c8b903c16caa91a18c Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 5 Feb 2026 14:26:24 +0100 Subject: [PATCH 1/2] ci: refactor Windows App SDK step --- .../actions/setup-windows-app-sdk/action.yml | 17 +++++++++++++++++ .github/workflows/build.yml | 16 ++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 .github/actions/setup-windows-app-sdk/action.yml diff --git a/.github/actions/setup-windows-app-sdk/action.yml b/.github/actions/setup-windows-app-sdk/action.yml new file mode 100644 index 000000000..4323dfd80 --- /dev/null +++ b/.github/actions/setup-windows-app-sdk/action.yml @@ -0,0 +1,17 @@ +name: Install Windows App SDK +description: Installs the Windows App SDK and restores NuGet packages for the Windows app +inputs: + solution: + description: Path to the solution file for the Windows app + working-directory: + description: Path to the working directory for this action +runs: + using: composite + steps: + - name: Install Windows App SDK + run: | + $script = node --print "require.resolve('react-native-windows/Scripts/rnw-dependencies.ps1')" + & $script -Install -NoPrompt -Enterprise + nuget restore ${{ inputs.solution }} + shell: powershell + working-directory: ${{ inputs.working-directory }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44b9dae60..58a4c3057 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -585,10 +585,10 @@ jobs: uses: ./.github/actions/affected - name: Install Windows App SDK if: ${{ steps.affected.outputs.windows != '' }} - run: | - ../node_modules/react-native-windows/Scripts/rnw-dependencies.ps1 -Install -NoPrompt -Enterprise - nuget restore Example.sln - working-directory: packages/app/example/windows + uses: ./.github/actions/setup-windows-app-sdk + with: + solution: Example.sln + working-directory: packages/app/example/windows - name: Build id: build if: ${{ steps.affected.outputs.windows != '' }} @@ -660,10 +660,10 @@ jobs: uses: ./.github/actions/affected - name: Install Windows App SDK if: ${{ steps.affected.outputs.windows != '' }} - run: | - ../node_modules/react-native-windows/Scripts/rnw-dependencies.ps1 -Install -NoPrompt -Enterprise - nuget restore TemplateExample.sln - working-directory: template-example/windows + uses: ./.github/actions/setup-windows-app-sdk + with: + solution: TemplateExample.sln + working-directory: template-example/windows - name: Build id: build if: ${{ steps.affected.outputs.windows != '' }} From c629b4fe33ab2cbb93f0b05a52373d80795eadd3 Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:22:32 +0100 Subject: [PATCH 2/2] use variable for WindowsTargetPlatformVersion --- .github/workflows/build.yml | 5 +++-- packages/app/scripts/testing/test-e2e.mts | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58a4c3057..a9980f84a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ env: HOMEBREW_NO_INSTALL_CLEANUP: 1 NODE_OPTIONS: "--disable-proto=delete" VisualStudioVersion: "17.0" + WindowsTargetPlatformVersion: "10.0.26100.0" concurrency: # Ensure single build of a pull request. `trunk` should not be affected. group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} @@ -574,7 +575,7 @@ jobs: yarn build:windows - name: Generate Visual Studio solution run: | - node ../windows/app.mjs --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0 + node ../windows/app.mjs --msbuildprops WindowsTargetPlatformVersion=$env:WindowsTargetPlatformVersion working-directory: packages/app/example - name: Test `react-native config` run: | @@ -653,7 +654,7 @@ jobs: working-directory: template-example - name: Generate Visual Studio solution run: | - yarn install-windows-test-app --msbuildprops WindowsTargetPlatformVersion=10.0.26100.0 + yarn install-windows-test-app --msbuildprops WindowsTargetPlatformVersion=$env:WindowsTargetPlatformVersion working-directory: template-example - name: Determine whether the Windows app needs to be built id: affected diff --git a/packages/app/scripts/testing/test-e2e.mts b/packages/app/scripts/testing/test-e2e.mts index 0645a66e0..e985241d5 100644 --- a/packages/app/scripts/testing/test-e2e.mts +++ b/packages/app/scripts/testing/test-e2e.mts @@ -22,7 +22,7 @@ export function $(command: string, ...args: string[]) { } /** - * Invokes a shell command with optional arguments. Similar {@link $}, but + * Invokes a shell command with optional arguments. Similar to {@link $}, but * captures and returns stdout/stderr. */ export function $$(command: string, ...args: string[]): string {