Skip to content

Commit

Permalink
Fix Windows Arguments Passed to Unity (#623)
Browse files Browse the repository at this point in the history
* Add missing parameter, add quotes around variables, bump action versions

* Wrap quotes

* Fix upload artifact naming conflict
  • Loading branch information
AndrewKahr authored Jan 21, 2024
1 parent 5ba8197 commit 2800d14
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-tests-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
###########################
# Cache #
###########################
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-macos-${{ matrix.targetPlatform }}
Expand All @@ -61,6 +61,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -71,8 +72,8 @@ jobs:
###########################
# Upload #
###########################
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Build MacOS (${{ matrix.unityVersion }})
name: Build ${{ matrix.targetPlatform }} on MacOS (${{ matrix.unityVersion }})
path: build
retention-days: 14
9 changes: 6 additions & 3 deletions .github/workflows/build-tests-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
###########################
# Cache #
###########################
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-ubuntu-${{ matrix.targetPlatform }}
Expand All @@ -88,6 +88,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -108,6 +109,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -128,6 +130,7 @@ jobs:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -138,8 +141,8 @@ jobs:
###########################
# Upload #
###########################
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Build Ubuntu (${{ matrix.unityVersion }})
name: Build ${{ matrix.targetPlatform }} on Ubuntu (${{ matrix.unityVersion }})
path: build
retention-days: 14
9 changes: 6 additions & 3 deletions .github/workflows/build-tests-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
###########################
# Cache #
###########################
- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: ${{ matrix.projectPath }}/Library
key: Library-${{ matrix.projectPath }}-windows-${{ matrix.targetPlatform }}
Expand Down Expand Up @@ -67,6 +67,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -90,6 +91,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -112,6 +114,7 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
buildName: 'GameCI Test Build'
projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
Expand All @@ -122,8 +125,8 @@ jobs:
###########################
# Upload #
###########################
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Build Windows (${{ matrix.unityVersion }})
name: Build ${{ matrix.targetPlatform }} on Windows (${{ matrix.unityVersion }})
path: build
retention-days: 14
27 changes: 14 additions & 13 deletions dist/platforms/windows/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,20 @@ $unityArgs = @(
"-batchmode",
"-nographics",
"-silent-crashes",
"-projectPath", $Env:UNITY_PROJECT_PATH,
"-executeMethod", $Env:BUILD_METHOD,
"-buildTarget", $Env:BUILD_TARGET,
"-customBuildTarget", $Env:BUILD_TARGET,
"-customBuildPath", $Env:CUSTOM_BUILD_PATH,
"-buildVersion", $Env:VERSION,
"-androidVersionCode", $Env:ANDROID_VERSION_CODE,
"-androidKeystorePass", $Env:ANDROID_KEYSTORE_PASS,
"-androidKeyaliasName", $Env:ANDROID_KEYALIAS_NAME,
"-androidKeyaliasPass", $Env:ANDROID_KEYALIAS_PASS,
"-androidTargetSdkVersion", $Env:ANDROID_TARGET_SDK_VERSION,
"-androidExportType", $Env:ANDROID_EXPORT_TYPE,
"-androidSymbolType", $Env:ANDROID_SYMBOL_TYPE,
"-customBuildName", "`"$Env:BUILD_NAME`"",
"-projectPath", "`"$Env:UNITY_PROJECT_PATH`"",
"-executeMethod", "`"$Env:BUILD_METHOD`"",
"-buildTarget", "`"$Env:BUILD_TARGET`"",
"-customBuildTarget", "`"$Env:BUILD_TARGET`"",
"-customBuildPath", "`"$Env:CUSTOM_BUILD_PATH`"",
"-buildVersion", "`"$Env:VERSION`"",
"-androidVersionCode", "`"$Env:ANDROID_VERSION_CODE`"",
"-androidKeystorePass", "`"$Env:ANDROID_KEYSTORE_PASS`"",
"-androidKeyaliasName", "`"$Env:ANDROID_KEYALIAS_NAME`"",
"-androidKeyaliasPass", "`"$Env:ANDROID_KEYALIAS_PASS`"",
"-androidTargetSdkVersion", "`"$Env:ANDROID_TARGET_SDK_VERSION`"",
"-androidExportType", "`"$Env:ANDROID_EXPORT_TYPE`"",
"-androidSymbolType", "`"$Env:ANDROID_SYMBOL_TYPE`"",
"-logfile", "-"
) + $customParametersArray

Expand Down

0 comments on commit 2800d14

Please sign in to comment.