Skip to content

Commit 3fc61e9

Browse files
committed
ci: refactor Windows App SDK step
1 parent db7acbc commit 3fc61e9

2 files changed

Lines changed: 25 additions & 8 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Install Windows App SDK
2+
description: Installs the Windows App SDK and restores NuGet packages for the Windows app
3+
inputs:
4+
solution:
5+
description: Path to the solution file for the Windows app
6+
working-directory:
7+
description: Path to the working directory for this action
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Install Windows App SDK
12+
run: |
13+
$script = node --print "require.resolve('react-native-windows/Scripts/rnw-dependencies.ps1')"
14+
& $script -Install -NoPrompt -Enterprise
15+
nuget restore ${{ inputs.solution }}
16+
shell: powershell
17+
working-directory: ${{ inputs.working-directory }}

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -585,10 +585,10 @@ jobs:
585585
uses: ./.github/actions/affected
586586
- name: Install Windows App SDK
587587
if: ${{ steps.affected.outputs.windows != '' }}
588-
run: |
589-
../node_modules/react-native-windows/Scripts/rnw-dependencies.ps1 -Install -NoPrompt -Enterprise
590-
nuget restore Example.sln
591-
working-directory: packages/app/example/windows
588+
uses: ./.github/actions/setup-windows-app-sdk
589+
with:
590+
solution: Example.sln
591+
working-directory: packages/app/example/windows
592592
- name: Build
593593
id: build
594594
if: ${{ steps.affected.outputs.windows != '' }}
@@ -660,10 +660,10 @@ jobs:
660660
uses: ./.github/actions/affected
661661
- name: Install Windows App SDK
662662
if: ${{ steps.affected.outputs.windows != '' }}
663-
run: |
664-
../node_modules/react-native-windows/Scripts/rnw-dependencies.ps1 -Install -NoPrompt -Enterprise
665-
nuget restore TemplateExample.sln
666-
working-directory: template-example/windows
663+
uses: ./.github/actions/setup-windows-app-sdk
664+
with:
665+
solution: TemplateExample.sln
666+
working-directory: template-example/windows
667667
- name: Build
668668
id: build
669669
if: ${{ steps.affected.outputs.windows != '' }}

0 commit comments

Comments
 (0)