From 91955aa9c4d47f31f48ca1f86e25b42ffb14964b Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:02:51 -0700 Subject: [PATCH 01/17] Initial changes --- images/windows/base/Dockerfile | 4 +-- images/windows/editor/Dockerfile | 57 +++++++++++++++++++++----------- 2 files changed, 40 insertions(+), 21 deletions(-) diff --git a/images/windows/base/Dockerfile b/images/windows/base/Dockerfile index 9c57e485..9d0e55a8 100644 --- a/images/windows/base/Dockerfile +++ b/images/windows/base/Dockerfile @@ -1,5 +1,5 @@ -ARG windowsDllSourceImage="mcr.microsoft.com/windows:1809" -ARG windowsImage="mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019" +ARG windowsDllSourceImage="mcr.microsoft.com/windows/server:ltsc2022" +ARG windowsImage="mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022" # Need this image to grab missing dlls for the server core version FROM $windowsDllSourceImage as dll-source diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index 90dfa762..b49a48e6 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -7,28 +7,36 @@ ARG hubImage="unityci/hub:windows-latest" FROM $hubImage as Builder +# Packages/manifest.json could have git dependencies +RUN choco install git --no-progress -y + +SHELL ["cmd", "/S", "/C"] + +RUN setx path "C:\\Program Files\\Git\\bin;%path%" + +SHELL ["bash.exe", "-c"] + # Install Editor # The portion after the & is to change the exit code to 0 if we exited 1 from # the installation. Otherwise docker believes there was an error ARG version ARG changeSet -RUN powershell -Command "&'C:/Program Files/Unity Hub/Unity Hub.exe' '--%' '--no-sandbox --headless install \ - --version %version% --changeset %changeset%' 2>$null | \ - Tee-Object -FilePath 'C:\install-editor.log'; \ - if ((select-string -Path 'C:\install-editor.log' -Pattern \ - 'Failed to install|Error while installing an editor|Completed with errors') -ne $null) { exit 1 } \ - else { exit 0 }" - -ARG module -RUN IF NOT "%module%"=="base" ( \ - powershell -Command \ - "&'C:/Program Files/Unity Hub/Unity Hub.exe' '--%' '--no-sandbox --headless \ - install-modules --version %version% --module %module% --childModules' 2>$null | \ - Tee-Object -FilePath 'C:\install-module-%module%.log'; \ - if ((select-string -Path 'C:\install-module-%module%.log' -Pattern \ - 'Failed to install|Error while installing an editor|Completed with errors|Missing module|No modules found') -ne $null) \ - { exit 1 } else { exit 0 }" \ - ) +RUN "mkdir -p /var/log" +RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install \ + --version $version \ + --changeset $changeSet \ + | tee /var/log/install-editor.log \ + && grep 'Error' /var/log/install-editor.log \ + | exit $(wc -l)" + +# ARG module +RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install-modules \ + --version $version \ + --module $module \ + --childModules \ + | tee /var/log/install-module-${module}.log \ + && grep 'Missing module' /var/log/install-module-${module}.log \ + | exit $(wc -l); ############ # Editor # @@ -50,6 +58,10 @@ COPY --from=Builder C:/windows/system32/MSVCP100.dll \ ARG version RUN echo %version% > "C:/Program Files/Unity/Hub/Editor/%version%/version" +SHELL ["powershell.exe", "-Command"] + +RUN setx -M UNITY_PATH "C:/Program` Files/Unity/Hub/Editor/$Env:version" + # Need to enable these services to make Unity happy # When these were in base, things blew up, not sure why they have to be specifically here RUN powershell -Command foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupType Automatic"} @@ -57,5 +69,12 @@ RUN powershell -Command foreach ($service in 'nlasvc', 'netprofm') {"Set-Service # Not needed with the dotnet base image # RUN powershell -Command Set-Service 'wmiApSrv' -StartupType Automatic -# Packages/manifest.json could have git dependencies -RUN choco install git --no-progress -y +ADD SetupSDKManager.ps1 SetupAndroidPaths.ps1 ./ + +RUN powershell -Command .\SetupAndroidPaths.ps1 + +COPY ["licenses/", "C:/licenses/"] + +RUN powershell -Command .\SetupSDKManager.ps1 + +RUN rm *.ps1 From f43439d25eb0af2f6e9cc42f5261f78a3d783a74 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sat, 14 Oct 2023 18:11:18 -0700 Subject: [PATCH 02/17] Complete update to 2022. Improve module installation --- images/windows/editor/Dockerfile | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index b49a48e6..7c800eca 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -7,7 +7,7 @@ ARG hubImage="unityci/hub:windows-latest" FROM $hubImage as Builder -# Packages/manifest.json could have git dependencies +# Using bash to process unity install RUN choco install git --no-progress -y SHELL ["cmd", "/S", "/C"] @@ -29,14 +29,18 @@ RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install \ && grep 'Error' /var/log/install-editor.log \ | exit $(wc -l)" -# ARG module -RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install-modules \ +ARG module +RUN "if [ $module = 'base' ]; then \ + echo 'running default modules for this base OS'; \ + else \ + C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install-modules \ --version $version \ --module $module \ --childModules \ | tee /var/log/install-module-${module}.log \ && grep 'Missing module' /var/log/install-module-${module}.log \ - | exit $(wc -l); + | exit $(wc -l); \ + fi" ############ # Editor # @@ -62,19 +66,16 @@ SHELL ["powershell.exe", "-Command"] RUN setx -M UNITY_PATH "C:/Program` Files/Unity/Hub/Editor/$Env:version" +# Packages/manifest.json could have git dependencies +RUN choco install git --no-progress -y + +# Unity package manager throws an error about not being in a git directory when +# importing git packages without this +RUN git config --global --add safe.directory "*" + # Need to enable these services to make Unity happy # When these were in base, things blew up, not sure why they have to be specifically here -RUN powershell -Command foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupType Automatic"} +RUN foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupType Automatic"} # Not needed with the dotnet base image # RUN powershell -Command Set-Service 'wmiApSrv' -StartupType Automatic - -ADD SetupSDKManager.ps1 SetupAndroidPaths.ps1 ./ - -RUN powershell -Command .\SetupAndroidPaths.ps1 - -COPY ["licenses/", "C:/licenses/"] - -RUN powershell -Command .\SetupSDKManager.ps1 - -RUN rm *.ps1 From 91520e8f7c31cd49773eff71a21b49284e5ad054 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sat, 14 Oct 2023 18:14:57 -0700 Subject: [PATCH 03/17] Repo cleanup, switch to windows server 2022 --- .../new-windows-base-image-requested.yml | 12 +++++----- .../new-windows-hub-image-requested.yml | 13 +++++------ ...-windows-legacy-editor-image-requested.yml | 22 +++++++++---------- ...ows-post-2019-2-editor-image-requested.yml | 20 ++++++++--------- .../retry-windows-editor-image-requested.yml | 2 +- .github/workflows/test.yml | 16 +++++++------- images/windows/README.md | 3 --- images/windows/editor/Dockerfile | 2 +- 8 files changed, 43 insertions(+), 47 deletions(-) delete mode 100644 images/windows/README.md diff --git a/.github/workflows/new-windows-base-image-requested.yml b/.github/workflows/new-windows-base-image-requested.yml index 5d244ef1..c5b04382 100644 --- a/.github/workflows/new-windows-base-image-requested.yml +++ b/.github/workflows/new-windows-base-image-requested.yml @@ -8,17 +8,17 @@ on: workflow_dispatch: inputs: jobId: - description: 'Job ID' + description: "Job ID" required: true - default: 'dryRun' + default: "dryRun" repoVersionFull: - description: 'All digits of the latest tag of this repository, e.g. `1.23.45`' + description: "All digits of the latest tag of this repository, e.g. `1.23.45`" required: true repoVersionMinor: - description: 'Minor digit of that tag, e.g. `23`' + description: "Minor digit of that tag, e.g. `23`" required: true repoVersionMajor: - description: 'Major digit of that tag, e.g. `1`' + description: "Major digit of that tag, e.g. `1`" required: true # Further reading: @@ -29,7 +29,7 @@ on: jobs: build: name: "🛠 Build unityci/base" - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/new-windows-hub-image-requested.yml b/.github/workflows/new-windows-hub-image-requested.yml index 8c930383..5a5a8b99 100644 --- a/.github/workflows/new-windows-hub-image-requested.yml +++ b/.github/workflows/new-windows-hub-image-requested.yml @@ -8,17 +8,17 @@ on: workflow_dispatch: inputs: jobId: - description: 'Job ID' + description: "Job ID" required: true - default: 'dryRun' + default: "dryRun" repoVersionFull: - description: 'All digits of the latest tag of this repository, e.g. `1.23.45`' + description: "All digits of the latest tag of this repository, e.g. `1.23.45`" required: true repoVersionMinor: - description: 'Minor digit of that tag, e.g. `23`' + description: "Minor digit of that tag, e.g. `23`" required: true repoVersionMajor: - description: 'Major digit of that tag, e.g. `1`' + description: "Major digit of that tag, e.g. `1`" required: true # Further reading: @@ -29,7 +29,7 @@ on: jobs: build: name: "🛠 Build unityci/hub" - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout uses: actions/checkout@v3 @@ -112,7 +112,6 @@ jobs: # TODO: Cache layers, currently not supported on windows - ############################ # Pull previous images # ############################ diff --git a/.github/workflows/new-windows-legacy-editor-image-requested.yml b/.github/workflows/new-windows-legacy-editor-image-requested.yml index 61832076..1de50ec1 100644 --- a/.github/workflows/new-windows-legacy-editor-image-requested.yml +++ b/.github/workflows/new-windows-legacy-editor-image-requested.yml @@ -4,25 +4,25 @@ on: workflow_dispatch: inputs: jobId: - description: 'Job ID' + description: "Job ID" required: true - default: 'dryRun' + default: "dryRun" editorVersion: - description: 'Unity Editor Version' + description: "Unity Editor Version" required: true - default: '2020.3.24f1' + default: "2020.3.24f1" changeSet: - description: 'Unity Editor Changeset' + description: "Unity Editor Changeset" required: true - default: '79c78de19888' + default: "79c78de19888" repoVersionFull: - description: 'All digits of the latest tag of this repository, e.g. `1.23.45`' + description: "All digits of the latest tag of this repository, e.g. `1.23.45`" required: true repoVersionMinor: - description: 'Minor digit of that tag, e.g. `23`' + description: "Minor digit of that tag, e.g. `23`" required: true repoVersionMajor: - description: 'Major digit of that tag, e.g. `1`' + description: "Major digit of that tag, e.g. `1`" required: true # Further reading: @@ -33,7 +33,7 @@ on: jobs: buildImage: name: "🛠 Build unityci/editor (${{ matrix.targetPlatform }})" - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: @@ -54,7 +54,7 @@ jobs: LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) git checkout $LATEST_TAG shell: bash - + ################# # Variables # ################# diff --git a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml index 3caa9e01..caa2f9d1 100644 --- a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml +++ b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml @@ -7,25 +7,25 @@ on: workflow_dispatch: inputs: jobId: - description: 'Job ID' + description: "Job ID" required: true - default: 'dryRun' + default: "dryRun" editorVersion: - description: 'Unity Editor Version' + description: "Unity Editor Version" required: true - default: '2020.3.24f1' + default: "2020.3.24f1" changeSet: - description: 'Unity Editor Changeset' + description: "Unity Editor Changeset" required: true - default: '79c78de19888' + default: "79c78de19888" repoVersionFull: - description: 'All digits of the latest tag of this repository, e.g. `1.23.45`' + description: "All digits of the latest tag of this repository, e.g. `1.23.45`" required: true repoVersionMinor: - description: 'Minor digit of that tag, e.g. `23`' + description: "Minor digit of that tag, e.g. `23`" required: true repoVersionMajor: - description: 'Major digit of that tag, e.g. `1`' + description: "Major digit of that tag, e.g. `1`" required: true # Further reading: @@ -36,7 +36,7 @@ on: jobs: buildImage: name: "🛠 Build unityci/editor (${{ matrix.targetPlatform }})" - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: diff --git a/.github/workflows/retry-windows-editor-image-requested.yml b/.github/workflows/retry-windows-editor-image-requested.yml index 91d4b360..2be8ca65 100644 --- a/.github/workflows/retry-windows-editor-image-requested.yml +++ b/.github/workflows/retry-windows-editor-image-requested.yml @@ -13,7 +13,7 @@ on: jobs: buildImage: name: "🛠 Retry unityci/editor (${{ github.event.client_payload.targetPlatform }})" - runs-on: windows-2019 + runs-on: windows-2022 steps: - name: Checkout uses: actions/checkout@v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b7ba212f..75920936 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -70,7 +70,7 @@ jobs: editorVersion: ${{ matrix.editorVersion }} targetPlatform: ${{ matrix.targetPlatform }} # Failed specific - reason: 'no real reason' + reason: "no real reason" - name: Report publication uses: ./.github/workflows/actions/report-to-backend with: @@ -89,7 +89,7 @@ jobs: friendlyTag: ${{ matrix.editorVersion }}-${{ matrix.targetPlatform }}-${{ matrix.repoVersion }} specificTag: ${{ matrix.baseOs }}-${{ matrix.editorVersion }}-${{ matrix.targetPlatform }}-${{ matrix.repoVersion }} digest: sha256:ef872b67450a680fbeebe1b037190b8f8fbfb04088531f422873915520e26e0f; - + ########################## # Setup build matrix # ########################## @@ -110,7 +110,7 @@ jobs: # Exclude linux-il2cpp and windows-il2cpp for Unity 2019.2 or earlier EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2\")) | { version: ., module: \"linux-il2cpp\"} ]'`" - + # Unity 2021.1 and 2021.2 do not build properly on windows targets EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`" @@ -123,7 +123,7 @@ jobs: EXCLUDES=`echo "$EXCLUDES" | jq -s -c 'flatten'` echo "Excludes: $EXCLUDES" echo "excludes=$EXCLUDES" >> $GITHUB_OUTPUT - + ################################# # Build Ubuntu base and hub # ################################# @@ -173,7 +173,7 @@ jobs: ################################## windows-base-and-hub: name: Windows Base and Hub - runs-on: windows-2019 + runs-on: windows-2022 steps: ############# # Setup # @@ -189,7 +189,7 @@ jobs: - name: Build hub run: | docker build -t hub:windows-dev -f ./images/windows/hub/Dockerfile --build-arg baseImage=base:windows-dev . - + ################################################### # Save images for later steps in the workflow # ################################################### @@ -205,7 +205,7 @@ jobs: cd c:\artifact docker save -o windows-base-and-hub.tar base:windows-dev hub:windows-dev zstd -z -12 --format=zstd windows-base-and-hub.tar - + - uses: actions/upload-artifact@v3 with: name: windows-base-and-hub @@ -430,7 +430,7 @@ jobs: windows-editor: needs: [windows-base-and-hub, build-matrix] name: Windows (${{ matrix.version }}, ${{ matrix.module }}) - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: diff --git a/images/windows/README.md b/images/windows/README.md deleted file mode 100644 index c738f4e8..00000000 --- a/images/windows/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# Windows images - -See _#windows-images_ on our Discord server to follow our progress. diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index 7c800eca..f1a68f85 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -5,7 +5,7 @@ ARG hubImage="unityci/hub:windows-latest" # Builder # ############# -FROM $hubImage as Builder +FROM $hubImage AS Builder # Using bash to process unity install RUN choco install git --no-progress -y From 59095b8ee11f8ac81b6b88c109a4d2155772ae92 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Mon, 16 Oct 2023 00:12:19 -0700 Subject: [PATCH 04/17] Accept Android licenses --- .../windows/editor/AcceptAndroidLicenses.ps1 | 3 ++ images/windows/editor/Dockerfile | 11 +++++ images/windows/editor/SetupAndroid.ps1 | 42 +++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 images/windows/editor/AcceptAndroidLicenses.ps1 create mode 100644 images/windows/editor/SetupAndroid.ps1 diff --git a/images/windows/editor/AcceptAndroidLicenses.ps1 b/images/windows/editor/AcceptAndroidLicenses.ps1 new file mode 100644 index 00000000..c15c0ae1 --- /dev/null +++ b/images/windows/editor/AcceptAndroidLicenses.ps1 @@ -0,0 +1,3 @@ +# Accept Android Licenses +Set-Location $Env:ANDROID_CMDLINE_TOOLS/bin +bash -c "yes | ./sdkmanager.bat --licenses" diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index f1a68f85..45888f45 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -79,3 +79,14 @@ RUN foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupTy # Not needed with the dotnet base image # RUN powershell -Command Set-Service 'wmiApSrv' -StartupType Automatic + +ADD SetupAndroid.ps1 AcceptAndroidLicenses.ps1 ./ + +ARG module +RUN if ($Env:module -eq 'Android') { .\SetupAndroid.ps1 } + +# Accept Android Licenses. Needs to be separate from the above script to +# ensure the environment variables are set. +RUN if ($Env:module -eq 'Android') { .\AcceptAndroidLicenses.ps1 } + +RUN rm SetupAndroid.ps1, AcceptAndroidLicenses.ps1 diff --git a/images/windows/editor/SetupAndroid.ps1 b/images/windows/editor/SetupAndroid.ps1 new file mode 100644 index 00000000..e7f4f963 --- /dev/null +++ b/images/windows/editor/SetupAndroid.ps1 @@ -0,0 +1,42 @@ +function Get-Module-Destination-Path { + + param ( + $ModuleList, + $ModuleID + ) + $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) + $rawPath=$ModuleList[$index].destination + return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) +} + +function Get-Module-Renamed-Path { + + param ( + $ModuleList, + $ModuleID + ) + $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) + $rawPath=$ModuleList[$index].extractedPathRename.to + return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) +} + +# Read the modules.json file for the editor to figure out the proper paths dynamically +[void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") +$raw_modules = Get-Content "$Env:UNITY_PATH/modules.json" +$UNITY_MODULES_JSON = (New-Object -TypeName System.Web.Script.Serialization.JavaScriptSerializer -Property @{MaxJsonLength=67108864}).DeserializeObject($raw_modules) +$UNITY_MODULES_LIST = [Collections.Generic.List[Object]]($UNITY_MODULES_JSON) + +# Find our environment variables +$ANDROID_SDK_ROOT = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-sdk-platform-tools' +$ANDROID_NDK_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-ndk' +$JAVA_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-open-jdk' +$CMDLINE_TOOLS_PATH = Get-Module-Renamed-Path $UNITY_MODULES_LIST 'android-sdk-command-line-tools' + +# Set our environment variables +$newPath = "$JAVA_HOME/bin;$ANDROID_SDK_ROOT/tools;$CMDLINE_TOOLS_PATH/bin;$ANDROID_SDK_ROOT/platform-tools;$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin;C:/Program Files/Git/bin" +$oldPath = [Environment]::GetEnvironmentVariable('PATH', 'Machine'); +[Environment]::SetEnvironmentVariable('PATH', "$newPath;$oldPath",'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_HOME', $ANDROID_SDK_ROOT,'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', $ANDROID_NDK_HOME,'Machine'); +[Environment]::SetEnvironmentVariable('JAVA_HOME', $JAVA_HOME,'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', $CMDLINE_TOOLS_PATH,'Machine'); From c2e849cf07717db6b4cafc2d41062c70566f622d Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Mon, 16 Oct 2023 21:40:48 -0700 Subject: [PATCH 05/17] Ensure android images are built on windows --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 75920936..6f05cb45 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -441,6 +441,7 @@ jobs: - windows-il2cpp - universal-windows-platform - appletv + - android include: - module: base platform: StandaloneWindows64 @@ -450,6 +451,8 @@ jobs: platform: tvOS - module: universal-windows-platform platform: WSAPlayer + - module: android + platform: android exclude: ${{ fromJson(needs.build-matrix.outputs.excludes) }} steps: From 4e5c56c22dbb9a52490a826b6379b1a196124816 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Thu, 26 Oct 2023 09:13:36 -0700 Subject: [PATCH 06/17] Test with specific branch --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f05cb45..57b19850 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -549,7 +549,7 @@ jobs: # Only run if not a PR as we need access to secrets if: github.base_ref == '' timeout-minutes: 15 - uses: game-ci/unity-builder@main + uses: game-ci/unity-builder@feature/windows-upgrades env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} From 3cfbd7c9bb33c3e9d64f0dcbc0af0323ac771af0 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:54:33 -0700 Subject: [PATCH 07/17] Bump workflow versions. Fix platform name. Exclude windows mono builds --- .github/workflows/main.yml | 4 +-- .../new-ubuntu-base-image-requested.yml | 12 +++---- .../new-ubuntu-hub-image-requested.yml | 12 +++---- ...w-ubuntu-legacy-editor-image-requested.yml | 14 ++++----- ...ntu-post-2019-2-editor-image-requested.yml | 14 ++++----- .../new-windows-base-image-requested.yml | 2 +- .../new-windows-hub-image-requested.yml | 2 +- ...-windows-legacy-editor-image-requested.yml | 2 +- ...ows-post-2019-2-editor-image-requested.yml | 2 +- .../retry-ubuntu-editor-image-requested.yml | 12 +++---- .../retry-windows-editor-image-requested.yml | 2 +- .github/workflows/test.yml | 31 ++++++++++--------- 12 files changed, 56 insertions(+), 53 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6ace99e1..e86d2816 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Docs 📚 on: - push: { branches: [ main ] } + push: { branches: [main] } jobs: updateDescriptions: @@ -16,7 +16,7 @@ jobs: - editor steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Caveat - Currently we use the ubuntu readme as we do not have a catch-all readme (yet?) - run: | echo "SHORT_DESCRIPTION=$(cat ./images/ubuntu/${{ matrix.imageType }}/100-characters-dockerhub-description.txt)" >> $GITHUB_ENV diff --git a/.github/workflows/new-ubuntu-base-image-requested.yml b/.github/workflows/new-ubuntu-base-image-requested.yml index c8fcfa6b..78e9c08d 100644 --- a/.github/workflows/new-ubuntu-base-image-requested.yml +++ b/.github/workflows/new-ubuntu-base-image-requested.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -25,7 +25,7 @@ jobs: run: | LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) git checkout $LATEST_TAG - + ################# # Variables # ################# @@ -50,11 +50,11 @@ jobs: # Setup # ############# - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -81,7 +81,7 @@ jobs: # Base image # ################## - name: Build and publish - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build_ubuntu_base_image with: file: ./images/ubuntu/base/Dockerfile diff --git a/.github/workflows/new-ubuntu-hub-image-requested.yml b/.github/workflows/new-ubuntu-hub-image-requested.yml index 47654a4d..8caab97b 100644 --- a/.github/workflows/new-ubuntu-hub-image-requested.yml +++ b/.github/workflows/new-ubuntu-hub-image-requested.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -25,7 +25,7 @@ jobs: run: | LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) git checkout $LATEST_TAG - + ################# # Variables # ################# @@ -50,11 +50,11 @@ jobs: # Setup # ############# - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -86,7 +86,7 @@ jobs: # Hub image # ################# - name: Build and publish - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build_ubuntu_hub_image with: file: ./images/ubuntu/hub/Dockerfile diff --git a/.github/workflows/new-ubuntu-legacy-editor-image-requested.yml b/.github/workflows/new-ubuntu-legacy-editor-image-requested.yml index 3c61ff4c..f75ccf1e 100644 --- a/.github/workflows/new-ubuntu-legacy-editor-image-requested.yml +++ b/.github/workflows/new-ubuntu-legacy-editor-image-requested.yml @@ -27,7 +27,7 @@ jobs: - webgl steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -35,7 +35,7 @@ jobs: run: | LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) git checkout $LATEST_TAG - + ################# # Variables # ################# @@ -64,11 +64,11 @@ jobs: # Setup # ############# - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -99,7 +99,7 @@ jobs: # Ubuntu Editor image # ########################### - name: Build and publish - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build_ubuntu_editor_image continue-on-error: true with: @@ -126,7 +126,7 @@ jobs: # Retry the above # ####################### - name: Build and publish (retry) - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 if: steps.build_ubuntu_editor_image.outcome=='failure' id: build_ubuntu_editor_image_retry with: diff --git a/.github/workflows/new-ubuntu-post-2019-2-editor-image-requested.yml b/.github/workflows/new-ubuntu-post-2019-2-editor-image-requested.yml index ac12655f..045b15f8 100644 --- a/.github/workflows/new-ubuntu-post-2019-2-editor-image-requested.yml +++ b/.github/workflows/new-ubuntu-post-2019-2-editor-image-requested.yml @@ -27,7 +27,7 @@ jobs: - webgl steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -35,7 +35,7 @@ jobs: run: | LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) git checkout $LATEST_TAG - + ################# # Variables # ################# @@ -64,11 +64,11 @@ jobs: # Setup # ############# - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -99,7 +99,7 @@ jobs: # Ubuntu Editor image # ########################### - name: Build and publish - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build_ubuntu_editor_image continue-on-error: true with: @@ -126,7 +126,7 @@ jobs: # Retry the above # ####################### - name: Build and publish (retry) - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 if: steps.build_ubuntu_editor_image.outcome=='failure' id: build_ubuntu_editor_image_retry with: diff --git a/.github/workflows/new-windows-base-image-requested.yml b/.github/workflows/new-windows-base-image-requested.yml index c5b04382..c100cf06 100644 --- a/.github/workflows/new-windows-base-image-requested.yml +++ b/.github/workflows/new-windows-base-image-requested.yml @@ -32,7 +32,7 @@ jobs: runs-on: windows-2022 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/new-windows-hub-image-requested.yml b/.github/workflows/new-windows-hub-image-requested.yml index 5a5a8b99..a3506885 100644 --- a/.github/workflows/new-windows-hub-image-requested.yml +++ b/.github/workflows/new-windows-hub-image-requested.yml @@ -32,7 +32,7 @@ jobs: runs-on: windows-2022 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/new-windows-legacy-editor-image-requested.yml b/.github/workflows/new-windows-legacy-editor-image-requested.yml index 1de50ec1..d7e7e0ff 100644 --- a/.github/workflows/new-windows-legacy-editor-image-requested.yml +++ b/.github/workflows/new-windows-legacy-editor-image-requested.yml @@ -45,7 +45,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml index caa2f9d1..e131e46c 100644 --- a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml +++ b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml @@ -49,7 +49,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/.github/workflows/retry-ubuntu-editor-image-requested.yml b/.github/workflows/retry-ubuntu-editor-image-requested.yml index 8c3ca5b7..4f000fbf 100644 --- a/.github/workflows/retry-ubuntu-editor-image-requested.yml +++ b/.github/workflows/retry-ubuntu-editor-image-requested.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ################# # Variables # ################# @@ -46,11 +46,11 @@ jobs: # Setup # ############# - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -81,7 +81,7 @@ jobs: # Editor image # #################### - name: Build and publish - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build_ubuntu_editor_image continue-on-error: true with: @@ -107,7 +107,7 @@ jobs: # Retry the above # ####################### - name: Build and publish (retry) - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 if: steps.build_ubuntu_editor_image.outcome=='failure' id: build_ubuntu_editor_image_retry with: diff --git a/.github/workflows/retry-windows-editor-image-requested.yml b/.github/workflows/retry-windows-editor-image-requested.yml index 2be8ca65..1d41a60f 100644 --- a/.github/workflows/retry-windows-editor-image-requested.yml +++ b/.github/workflows/retry-windows-editor-image-requested.yml @@ -16,7 +16,7 @@ jobs: runs-on: windows-2022 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 ################# # Variables # ################# diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 57b19850..127e2d64 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,7 +44,7 @@ jobs: targetPlatform: android steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Report new build uses: ./.github/workflows/actions/report-to-backend with: @@ -120,6 +120,9 @@ jobs: # AppleTV isn't stable until 2019.2 EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`" + # No Windows Mono Builds + EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`" + EXCLUDES=`echo "$EXCLUDES" | jq -s -c 'flatten'` echo "Excludes: $EXCLUDES" echo "excludes=$EXCLUDES" >> $GITHUB_OUTPUT @@ -134,9 +137,9 @@ jobs: ############# # Setup # ############# - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 with: driver: docker @@ -144,12 +147,12 @@ jobs: # Build Ubuntu base and hub # ################################# - name: Build base - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: ./images/ubuntu/base/Dockerfile tags: base:ubuntu-dev - name: Build hub - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: file: ./images/ubuntu/hub/Dockerfile build-args: baseImage=base:ubuntu-dev @@ -178,7 +181,7 @@ jobs: ############# # Setup # ############# - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 ################################## # Build Windows base and hub # @@ -257,9 +260,9 @@ jobs: ############# # Setup # ############# - - uses: actions/checkout@v3 - - uses: docker/setup-qemu-action@v2 - - uses: docker/setup-buildx-action@v2 + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 with: driver: docker - name: Free disk space @@ -297,7 +300,7 @@ jobs: ########################### - name: Build # if: steps.build-1.outcome == 'failure' - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build-1 continue-on-error: true timeout-minutes: 40 @@ -320,7 +323,7 @@ jobs: - name: Build (Retry) if: steps.build-1.outcome == 'failure' - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 id: build-2 # continue-on-error: true timeout-minutes: 40 @@ -452,14 +455,14 @@ jobs: - module: universal-windows-platform platform: WSAPlayer - module: android - platform: android + platform: Android exclude: ${{ fromJson(needs.build-matrix.outputs.excludes) }} steps: ############# # Setup # ############# - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 ############################ # Restore base and hub # From b6e7cc16c547bd0af35e8cad7a25b8c2aeea7b55 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Thu, 26 Oct 2023 13:09:22 -0700 Subject: [PATCH 08/17] Fix base builds --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 127e2d64..62ec2b19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,7 +121,7 @@ jobs: EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`" # No Windows Mono Builds - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`" + EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"base\"} ]'`" EXCLUDES=`echo "$EXCLUDES" | jq -s -c 'flatten'` echo "Excludes: $EXCLUDES" From 3f605e1e06ba3a96da49a2f92dfddf0a3de6d160 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Thu, 26 Oct 2023 19:43:46 -0700 Subject: [PATCH 09/17] Fix incorrect excludes --- .github/workflows/test.yml | 38 ++++++++++++++++++++++---------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 62ec2b19..8137dec3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -98,7 +98,8 @@ jobs: runs-on: ubuntu-latest outputs: versions: ${{ steps.setup.outputs.versions }} - excludes: ${{ steps.setup.outputs.excludes }} + linuxExcludes: ${{ steps.setup.outputs.linuxExcludes }} + windowsExcludes: ${{ steps.setup.outputs.windowsExcludes }} steps: - name: "Setup build matrix" id: setup @@ -108,24 +109,29 @@ jobs: echo "Versions: $VERSIONS" echo "versions=$VERSIONS" >> $GITHUB_OUTPUT - # Exclude linux-il2cpp and windows-il2cpp for Unity 2019.2 or earlier - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2\")) | { version: ., module: \"linux-il2cpp\"} ]'`" + # Exclude il2cpp for Unity 2019.2 or earlier + LINUX_EXCLUDES="$LINUX_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2\")) | { version: ., module: \"linux-il2cpp\"} ]'`" - # Unity 2021.1 and 2021.2 do not build properly on windows targets - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`" + # Exclude il2cpp for Unity 2019.2 or earlier. Unity 2021.1 and 2021.2 also do not build properly and will be skipped + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`" - # Universal Windows Platform is added in 2019 - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"universal-windows-platform\"} ]'`" + # Universal Windows Platform is added in 2019. Issues with 2021.1 and 2021.2 so they are skipped too + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"universal-windows-platform\"} ]'`" - # AppleTV isn't stable until 2019.2 - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`" + # AppleTV isn't stable until 2019.2. Issues with 2021.1 and 2021.2 so they are skipped too + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`" - # No Windows Mono Builds - EXCLUDES="$EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"base\"} ]'`" + # No Windows 2018 Android Builds + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018\")) | { version: ., module: \"android\"} ]'`" - EXCLUDES=`echo "$EXCLUDES" | jq -s -c 'flatten'` - echo "Excludes: $EXCLUDES" - echo "excludes=$EXCLUDES" >> $GITHUB_OUTPUT + LINUX_EXCLUDES=`echo "$LINUX_EXCLUDES" | jq -s -c 'flatten'` + WINDOWS_EXCLUDES=`echo "$WINDOWS_EXCLUDES" | jq -s -c 'flatten'` + + echo "Linux Excludes: $LINUX_EXCLUDES" + echo "Windows Excludes: $WINDOWS_EXCLUDES" + + echo "linuxExcludes=$LINUX_EXCLUDES" >> $GITHUB_OUTPUT + echo "windowsExcludes=$WINDOWS_EXCLUDES" >> $GITHUB_OUTPUT ################################# # Build Ubuntu base and hub # @@ -254,7 +260,7 @@ jobs: platform: Android - module: webgl platform: WebGL - exclude: ${{ fromJson(needs.build-matrix.outputs.excludes) }} + exclude: ${{ fromJson(needs.build-matrix.outputs.linuxExcludes) }} steps: ############# @@ -456,7 +462,7 @@ jobs: platform: WSAPlayer - module: android platform: Android - exclude: ${{ fromJson(needs.build-matrix.outputs.excludes) }} + exclude: ${{ fromJson(needs.build-matrix.outputs.windowsExcludes) }} steps: ############# From b7b1db943adf334a1b6030836e45dc12161c1270 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Thu, 26 Oct 2023 20:49:37 -0700 Subject: [PATCH 10/17] Skip 2021.1/2 for android --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8137dec3..ce77d177 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -121,8 +121,8 @@ jobs: # AppleTV isn't stable until 2019.2. Issues with 2021.1 and 2021.2 so they are skipped too WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`" - # No Windows 2018 Android Builds - WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018\")) | { version: ., module: \"android\"} ]'`" + # No Windows 2018 Android Builds. Issues with 2021.1 and 2021.2 so they are skipped too + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2021.1|2021.2\")) | { version: ., module: \"android\"} ]'`" LINUX_EXCLUDES=`echo "$LINUX_EXCLUDES" | jq -s -c 'flatten'` WINDOWS_EXCLUDES=`echo "$WINDOWS_EXCLUDES" | jq -s -c 'flatten'` From 1dd33a425db1c344857cc01d935e499175dea785 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Fri, 27 Oct 2023 01:39:27 -0700 Subject: [PATCH 11/17] Skip invalid combinations --- .github/workflows/test.yml | 3 +++ images/windows/base/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ce77d177..3a7fbbba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -124,6 +124,9 @@ jobs: # No Windows 2018 Android Builds. Issues with 2021.1 and 2021.2 so they are skipped too WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2021.1|2021.2\")) | { version: ., module: \"android\"} ]'`" + # No Windows mono Builds for Unity 2019.2 or earlier. Issues with 2021.1 and 2021.2 so they are skipped too + WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"base\"} ]'`" + LINUX_EXCLUDES=`echo "$LINUX_EXCLUDES" | jq -s -c 'flatten'` WINDOWS_EXCLUDES=`echo "$WINDOWS_EXCLUDES" | jq -s -c 'flatten'` diff --git a/images/windows/base/Dockerfile b/images/windows/base/Dockerfile index 9d0e55a8..7feddb44 100644 --- a/images/windows/base/Dockerfile +++ b/images/windows/base/Dockerfile @@ -2,7 +2,7 @@ ARG windowsDllSourceImage="mcr.microsoft.com/windows/server:ltsc2022" ARG windowsImage="mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2022" # Need this image to grab missing dlls for the server core version -FROM $windowsDllSourceImage as dll-source +FROM $windowsDllSourceImage AS dll-source # We use the .net framework servercore image because we will need the .net support # anyway and there is no real benefit to try and make this smaller by From 448124387409e2dc5a53005965b11e4a09e00431 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:02:27 -0700 Subject: [PATCH 12/17] Ensure android is built when new images are requested. Revert test.yml to use unity-builder main --- .github/workflows/new-windows-legacy-editor-image-requested.yml | 1 + .../new-windows-post-2019-2-editor-image-requested.yml | 1 + .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/new-windows-legacy-editor-image-requested.yml b/.github/workflows/new-windows-legacy-editor-image-requested.yml index d7e7e0ff..a78f88f8 100644 --- a/.github/workflows/new-windows-legacy-editor-image-requested.yml +++ b/.github/workflows/new-windows-legacy-editor-image-requested.yml @@ -39,6 +39,7 @@ jobs: matrix: targetPlatform: - base + - android # - windows-il2cpp # - universal-windows-platform # - appletv diff --git a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml index e131e46c..d62cab6c 100644 --- a/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml +++ b/.github/workflows/new-windows-post-2019-2-editor-image-requested.yml @@ -45,6 +45,7 @@ jobs: - windows-il2cpp - universal-windows-platform - appletv + - android # - lumin # TODO: Determine if we can build for lumin. Requires 3rd party SDK with several versions steps: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a7fbbba..fa19034e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -561,7 +561,7 @@ jobs: # Only run if not a PR as we need access to secrets if: github.base_ref == '' timeout-minutes: 15 - uses: game-ci/unity-builder@feature/windows-upgrades + uses: game-ci/unity-builder@main env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} From 8265782c48578f3f9a2b38350018af9bbfd22db9 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:36:15 -0700 Subject: [PATCH 13/17] Don't build android on legacy windows --- .../workflows/new-windows-legacy-editor-image-requested.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/new-windows-legacy-editor-image-requested.yml b/.github/workflows/new-windows-legacy-editor-image-requested.yml index a78f88f8..f93a2aa7 100644 --- a/.github/workflows/new-windows-legacy-editor-image-requested.yml +++ b/.github/workflows/new-windows-legacy-editor-image-requested.yml @@ -39,10 +39,6 @@ jobs: matrix: targetPlatform: - base - - android - # - windows-il2cpp - # - universal-windows-platform - # - appletv steps: - name: Checkout From 388f8b5939cf207fac1dad3e382edeb0d9739048 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sat, 28 Oct 2023 16:54:48 -0700 Subject: [PATCH 14/17] Fix android cmdline tools path for older versions of unity --- images/windows/editor/SetupAndroid.ps1 | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/images/windows/editor/SetupAndroid.ps1 b/images/windows/editor/SetupAndroid.ps1 index e7f4f963..c61e08e6 100644 --- a/images/windows/editor/SetupAndroid.ps1 +++ b/images/windows/editor/SetupAndroid.ps1 @@ -20,6 +20,16 @@ function Get-Module-Renamed-Path { return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) } +function Module-Exists { + + param ( + $ModuleList, + $ModuleID + ) + $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) + return $index -ne -1 +} + # Read the modules.json file for the editor to figure out the proper paths dynamically [void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") $raw_modules = Get-Content "$Env:UNITY_PATH/modules.json" @@ -30,13 +40,21 @@ $UNITY_MODULES_LIST = [Collections.Generic.List[Object]]($UNITY_MODULES_JSON) $ANDROID_SDK_ROOT = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-sdk-platform-tools' $ANDROID_NDK_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-ndk' $JAVA_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-open-jdk' -$CMDLINE_TOOLS_PATH = Get-Module-Renamed-Path $UNITY_MODULES_LIST 'android-sdk-command-line-tools' + +if (Module-Exists $UNITY_MODULES_LIST 'android-sdk-command-line-tools') +{ + $TOOLS_PATH = Get-Module-Renamed-Path $UNITY_MODULES_LIST 'android-sdk-command-line-tools' +} +else +{ + $TOOLS_PATH = "$ANDROID_SDK_ROOT/tools" +} # Set our environment variables -$newPath = "$JAVA_HOME/bin;$ANDROID_SDK_ROOT/tools;$CMDLINE_TOOLS_PATH/bin;$ANDROID_SDK_ROOT/platform-tools;$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin;C:/Program Files/Git/bin" +$newPath = "$JAVA_HOME/bin;$ANDROID_SDK_ROOT/tools;$TOOLS_PATH/bin;$ANDROID_SDK_ROOT/platform-tools;$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin;C:/Program Files/Git/bin" $oldPath = [Environment]::GetEnvironmentVariable('PATH', 'Machine'); [Environment]::SetEnvironmentVariable('PATH', "$newPath;$oldPath",'Machine'); [Environment]::SetEnvironmentVariable('ANDROID_HOME', $ANDROID_SDK_ROOT,'Machine'); [Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', $ANDROID_NDK_HOME,'Machine'); [Environment]::SetEnvironmentVariable('JAVA_HOME', $JAVA_HOME,'Machine'); -[Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', $CMDLINE_TOOLS_PATH,'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', $TOOLS_PATH,'Machine'); From 9faa9dfcad8275ba93875b74f963c82f4799757b Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sat, 28 Oct 2023 20:54:25 -0700 Subject: [PATCH 15/17] Fix various warnings. Ensure powershell will quit on error --- images/windows/editor/Dockerfile | 6 +++--- images/windows/editor/SetupAndroid.ps1 | 21 +++++++++++++-------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index 45888f45..f560a296 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -75,7 +75,7 @@ RUN git config --global --add safe.directory "*" # Need to enable these services to make Unity happy # When these were in base, things blew up, not sure why they have to be specifically here -RUN foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupType Automatic"} +RUN foreach ("$service" in 'nlasvc', 'netprofm') {"Set-Service $service -StartupType Automatic"} # Not needed with the dotnet base image # RUN powershell -Command Set-Service 'wmiApSrv' -StartupType Automatic @@ -83,10 +83,10 @@ RUN foreach ($service in 'nlasvc', 'netprofm') {"Set-Service $service -StartupTy ADD SetupAndroid.ps1 AcceptAndroidLicenses.ps1 ./ ARG module -RUN if ($Env:module -eq 'Android') { .\SetupAndroid.ps1 } +RUN if ("$Env:module" -eq 'Android') { .\SetupAndroid.ps1 } # Accept Android Licenses. Needs to be separate from the above script to # ensure the environment variables are set. -RUN if ($Env:module -eq 'Android') { .\AcceptAndroidLicenses.ps1 } +RUN if ("$Env:module" -eq 'Android') { .\AcceptAndroidLicenses.ps1 } RUN rm SetupAndroid.ps1, AcceptAndroidLicenses.ps1 diff --git a/images/windows/editor/SetupAndroid.ps1 b/images/windows/editor/SetupAndroid.ps1 index c61e08e6..d221fa81 100644 --- a/images/windows/editor/SetupAndroid.ps1 +++ b/images/windows/editor/SetupAndroid.ps1 @@ -1,4 +1,6 @@ -function Get-Module-Destination-Path { +$ErrorActionPreference = "Stop" + +function Get-ModuleDestinationPath { param ( $ModuleList, @@ -9,7 +11,7 @@ function Get-Module-Destination-Path { return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) } -function Get-Module-Renamed-Path { +function Get-ModuleRenamedPath { param ( $ModuleList, @@ -20,7 +22,7 @@ function Get-Module-Renamed-Path { return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) } -function Module-Exists { +function Find-Module { param ( $ModuleList, @@ -37,13 +39,13 @@ $UNITY_MODULES_JSON = (New-Object -TypeName System.Web.Script.Serialization.Java $UNITY_MODULES_LIST = [Collections.Generic.List[Object]]($UNITY_MODULES_JSON) # Find our environment variables -$ANDROID_SDK_ROOT = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-sdk-platform-tools' -$ANDROID_NDK_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-ndk' -$JAVA_HOME = Get-Module-Destination-Path $UNITY_MODULES_LIST 'android-open-jdk' +$ANDROID_SDK_ROOT = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-sdk-platform-tools' +$ANDROID_NDK_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-ndk' +$JAVA_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-open-jdk' -if (Module-Exists $UNITY_MODULES_LIST 'android-sdk-command-line-tools') +if (Find-Module $UNITY_MODULES_LIST 'android-sdk-command-line-tools') { - $TOOLS_PATH = Get-Module-Renamed-Path $UNITY_MODULES_LIST 'android-sdk-command-line-tools' + $TOOLS_PATH = Get-ModuleRenamedPath $UNITY_MODULES_LIST 'android-sdk-command-line-tools' } else { @@ -58,3 +60,6 @@ $oldPath = [Environment]::GetEnvironmentVariable('PATH', 'Machine'); [Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', $ANDROID_NDK_HOME,'Machine'); [Environment]::SetEnvironmentVariable('JAVA_HOME', $JAVA_HOME,'Machine'); [Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', $TOOLS_PATH,'Machine'); + +# Unity seems to always look for this file and can't find it so we manually create an empty one +New-Item -ItemType file -Path "$Env:USERPROFILE/.android/repositories.cfg" -Force From 39854477a6c001eb1b7b6871b28eab7f58c16c1c Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sun, 29 Oct 2023 02:27:41 -0700 Subject: [PATCH 16/17] Move editor path to fix 2021 issues caused by a space in the install path. Increase build timeout in pr tests for windows images. Script cleanup. Better error detection and handling. Use unity-builder test branch for verification --- .github/workflows/test.yml | 6 +- .../windows/editor/AcceptAndroidLicenses.ps1 | 3 - images/windows/editor/Dockerfile | 24 ++++---- .../editor/scripts/AcceptAndroidLicenses.ps1 | 8 +++ .../editor/scripts/HelperFunctions.ps1 | 57 +++++++++++++++++++ .../editor/{ => scripts}/SetupAndroid.ps1 | 51 ++++------------- 6 files changed, 93 insertions(+), 56 deletions(-) delete mode 100644 images/windows/editor/AcceptAndroidLicenses.ps1 create mode 100644 images/windows/editor/scripts/AcceptAndroidLicenses.ps1 create mode 100644 images/windows/editor/scripts/HelperFunctions.ps1 rename images/windows/editor/{ => scripts}/SetupAndroid.ps1 (50%) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa19034e..cb48c9bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -513,7 +513,7 @@ jobs: ########################### - name: Build continue-on-error: true - timeout-minutes: 60 + timeout-minutes: 90 id: build-1 run: | docker build -t editor:windows-dev --build-arg baseImage=base:windows-dev ` @@ -530,7 +530,7 @@ jobs: - name: Build (Retry) if: steps.build-1.outcome == 'failure' id: build-2 - timeout-minutes: 60 + timeout-minutes: 90 run: | docker build -t editor:windows-dev --build-arg baseImage=base:windows-dev ` --build-arg hubImage=hub:windows-dev --build-arg version=${{ matrix.version }} ` @@ -561,7 +561,7 @@ jobs: # Only run if not a PR as we need access to secrets if: github.base_ref == '' timeout-minutes: 15 - uses: game-ci/unity-builder@main + uses: game-ci/unity-builder@windows-image-updates env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} diff --git a/images/windows/editor/AcceptAndroidLicenses.ps1 b/images/windows/editor/AcceptAndroidLicenses.ps1 deleted file mode 100644 index c15c0ae1..00000000 --- a/images/windows/editor/AcceptAndroidLicenses.ps1 +++ /dev/null @@ -1,3 +0,0 @@ -# Accept Android Licenses -Set-Location $Env:ANDROID_CMDLINE_TOOLS/bin -bash -c "yes | ./sdkmanager.bat --licenses" diff --git a/images/windows/editor/Dockerfile b/images/windows/editor/Dockerfile index f560a296..b7a46902 100644 --- a/images/windows/editor/Dockerfile +++ b/images/windows/editor/Dockerfile @@ -21,7 +21,11 @@ SHELL ["bash.exe", "-c"] # the installation. Otherwise docker believes there was an error ARG version ARG changeSet -RUN "mkdir -p /var/log" + +RUN "mkdir -p /var/log && mkdir -p C:/UnityEditor" + +RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install-path --set C:/UnityEditor" + RUN "C:/Program\ Files/Unity\ Hub/Unity\ Hub.exe -- --headless install \ --version $version \ --changeset $changeSet \ @@ -48,8 +52,10 @@ RUN "if [ $module = 'base' ]; then \ FROM $baseImage +SHELL ["powershell.exe", "-Command"] + # Copy the editor from the builder to the final editor image -COPY --from=Builder ["C:/Program Files/Unity/Hub/Editor/", "C:/Program Files/Unity/Hub/Editor/"] +COPY --from=Builder ["C:/UnityEditor/", "C:/UnityEditor/"] # Need to grab these dependencies that the editor needs to run COPY --from=Builder C:/windows/system32/MSVCP100.dll \ @@ -60,11 +66,9 @@ COPY --from=Builder C:/windows/system32/MSVCP100.dll \ # Add version to file at editor path ARG version -RUN echo %version% > "C:/Program Files/Unity/Hub/Editor/%version%/version" - -SHELL ["powershell.exe", "-Command"] +RUN echo "$Env:version" > "C:/UnityEditor/$Env:version/version" -RUN setx -M UNITY_PATH "C:/Program` Files/Unity/Hub/Editor/$Env:version" +RUN setx -M UNITY_PATH "C:/UnityEditor/$Env:version" # Packages/manifest.json could have git dependencies RUN choco install git --no-progress -y @@ -80,13 +84,13 @@ RUN foreach ("$service" in 'nlasvc', 'netprofm') {"Set-Service $service -Startup # Not needed with the dotnet base image # RUN powershell -Command Set-Service 'wmiApSrv' -StartupType Automatic -ADD SetupAndroid.ps1 AcceptAndroidLicenses.ps1 ./ +ADD scripts ./scripts ARG module -RUN if ("$Env:module" -eq 'Android') { .\SetupAndroid.ps1 } +RUN if ("$Env:module" -eq 'Android') { .\scripts\SetupAndroid.ps1 } # Accept Android Licenses. Needs to be separate from the above script to # ensure the environment variables are set. -RUN if ("$Env:module" -eq 'Android') { .\AcceptAndroidLicenses.ps1 } +RUN if ("$Env:module" -eq 'Android') { .\scripts\AcceptAndroidLicenses.ps1 } -RUN rm SetupAndroid.ps1, AcceptAndroidLicenses.ps1 +RUN Remove-Item .\scripts -Recurse -Force diff --git a/images/windows/editor/scripts/AcceptAndroidLicenses.ps1 b/images/windows/editor/scripts/AcceptAndroidLicenses.ps1 new file mode 100644 index 00000000..4406373b --- /dev/null +++ b/images/windows/editor/scripts/AcceptAndroidLicenses.ps1 @@ -0,0 +1,8 @@ +$ErrorActionPreference = "Stop" + +. scripts/HelperFunctions.ps1 + +# Accept Android Licenses +Set-Location "$Env:ANDROID_CMDLINE_TOOLS/bin" +bash -c "yes | ./sdkmanager.bat --licenses" +CheckLastExitCode diff --git a/images/windows/editor/scripts/HelperFunctions.ps1 b/images/windows/editor/scripts/HelperFunctions.ps1 new file mode 100644 index 00000000..eee111df --- /dev/null +++ b/images/windows/editor/scripts/HelperFunctions.ps1 @@ -0,0 +1,57 @@ +######################## +# General Helpers # +######################## + +function CheckLastExitCode { + param ([int[]]$SuccessCodes = @(0), [scriptblock]$CleanupScript=$null) + + if ($SuccessCodes -notcontains $LastExitCode) { + if ($CleanupScript) { + "Executing cleanup script: $CleanupScript" + &$CleanupScript + } + $msg = @" +EXE RETURNED EXIT CODE $LastExitCode +CALLSTACK:$(Get-PSCallStack | Out-String) +"@ + throw $msg + } +} + +######################## +# Unity Module Helpers # +######################## + +function Get-ModuleDestinationPath { + + param ( + $ModuleList, + $ModuleID, + $UnityPath + ) + $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) + $rawPath=$ModuleList[$index].destination + return $rawPath.Replace('{UNITY_PATH}', $UnityPath) +} + +function Get-ModuleRenamedPath { + +param ( + $ModuleList, + $ModuleID, + $UnityPath +) +$index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) +$rawPath=$ModuleList[$index].extractedPathRename.to +return $rawPath.Replace('{UNITY_PATH}', $UnityPath) +} + +function Find-Module { + + param ( + $ModuleList, + $ModuleID + ) + $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) + return $index -ne -1 +} diff --git a/images/windows/editor/SetupAndroid.ps1 b/images/windows/editor/scripts/SetupAndroid.ps1 similarity index 50% rename from images/windows/editor/SetupAndroid.ps1 rename to images/windows/editor/scripts/SetupAndroid.ps1 index d221fa81..2396b98f 100644 --- a/images/windows/editor/SetupAndroid.ps1 +++ b/images/windows/editor/scripts/SetupAndroid.ps1 @@ -1,36 +1,6 @@ $ErrorActionPreference = "Stop" -function Get-ModuleDestinationPath { - - param ( - $ModuleList, - $ModuleID - ) - $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) - $rawPath=$ModuleList[$index].destination - return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) -} - -function Get-ModuleRenamedPath { - - param ( - $ModuleList, - $ModuleID - ) - $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) - $rawPath=$ModuleList[$index].extractedPathRename.to - return $rawPath.Replace('{UNITY_PATH}', $Env:UNITY_PATH) -} - -function Find-Module { - - param ( - $ModuleList, - $ModuleID - ) - $index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} ) - return $index -ne -1 -} +. scripts/HelperFunctions.ps1 # Read the modules.json file for the editor to figure out the proper paths dynamically [void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions") @@ -39,13 +9,13 @@ $UNITY_MODULES_JSON = (New-Object -TypeName System.Web.Script.Serialization.Java $UNITY_MODULES_LIST = [Collections.Generic.List[Object]]($UNITY_MODULES_JSON) # Find our environment variables -$ANDROID_SDK_ROOT = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-sdk-platform-tools' -$ANDROID_NDK_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-ndk' -$JAVA_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-open-jdk' +$ANDROID_SDK_ROOT = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-sdk-platform-tools' $Env:UNITY_PATH +$ANDROID_NDK_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-ndk' $Env:UNITY_PATH +$JAVA_HOME = Get-ModuleDestinationPath $UNITY_MODULES_LIST 'android-open-jdk' $Env:UNITY_PATH if (Find-Module $UNITY_MODULES_LIST 'android-sdk-command-line-tools') { - $TOOLS_PATH = Get-ModuleRenamedPath $UNITY_MODULES_LIST 'android-sdk-command-line-tools' + $TOOLS_PATH = Get-ModuleRenamedPath $UNITY_MODULES_LIST 'android-sdk-command-line-tools' $Env:UNITY_PATH } else { @@ -55,11 +25,12 @@ else # Set our environment variables $newPath = "$JAVA_HOME/bin;$ANDROID_SDK_ROOT/tools;$TOOLS_PATH/bin;$ANDROID_SDK_ROOT/platform-tools;$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/windows-x86_64/bin;C:/Program Files/Git/bin" $oldPath = [Environment]::GetEnvironmentVariable('PATH', 'Machine'); -[Environment]::SetEnvironmentVariable('PATH', "$newPath;$oldPath",'Machine'); -[Environment]::SetEnvironmentVariable('ANDROID_HOME', $ANDROID_SDK_ROOT,'Machine'); -[Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', $ANDROID_NDK_HOME,'Machine'); -[Environment]::SetEnvironmentVariable('JAVA_HOME', $JAVA_HOME,'Machine'); -[Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', $TOOLS_PATH,'Machine'); + +[Environment]::SetEnvironmentVariable('PATH', "$newPath;$oldPath", 'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_HOME', "$ANDROID_SDK_ROOT", 'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_NDK_HOME', "$ANDROID_NDK_HOME", 'Machine'); +[Environment]::SetEnvironmentVariable('JAVA_HOME', "$JAVA_HOME", 'Machine'); +[Environment]::SetEnvironmentVariable('ANDROID_CMDLINE_TOOLS', "$TOOLS_PATH", 'Machine'); # Unity seems to always look for this file and can't find it so we manually create an empty one New-Item -ItemType file -Path "$Env:USERPROFILE/.android/repositories.cfg" -Force From 33b7294a53f16b2a5bd8b3a78676cc921a846603 Mon Sep 17 00:00:00 2001 From: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com> Date: Sun, 29 Oct 2023 20:52:27 -0700 Subject: [PATCH 17/17] Revert to testing on main branch --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb48c9bf..552e8116 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -561,7 +561,7 @@ jobs: # Only run if not a PR as we need access to secrets if: github.base_ref == '' timeout-minutes: 15 - uses: game-ci/unity-builder@windows-image-updates + uses: game-ci/unity-builder@main env: UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}