Skip to content

Commit 88a89c9

Browse files
authored
Fix build profile name truncation on Windows (#745)
* feat: windows * feat: macos * fix: artifact name conflict * fix: mac build profile parameter missing
1 parent f7f3f70 commit 88a89c9

File tree

7 files changed

+130
-5
lines changed

7 files changed

+130
-5
lines changed

.github/workflows/build-tests-mac.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
targetPlatform:
2525
- StandaloneOSX # Build a MacOS executable
2626
- iOS # Build an iOS executable
27+
include:
28+
# Additionally test enableGpu build for a standalone windows target
29+
- unityVersion: 6000.0.36f1
30+
targetPlatform: StandaloneOSX
31+
- unityVersion: 6000.0.36f1
32+
targetPlatform: StandaloneOSX
33+
buildProfile: 'Assets/Settings/Build Profiles/Sample macOS Build Profile.asset'
2734

2835
steps:
2936
###########################
@@ -65,6 +72,7 @@ jobs:
6572
projectPath: ${{ matrix.projectPath }}
6673
unityVersion: ${{ matrix.unityVersion }}
6774
targetPlatform: ${{ matrix.targetPlatform }}
75+
buildProfile: ${{ matrix.buildProfile }}
6876
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
6977
# We use dirty build because we are replacing the default project settings file above
7078
allowDirtyBuild: true
@@ -74,6 +82,6 @@ jobs:
7482
###########################
7583
- uses: actions/upload-artifact@v4
7684
with:
77-
name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})
85+
name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})${{ matrix.buildProfile && ' With Build Profile' || '' }}
7886
path: build
7987
retention-days: 14

.github/workflows/build-tests-windows.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ jobs:
3434
unityVersion: 2023.2.2f1
3535
targetPlatform: StandaloneWindows64
3636
enableGpu: true
37-
37+
- unityVersion: 6000.0.36f1
38+
targetPlatform: StandaloneWindows64
39+
- unityVersion: 6000.0.36f1
40+
targetPlatform: StandaloneWindows64
41+
buildProfile: 'Assets/Settings/Build Profiles/Sample Windows Build Profile.asset'
42+
3843
steps:
3944
###########################
4045
# Checkout #
@@ -79,6 +84,7 @@ jobs:
7984
projectPath: ${{ matrix.projectPath }}
8085
unityVersion: ${{ matrix.unityVersion }}
8186
targetPlatform: ${{ matrix.targetPlatform }}
87+
buildProfile: ${{ matrix.buildProfile }}
8288
enableGpu: ${{ matrix.enableGpu }}
8389
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
8490
allowDirtyBuild: true
@@ -140,6 +146,6 @@ jobs:
140146
###########################
141147
- uses: actions/upload-artifact@v4
142148
with:
143-
name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}
149+
name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})${{ matrix.enableGpu && ' With GPU' || '' }}${{ matrix.buildProfile && ' With Build Profile' || '' }}
144150
path: build
145151
retention-days: 14

dist/platforms/windows/build.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ $unityArgs = @(
181181
) + $customParametersArray
182182

183183
if (-not $Env:BUILD_PROFILE) {
184-
$unityArgs += @("-buildTarget", $Env:BUILD_TARGET)
184+
$unityArgs += @("-buildTarget", "`"$Env:BUILD_TARGET`"")
185185
}
186186
if ($Env:BUILD_PROFILE) {
187-
$unityArgs += @("-activeBuildProfile", $Env:BUILD_PROFILE)
187+
$unityArgs += @("-activeBuildProfile", "`"$Env:BUILD_PROFILE`"")
188188
}
189189

190190
# Remove null items as that will fail the Start-Process call
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 15003, guid: 0000000000000000e000000000000000, type: 0}
13+
m_Name: Sample Windows Build Profile
14+
m_EditorClassIdentifier:
15+
m_AssetVersion: 1
16+
m_BuildTarget: 19
17+
m_Subtarget: 2
18+
m_PlatformId: 4e3c793746204150860bf175a9a41a05
19+
m_PlatformBuildProfile:
20+
rid: 9120355575023534081
21+
m_OverrideGlobalSceneList: 0
22+
m_Scenes: []
23+
m_ScriptingDefines:
24+
- BUILD_PROFILE_LOADED
25+
m_PlayerSettingsYaml:
26+
m_Settings: []
27+
references:
28+
version: 2
29+
RefIds:
30+
- rid: 9120355575023534081
31+
type: {class: WindowsPlatformSettings, ns: UnityEditor.WindowsStandalone, asm: UnityEditor.WindowsStandalone.Extensions}
32+
data:
33+
m_Development: 1
34+
m_ConnectProfiler: 0
35+
m_BuildWithDeepProfilingSupport: 0
36+
m_AllowDebugging: 0
37+
m_WaitForManagedDebugger: 0
38+
m_ManagedDebuggerFixedPort: 0
39+
m_ExplicitNullChecks: 0
40+
m_ExplicitDivideByZeroChecks: 0
41+
m_ExplicitArrayBoundsChecks: 0
42+
m_CompressionType: 0
43+
m_InstallInBuildFolder: 0
44+
m_WindowsBuildAndRunDeployTarget: 0
45+
m_Architecture: 0
46+
m_CreateSolution: 0
47+
m_CopyPDBFiles: 0
48+
m_WindowsDevicePortalAddress:
49+
m_WindowsDevicePortalUsername:

test-project/Assets/Settings/Build Profiles/Sample Windows Build Profile.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 15003, guid: 0000000000000000e000000000000000, type: 0}
13+
m_Name: Sample macOS Build Profile
14+
m_EditorClassIdentifier:
15+
m_AssetVersion: 1
16+
m_BuildTarget: 2
17+
m_Subtarget: 2
18+
m_PlatformId: 0d2129357eac403d8b359c2dcbf82502
19+
m_PlatformBuildProfile:
20+
rid: 9120355587586260993
21+
m_OverrideGlobalSceneList: 0
22+
m_Scenes: []
23+
m_ScriptingDefines:
24+
- BUILD_PROFILE_LOADED
25+
m_PlayerSettingsYaml:
26+
m_Settings: []
27+
references:
28+
version: 2
29+
RefIds:
30+
- rid: 9120355587586260993
31+
type: {class: OSXStandaloneBuildProfile, ns: UnityEditor.OSXStandalone, asm: UnityEditor.OSXStandalone.Extensions}
32+
data:
33+
m_Development: 0
34+
m_ConnectProfiler: 0
35+
m_BuildWithDeepProfilingSupport: 0
36+
m_AllowDebugging: 0
37+
m_WaitForManagedDebugger: 0
38+
m_ManagedDebuggerFixedPort: 0
39+
m_ExplicitNullChecks: 0
40+
m_ExplicitDivideByZeroChecks: 0
41+
m_ExplicitArrayBoundsChecks: 0
42+
m_CompressionType: 0
43+
m_InstallInBuildFolder: 0
44+
m_MacOSXcodeBuildConfig: 1
45+
m_Architecture: 2
46+
m_CreateXcodeProject: 0

test-project/Assets/Settings/Build Profiles/Sample macOS Build Profile.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)