From 56bdc4a04972e63808e898c44de385500a273a5e Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Mon, 5 Dec 2022 15:33:32 +0100 Subject: [PATCH 1/2] Set Windows SDK Version --- .github/workflows/pr.yml | 9 +++++++++ .github/workflows/publish.yml | 9 +++++++++ .github/workflows/publish_preview.yml | 8 ++++++++ .github/workflows/windows.yml | 5 ++++- Package/gulpfile.js | 12 +++++++++++- 5 files changed, 41 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 9dd3eff8b..79294e981 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -3,6 +3,13 @@ on: pull_request: branches: - master + inputs: + windows-sdk-version: + description: 'Windows SDK Version' + required: true + type: string + default: 10.0.20348.0 + env: BRN_Version: 0.64 @@ -143,12 +150,14 @@ jobs: with: react-native-version: 0.65 release-version: 0.0.${GITHUB_SHA::8} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-windows-069: uses: ./.github/workflows/windows.yml with: react-native-version: 0.69 release-version: 0.0.${GITHUB_SHA::8} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-typescript: uses: ./.github/workflows/typescript.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 52938ef06..1e849abd5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,6 +2,12 @@ name: Publish Package on: release: types: [published] + inputs: + windows-sdk-version: + description: 'Windows SDK Version' + required: true + type: string + default: 10.0.20348.0 jobs: build-android-ios-064: @@ -27,18 +33,21 @@ jobs: with: react-native-version: 0.64 release-version: ${GITHUB_REF/refs\/tags\//} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-windows-065: uses: ./.github/workflows/windows.yml with: react-native-version: 0.65 release-version: ${GITHUB_REF/refs\/tags\//} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-windows-069: uses: ./.github/workflows/windows.yml with: react-native-version: 0.69 release-version: ${GITHUB_REF/refs\/tags\//} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-typescript: uses: ./.github/workflows/typescript.yml diff --git a/.github/workflows/publish_preview.yml b/.github/workflows/publish_preview.yml index 06486a7be..bcad0e6d6 100644 --- a/.github/workflows/publish_preview.yml +++ b/.github/workflows/publish_preview.yml @@ -12,6 +12,11 @@ on: required: true type: string default: preview + windows-sdk-version: + description: 'Windows SDK Version' + required: true + type: string + default: 10.0.20348.0 jobs: build-android-ios-064: @@ -37,18 +42,21 @@ jobs: with: react-native-version: 0.64 release-version: ${{ github.event.inputs.release_version }} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-windows-065: uses: ./.github/workflows/windows.yml with: react-native-version: 0.65 release-version: ${{ github.event.inputs.release_version }} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-windows-069: uses: ./.github/workflows/windows.yml with: react-native-version: 0.69 release-version: ${{ github.event.inputs.release_version }} + windows-sdk-version: ${{ github.event.inputs.windows-sdk-version }} build-typescript: uses: ./.github/workflows/typescript.yml diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 51b20b268..43b5de938 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -9,6 +9,9 @@ on: release-version: required: true type: string + windows-sdk-version: + required: true + type: string jobs: Build: @@ -37,7 +40,7 @@ jobs: run: npx gulp initializeSubmodulesWindowsAgent --reactNative ${{ inputs.react-native-version }} --releaseVersion ${{ inputs.release-version }} working-directory: ./Package - name: Gulp (Windows) - run: npx gulp buildUWPPublish + run: npx gulp buildUWPPublish -WindowsSDKVersion ${{ inputs.windows-sdk-version }} working-directory: ./Package - name: Upload Assembled-Windows Folder uses: actions/upload-artifact@v2 diff --git a/Package/gulpfile.js b/Package/gulpfile.js index 7440a0bd7..2fab5ffb0 100644 --- a/Package/gulpfile.js +++ b/Package/gulpfile.js @@ -124,7 +124,17 @@ const initializeSubmodulesMostRecentBabylonNative = async () => { const makeUWPProjectPlatform = async (name, arch) => { shelljs.mkdir('-p', `./../Modules/@babylonjs/react-native/Build/uwp_${name}`); - exec(`cmake -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 -DCMAKE_UNITY_BUILD=true -A ${arch} ./../../../react-native-windows/windows`, `./../Modules/@babylonjs/react-native/Build/uwp_${name}`); + + let WindowsSDKVersionCMakeString = ""; + const [WindowsSDKVersionFlag] = process.argv.slice(3); + if (WindowsSDKVersionFlag === '-WindowsSDKVersion') { + const [WindowsSDKVersionValue] = process.argv.slice(4); + if (WindowsSDKVersionValue) + { + WindowsSDKVersionCMakeString = `-DCMAKE_SYSTEM_VERSION=${WindowsSDKVersionValue}`; + } + } + exec(`cmake -D CMAKE_SYSTEM_NAME=WindowsStore -D CMAKE_SYSTEM_VERSION=10.0 -DCMAKE_UNITY_BUILD=true -A ${arch} ./../../../react-native-windows/windows ${WindowsSDKVersionCMakeString}`, `./../Modules/@babylonjs/react-native/Build/uwp_${name}`); }; const makeUWPProjectx86 = async () => makeUWPProjectPlatform('x86', 'Win32'); From 1f0c61381259ce03e0d830aecb513c0d80f60e1e Mon Sep 17 00:00:00 2001 From: Cedric Guillemet Date: Mon, 5 Dec 2022 15:37:06 +0100 Subject: [PATCH 2/2] script indentation --- .github/workflows/publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1e849abd5..4037ff723 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -2,12 +2,12 @@ name: Publish Package on: release: types: [published] - inputs: - windows-sdk-version: - description: 'Windows SDK Version' - required: true - type: string - default: 10.0.20348.0 + inputs: + windows-sdk-version: + description: 'Windows SDK Version' + required: true + type: string + default: 10.0.20348.0 jobs: build-android-ios-064: