Skip to content

Commit 33cc94c

Browse files
authored
Fix Image Build Errors on 2023.2.4f1+ (#236)
* Bump artifact upload/download versions. Fix for new Unity modules.json format * Update test.yml to conform with new activation requirements * Revert artifact action to v3 due to intermittent issues * Move minimum test version to 2019.3 * Only do test builds when not a PR due to needing access to secrets * Bump ubuntu hub version, cancel superseded checks
1 parent 8722a6d commit 33cc94c

File tree

3 files changed

+64
-31
lines changed

3 files changed

+64
-31
lines changed

.github/workflows/test.yml

Lines changed: 38 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ on:
55
push:
66
paths:
77
- "**/Dockerfile"
8+
- "**/scripts/**"
89
- ".github/workflows/test.yml"
910
- "reference-project-test/**"
1011
pull_request:
1112
paths:
1213
- "**/Dockerfile"
14+
- "**/scripts/**"
1315
- ".github/workflows/test.yml"
1416
- "reference-project-test/**"
1517

16-
env:
17-
UNITY_LICENSE: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><root>\n <License id=\"Terms\">\n <MachineBindings>\n <Binding Key=\"1\" Value=\"576562626572264761624c65526f7578\"/>\n <Binding Key=\"2\" Value=\"576562626572264761624c65526f7578\"/>\n </MachineBindings>\n <MachineID Value=\"D7nTUnjNAmtsUMcnoyrqkgIbYdM=\"/>\n <SerialHash Value=\"2033b8ac3e6faa3742ca9f0bfae44d18f2a96b80\"/>\n <Features>\n <Feature Value=\"33\"/>\n <Feature Value=\"1\"/>\n <Feature Value=\"12\"/>\n <Feature Value=\"2\"/>\n <Feature Value=\"24\"/>\n <Feature Value=\"3\"/>\n <Feature Value=\"36\"/>\n <Feature Value=\"17\"/>\n <Feature Value=\"19\"/>\n <Feature Value=\"62\"/>\n </Features>\n <DeveloperData Value=\"AQAAAEY0LUJHUlgtWEQ0RS1aQ1dWLUM1SlctR0RIQg==\"/>\n <SerialMasked Value=\"F4-BGRX-XD4E-ZCWV-C5JW-XXXX\"/>\n <StartDate Value=\"2021-02-08T00:00:00\"/>\n <UpdateDate Value=\"2021-02-09T00:34:57\"/>\n <InitialActivationDate Value=\"2021-02-08T00:34:56\"/>\n <LicenseVersion Value=\"6.x\"/>\n <ClientProvidedVersion Value=\"2018.4.30f1\"/>\n <AlwaysOnline Value=\"false\"/>\n <Entitlements>\n <Entitlement Ns=\"unity_editor\" Tag=\"UnityPersonal\" Type=\"EDITOR\" ValidTo=\"9999-12-31T00:00:00\"/>\n <Entitlement Ns=\"unity_editor\" Tag=\"DarkSkin\" Type=\"EDITOR_FEATURE\" ValidTo=\"9999-12-31T00:00:00\"/>\n </Entitlements>\n </License>\n<Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\"><SignedInfo><CanonicalizationMethod Algorithm=\"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments\"/><SignatureMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#rsa-sha1\"/><Reference URI=\"#Terms\"><Transforms><Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"/></Transforms><DigestMethod Algorithm=\"http://www.w3.org/2000/09/xmldsig#sha1\"/><DigestValue>m0Db8UK+ktnOLJBtHybkfetpcKo=</DigestValue></Reference></SignedInfo><SignatureValue>o/pUbSQAukz7+ZYAWhnA0AJbIlyyCPL7bKVEM2lVqbrXt7cyey+umkCXamuOgsWPVUKBMkXtMH8L\n5etLmD0getWIhTGhzOnDCk+gtIPfL4jMo9tkEuOCROQAXCci23VFscKcrkB+3X6h4wEOtA2APhOY\nB+wvC794o8/82ffjP79aVAi57rp3Wmzx+9pe9yMwoJuljAy2sc2tIMgdQGWVmOGBpQm3JqsidyzI\nJWG2kjnc7pDXK9pwYzXoKiqUqqrut90d+kQqRyv7MSZXR50HFqD/LI69h68b7P8Bjo3bPXOhNXGR\n9YCoemH6EkfCJxp2gIjzjWW+l2Hj2EsFQi8YXw==</SignatureValue></Signature></root>"
18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: true
1821

1922
jobs:
2023
##########################
@@ -105,27 +108,24 @@ jobs:
105108
id: setup
106109
run: |
107110
# Get the Unity versions for test. (The latest patch versions for each minor version.)
108-
VERSIONS=`npx unity-changeset list --versions --latest-patch --json --min 2018.3`
111+
VERSIONS=`npx unity-changeset list --versions --latest-patch --json --min 2019.3`
109112
echo "Versions: $VERSIONS"
110113
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
111114
112-
# Exclude il2cpp for Unity 2019.2 or earlier
113-
LINUX_EXCLUDES="$LINUX_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2\")) | { version: ., module: \"linux-il2cpp\"} ]'`"
115+
# Unity 2021.1 and 2021.2 do not build il2cpp properly and will be skipped
116+
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`"
114117
115-
# Exclude il2cpp for Unity 2019.2 or earlier. Unity 2021.1 and 2021.2 also do not build properly and will be skipped
116-
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"windows-il2cpp\"} ]'`"
118+
# Issues with 2021.1 and 2021.2 on Universal Windows Platform so they are skipped
119+
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2021.1|2021.2\")) | { version: ., module: \"universal-windows-platform\"} ]'`"
117120
118-
# Universal Windows Platform is added in 2019. Issues with 2021.1 and 2021.2 so they are skipped too
119-
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"universal-windows-platform\"} ]'`"
121+
# Issues with 2021.1 and 2021.2 on AppleTV so they are skipped
122+
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`"
120123
121-
# AppleTV isn't stable until 2019.2. Issues with 2021.1 and 2021.2 so they are skipped too
122-
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2021.1|2021.2\")) | { version: ., module: \"appletv\"} ]'`"
124+
# Issues with 2021.1 and 2021.2 on Android so they are skipped
125+
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2021.1|2021.2\")) | { version: ., module: \"android\"} ]'`"
123126
124-
# No Windows 2018 Android Builds. Issues with 2021.1 and 2021.2 so they are skipped too
125-
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2021.1|2021.2\")) | { version: ., module: \"android\"} ]'`"
126-
127-
# No Windows mono Builds for Unity 2019.2 or earlier. Issues with 2021.1 and 2021.2 so they are skipped too
128-
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2018|2019.1|2019.2|2021.1|2021.2\")) | { version: ., module: \"base\"} ]'`"
127+
# Issues with 2021.1 and 2021.2 on Mono so they are skipped
128+
WINDOWS_EXCLUDES="$WINDOWS_EXCLUDES `echo \"$VERSIONS\" | jq -c '[ .[] | select(test(\"2021.1|2021.2\")) | { version: ., module: \"base\"} ]'`"
129129
130130
LINUX_EXCLUDES=`echo "$LINUX_EXCLUDES" | jq -s -c 'flatten'`
131131
WINDOWS_EXCLUDES=`echo "$WINDOWS_EXCLUDES" | jq -s -c 'flatten'`
@@ -369,6 +369,12 @@ jobs:
369369
- name: Build project
370370
uses: game-ci/unity-builder@main
371371
timeout-minutes: 35
372+
# Only run if not a PR as we need access to secrets
373+
if: github.base_ref == ''
374+
env:
375+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
376+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
377+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
372378
with:
373379
unityVersion: ${{ matrix.version }}
374380
customImage: editor:ubuntu-dev
@@ -385,9 +391,13 @@ jobs:
385391
# Set WebGL compression format to gzip
386392
sed -i -e 's/webGLCompressionFormat: .*$/webGLCompressionFormat: 1/' reference-project-test/ProjectSettings/ProjectSettings.asset
387393
- name: Build project (GZip)
388-
if: env.MODULE == 'webgl'
394+
if: env.MODULE == 'webgl' && github.base_ref == ''
389395
uses: game-ci/unity-builder@main
390396
timeout-minutes: 15
397+
env:
398+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
399+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
400+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
391401
with:
392402
unityVersion: ${{ matrix.version }}
393403
customImage: editor:ubuntu-dev
@@ -404,9 +414,13 @@ jobs:
404414
# Set WebGL compression format to brotli
405415
sed -i -e 's/webGLCompressionFormat: .*$/webGLCompressionFormat: 0/' reference-project-test/ProjectSettings/ProjectSettings.asset
406416
- name: Build project (Brotli)
407-
if: env.MODULE == 'webgl'
417+
if: env.MODULE == 'webgl' && github.base_ref == ''
408418
uses: game-ci/unity-builder@main
409419
timeout-minutes: 15
420+
env:
421+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
422+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
423+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
410424
with:
411425
unityVersion: ${{ matrix.version }}
412426
customImage: editor:ubuntu-dev
@@ -420,6 +434,12 @@ jobs:
420434
- name: Test project
421435
timeout-minutes: 10
422436
uses: game-ci/unity-test-runner@main
437+
# Only run if not a PR as we need access to secrets
438+
if: github.base_ref == ''
439+
env:
440+
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
441+
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
442+
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
423443
with:
424444
unityVersion: ${{ matrix.version }}
425445
customImage: editor:ubuntu-dev

images/ubuntu/hub/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG baseImage="unityci/base"
22
FROM $baseImage
3-
ARG hubVersion="3.4.2"
3+
ARG hubVersion="3.7.0"
44

55
# Hub dependencies
66
RUN apt-get -q update \

images/windows/editor/scripts/HelperFunctions.ps1

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ function CheckLastExitCode {
66
param ([int[]]$SuccessCodes = @(0), [scriptblock]$CleanupScript=$null)
77

88
if ($SuccessCodes -notcontains $LastExitCode) {
9-
if ($CleanupScript) {
10-
"Executing cleanup script: $CleanupScript"
11-
&$CleanupScript
12-
}
13-
$msg = @"
9+
if ($CleanupScript) {
10+
"Executing cleanup script: $CleanupScript"
11+
&$CleanupScript
12+
}
13+
$msg = @"
1414
EXE RETURNED EXIT CODE $LastExitCode
1515
CALLSTACK:$(Get-PSCallStack | Out-String)
1616
"@
17-
throw $msg
17+
throw $msg
1818
}
1919
}
2020

@@ -25,24 +25,37 @@ CALLSTACK:$(Get-PSCallStack | Out-String)
2525
function Get-ModuleDestinationPath {
2626

2727
param (
28-
$ModuleList,
29-
$ModuleID,
30-
$UnityPath
28+
$ModuleList,
29+
$ModuleID,
30+
$UnityPath
3131
)
3232
$index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} )
3333
$rawPath=$ModuleList[$index].destination
34+
35+
if ($null -eq $rawPath) {
36+
throw "Unable to get a destination path for $ModuleID"
37+
}
38+
3439
return $rawPath.Replace('{UNITY_PATH}', $UnityPath)
3540
}
3641

3742
function Get-ModuleRenamedPath {
3843

3944
param (
40-
$ModuleList,
41-
$ModuleID,
42-
$UnityPath
45+
$ModuleList,
46+
$ModuleID,
47+
$UnityPath
4348
)
4449
$index=$ModuleList.FindIndex( {$args[0].id.contains($ModuleID)} )
4550
$rawPath=$ModuleList[$index].extractedPathRename.to
51+
52+
if ($null -eq $rawPath) {
53+
$rawPath=$ModuleList[$index].renameTo
54+
if ($null -eq $rawPath) {
55+
throw "Unable to get a ModuleRenamedPath for $ModuleID"
56+
}
57+
}
58+
4659
return $rawPath.Replace('{UNITY_PATH}', $UnityPath)
4760
}
4861

0 commit comments

Comments
 (0)