From 84c79e44e030cce96f2cb1581caae7ed5648c11e Mon Sep 17 00:00:00 2001 From: Ryoichiro Oka Date: Fri, 3 Oct 2025 22:41:44 +0900 Subject: [PATCH 1/4] feat: windows --- .github/workflows/build-tests-windows.yml | 8 ++- dist/platforms/windows/build.ps1 | 4 +- .../Sample Windows Build Profile.asset | 49 +++++++++++++++++++ .../Sample Windows Build Profile.asset.meta | 8 +++ 4 files changed, 66 insertions(+), 3 deletions(-) create mode 100644 test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset create mode 100644 test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset.meta diff --git a/.github/workflows/build-tests-windows.yml b/.github/workflows/build-tests-windows.yml index c0c5de19d..78ee49a03 100644 --- a/.github/workflows/build-tests-windows.yml +++ b/.github/workflows/build-tests-windows.yml @@ -34,7 +34,12 @@ jobs: unityVersion: 2023.2.2f1 targetPlatform: StandaloneWindows64 enableGpu: true - + - unityVersion: 6000.0.36f1 + targetPlatform: StandaloneWindows64 + - unityVersion: 6000.0.36f1 + targetPlatform: StandaloneWindows64 + buildProfile: 'Assets/Settings/Build Profiles/Sample Windows Build Profile.asset' + steps: ########################### # Checkout # @@ -79,6 +84,7 @@ jobs: projectPath: ${{ matrix.projectPath }} unityVersion: ${{ matrix.unityVersion }} targetPlatform: ${{ matrix.targetPlatform }} + buildProfile: ${{ matrix.buildProfile }} enableGpu: ${{ matrix.enableGpu }} customParameters: -profile SomeProfile -someBoolean -someValue exampleValue allowDirtyBuild: true diff --git a/dist/platforms/windows/build.ps1 b/dist/platforms/windows/build.ps1 index 0751246d7..b2477a45e 100644 --- a/dist/platforms/windows/build.ps1 +++ b/dist/platforms/windows/build.ps1 @@ -181,10 +181,10 @@ $unityArgs = @( ) + $customParametersArray if (-not $Env:BUILD_PROFILE) { - $unityArgs += @("-buildTarget", $Env:BUILD_TARGET) + $unityArgs += @("-buildTarget", "`"$Env:BUILD_TARGET`"") } if ($Env:BUILD_PROFILE) { - $unityArgs += @("-activeBuildProfile", $Env:BUILD_PROFILE) + $unityArgs += @("-activeBuildProfile", "`"$Env:BUILD_PROFILE`"") } # Remove null items as that will fail the Start-Process call diff --git a/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset b/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset new file mode 100644 index 000000000..fe8120f16 --- /dev/null +++ b/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset @@ -0,0 +1,49 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 15003, guid: 0000000000000000e000000000000000, type: 0} + m_Name: Sample Windows Build Profile + m_EditorClassIdentifier: + m_AssetVersion: 1 + m_BuildTarget: 19 + m_Subtarget: 2 + m_PlatformId: 4e3c793746204150860bf175a9a41a05 + m_PlatformBuildProfile: + rid: 9120355575023534081 + m_OverrideGlobalSceneList: 0 + m_Scenes: [] + m_ScriptingDefines: + - BUILD_PROFILE_LOADED + m_PlayerSettingsYaml: + m_Settings: [] + references: + version: 2 + RefIds: + - rid: 9120355575023534081 + type: {class: WindowsPlatformSettings, ns: UnityEditor.WindowsStandalone, asm: UnityEditor.WindowsStandalone.Extensions} + data: + m_Development: 1 + m_ConnectProfiler: 0 + m_BuildWithDeepProfilingSupport: 0 + m_AllowDebugging: 0 + m_WaitForManagedDebugger: 0 + m_ManagedDebuggerFixedPort: 0 + m_ExplicitNullChecks: 0 + m_ExplicitDivideByZeroChecks: 0 + m_ExplicitArrayBoundsChecks: 0 + m_CompressionType: 0 + m_InstallInBuildFolder: 0 + m_WindowsBuildAndRunDeployTarget: 0 + m_Architecture: 0 + m_CreateSolution: 0 + m_CopyPDBFiles: 0 + m_WindowsDevicePortalAddress: + m_WindowsDevicePortalUsername: diff --git a/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset.meta b/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset.meta new file mode 100644 index 000000000..83c9d16ea --- /dev/null +++ b/test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 89540e92f0e247d4084f426eb3bdb288 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 8a98f9cfcbe4bcd759dae779b56d77737ac91c80 Mon Sep 17 00:00:00 2001 From: Ryoichiro Oka Date: Sat, 4 Oct 2025 12:17:12 +0900 Subject: [PATCH 2/4] feat: macos --- .github/workflows/build-tests-mac.yml | 7 +++ .../Sample macOS Build Profile.asset | 46 +++++++++++++++++++ .../Sample macOS Build Profile.asset.meta | 8 ++++ 3 files changed, 61 insertions(+) create mode 100644 test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset create mode 100644 test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset.meta diff --git a/.github/workflows/build-tests-mac.yml b/.github/workflows/build-tests-mac.yml index 4775aef9d..b992af7a1 100644 --- a/.github/workflows/build-tests-mac.yml +++ b/.github/workflows/build-tests-mac.yml @@ -24,6 +24,13 @@ jobs: targetPlatform: - StandaloneOSX # Build a MacOS executable - iOS # Build an iOS executable + include: + # Additionally test enableGpu build for a standalone windows target + - unityVersion: 6000.0.36f1 + targetPlatform: StandaloneOSX + - unityVersion: 6000.0.36f1 + targetPlatform: StandaloneOSX + buildProfile: 'Assets/Settings/Build Profiles/Sample macOS Build Profile.asset' steps: ########################### diff --git a/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset b/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset new file mode 100644 index 000000000..013f1d429 --- /dev/null +++ b/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 15003, guid: 0000000000000000e000000000000000, type: 0} + m_Name: Sample macOS Build Profile + m_EditorClassIdentifier: + m_AssetVersion: 1 + m_BuildTarget: 2 + m_Subtarget: 2 + m_PlatformId: 0d2129357eac403d8b359c2dcbf82502 + m_PlatformBuildProfile: + rid: 9120355587586260993 + m_OverrideGlobalSceneList: 0 + m_Scenes: [] + m_ScriptingDefines: + - BUILD_PROFILE_LOADED + m_PlayerSettingsYaml: + m_Settings: [] + references: + version: 2 + RefIds: + - rid: 9120355587586260993 + type: {class: OSXStandaloneBuildProfile, ns: UnityEditor.OSXStandalone, asm: UnityEditor.OSXStandalone.Extensions} + data: + m_Development: 0 + m_ConnectProfiler: 0 + m_BuildWithDeepProfilingSupport: 0 + m_AllowDebugging: 0 + m_WaitForManagedDebugger: 0 + m_ManagedDebuggerFixedPort: 0 + m_ExplicitNullChecks: 0 + m_ExplicitDivideByZeroChecks: 0 + m_ExplicitArrayBoundsChecks: 0 + m_CompressionType: 0 + m_InstallInBuildFolder: 0 + m_MacOSXcodeBuildConfig: 1 + m_Architecture: 2 + m_CreateXcodeProject: 0 diff --git a/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset.meta b/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset.meta new file mode 100644 index 000000000..c3027aa61 --- /dev/null +++ b/test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 081f4929fd671734ea1aa1511be7ec97 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 11400000 + userData: + assetBundleName: + assetBundleVariant: From 53c3dd87c626f986c97b2ba3c8f9cfaf78ac9803 Mon Sep 17 00:00:00 2001 From: Ryoichiro Oka Date: Sat, 4 Oct 2025 13:09:42 +0900 Subject: [PATCH 3/4] fix: artifact name conflict --- .github/workflows/build-tests-mac.yml | 2 +- .github/workflows/build-tests-windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-tests-mac.yml b/.github/workflows/build-tests-mac.yml index b992af7a1..3d3d2a507 100644 --- a/.github/workflows/build-tests-mac.yml +++ b/.github/workflows/build-tests-mac.yml @@ -81,6 +81,6 @@ jobs: ########################### - uses: actions/upload-artifact@v4 with: - name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }}) + name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && ' With Build Profile' || '' }} path: build retention-days: 14 diff --git a/.github/workflows/build-tests-windows.yml b/.github/workflows/build-tests-windows.yml index 78ee49a03..72948f0aa 100644 --- a/.github/workflows/build-tests-windows.yml +++ b/.github/workflows/build-tests-windows.yml @@ -146,6 +146,6 @@ jobs: ########################### - uses: actions/upload-artifact@v4 with: - name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }} + name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }} path: build retention-days: 14 From c402a09fe7be918881195e04f2227ea2551e28b9 Mon Sep 17 00:00:00 2001 From: Ryoichiro Oka Date: Sat, 4 Oct 2025 15:25:57 +0900 Subject: [PATCH 4/4] fix: mac build profile parameter missing --- .github/workflows/build-tests-mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-tests-mac.yml b/.github/workflows/build-tests-mac.yml index 3d3d2a507..77f843272 100644 --- a/.github/workflows/build-tests-mac.yml +++ b/.github/workflows/build-tests-mac.yml @@ -72,6 +72,7 @@ jobs: projectPath: ${{ matrix.projectPath }} unityVersion: ${{ matrix.unityVersion }} targetPlatform: ${{ matrix.targetPlatform }} + buildProfile: ${{ matrix.buildProfile }} customParameters: -profile SomeProfile -someBoolean -someValue exampleValue # We use dirty build because we are replacing the default project settings file above allowDirtyBuild: true