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..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: | @@ -585,10 +586,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 != '' }} @@ -653,17 +654,17 @@ 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 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 != '' }} 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 {