Skip to content

Commit 7afabe7

Browse files
authored
Additional Windows Image Updates (#589)
* Update workflows, bump image version for docker * Fix Unity pathing and cleanup scripts * Fix Unity pathing * Fix activation scripts
1 parent 4c4611c commit 7afabe7

16 files changed

+93
-66
lines changed

.github/pull_request_template.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,21 @@
22

33
- ...
44

5+
#### Related Issues
6+
7+
- ...
8+
9+
#### Related PRs
10+
11+
- ...
12+
513
#### Checklist
614

715
<!-- please check all items and add your own -->
816

917
- [x] Read the contribution [guide](https://github.com/game-ci/unity-builder/blob/main/CONTRIBUTING.md) and accept the
1018
[code](https://github.com/game-ci/unity-builder/blob/main/CODE_OF_CONDUCT.md) of conduct
11-
- [ ] Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make
12-
a PR in the [documentation repo](https://github.com/game-ci/documentation))
19+
- [ ] Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
20+
in the [documentation repo](https://github.com/game-ci/documentation))
1321
- [ ] Readme (updated or not needed)
1422
- [ ] Tests (added, updated or not needed)

.github/workflows/activation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
id: requestActivationFile
1414
uses: game-ci/[email protected]
1515
- name: Upload activation file
16-
uses: actions/upload-artifact@v2
16+
uses: actions/upload-artifact@v3
1717
with:
1818
name: ${{ steps.requestActivationFile.outputs.filePath }}
1919
path: ${{ steps.requestActivationFile.outputs.filePath }}

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

+5-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111
cancel-in-progress: true
1212

1313
jobs:
14-
buildForAllPlatformsWindows:
14+
buildForAllPlatformsMacOS:
1515
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
1616
runs-on: macos-latest
1717
strategy:
@@ -20,19 +20,17 @@ jobs:
2020
projectPath:
2121
- test-project
2222
unityVersion:
23-
- 2021.3.29f1
24-
- 2022.1.24f1
25-
- 2022.2.21f1
26-
- 2022.3.7f1
27-
- 2023.1.8f1
23+
- 2021.3.31f1
24+
- 2022.3.11f1
25+
- 2023.1.17f1
2826
targetPlatform:
2927
- StandaloneOSX # Build a MacOS executable
3028

3129
steps:
3230
###########################
3331
# Checkout #
3432
###########################
35-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3634
with:
3735
lfs: true
3836

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

+4-12
Original file line numberDiff line numberDiff line change
@@ -52,29 +52,21 @@ jobs:
5252
projectPath:
5353
- test-project
5454
unityVersion:
55-
- 2021.3.29f1
56-
- 2022.1.24f1
57-
- 2022.2.21f1
58-
- 2022.3.7f1
59-
- 2023.1.8f1
55+
- 2021.3.31f1
56+
- 2022.3.11f1
57+
- 2023.1.17f1
6058
targetPlatform:
6159
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
6260
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
6361
- StandaloneLinux64 # Build a Linux 64-bit standalone with mono backend.
6462
- iOS # Build an iOS player.
6563
- Android # Build an Android .apk.
6664
- WebGL # WebGL.
67-
# - StandaloneWindows # Build a Windows standalone.
68-
# - WSAPlayer # Build an Windows Store Apps player.
69-
# - PS4 # Build a PS4 Standalone.
70-
# - XboxOne # Build a Xbox One Standalone.
71-
# - tvOS # Build to Apple's tvOS platform.
72-
# - Switch # Build a Nintendo Switch player
7365
steps:
7466
###########################
7567
# Checkout #
7668
###########################
77-
- uses: actions/checkout@v3
69+
- uses: actions/checkout@v4
7870
with:
7971
lfs: true
8072

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

+6-7
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@ concurrency:
1313
jobs:
1414
buildForAllPlatformsWindows:
1515
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
16-
runs-on: windows-2019
16+
runs-on: windows-2022
1717
strategy:
1818
fail-fast: false
1919
matrix:
2020
projectPath:
2121
- test-project
2222
unityVersion:
23-
- 2021.3.29f1
24-
- 2022.1.24f1
25-
- 2022.2.21f1
26-
- 2022.3.7f1
27-
- 2023.1.8f1
23+
- 2021.3.31f1
24+
- 2022.3.11f1
25+
- 2023.1.17f1
2826
targetPlatform:
27+
- Android # Build an Android apk.
2928
- StandaloneWindows64 # Build a Windows 64-bit standalone.
3029
- StandaloneWindows # Build a Windows 32-bit standalone.
3130
- WSAPlayer # Build a UWP App
@@ -35,7 +34,7 @@ jobs:
3534
###########################
3635
# Checkout #
3736
###########################
38-
- uses: actions/checkout@v3
37+
- uses: actions/checkout@v4
3938
with:
4039
lfs: true
4140

.github/workflows/cleanup.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
cleanupCloudRunner:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
if: github.event.event_type != 'pull_request_target'
2020
with:
2121
lfs: true
22-
- uses: actions/setup-node@v3
22+
- uses: actions/setup-node@v4
2323
with:
2424
node-version: '18'
2525
- run: yarn

.github/workflows/cloud-runner-ci-pipeline.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
#- k8s
5757
steps:
5858
- name: Checkout (default)
59-
uses: actions/checkout@v3
59+
uses: actions/checkout@v4
6060
with:
6161
lfs: false
6262
- name: Configure AWS Credentials
@@ -116,7 +116,7 @@ jobs:
116116
#- 'cloud-runner-locking-get-locked'
117117
steps:
118118
- name: Checkout (default)
119-
uses: actions/checkout@v2
119+
uses: actions/checkout@v4
120120
with:
121121
lfs: false
122122
- name: Configure AWS Credentials
@@ -167,7 +167,7 @@ jobs:
167167
- Android # Build an Android .apk.
168168
steps:
169169
- name: Checkout (default)
170-
uses: actions/checkout@v3
170+
uses: actions/checkout@v4
171171
with:
172172
lfs: false
173173
- run: yarn

.github/workflows/integrity-check.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ jobs:
1616
name: Tests
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v3
20-
- uses: actions/setup-node@v3
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-node@v4
2121
with:
2222
node-version: '18'
2323
- run: yarn

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/platforms/windows/activate.ps1

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Activates Unity
2-
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
3-
-username $Env:UNITY_EMAIL `
4-
-password $Env:UNITY_PASSWORD `
5-
-serial $Env:UNITY_SERIAL `
6-
-projectPath "c:/BlankProject" `
7-
-logfile | Out-Host
2+
3+
Write-Output ""
4+
Write-Output "###########################"
5+
Write-Output "# Activating #"
6+
Write-Output "###########################"
7+
Write-Output ""
8+
9+
& "$Env:UNITY_PATH/Editor/Unity.exe" -batchmode -quit -nographics `
10+
-username $Env:UNITY_EMAIL `
11+
-password $Env:UNITY_PASSWORD `
12+
-serial $Env:UNITY_SERIAL `
13+
-projectPath "c:/BlankProject" `
14+
-logfile - | Out-Host

dist/platforms/windows/build.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,17 +156,17 @@ $unityArgs = @(
156156
# Remove null items as that will fail the Start-Process call
157157
$unityArgs = $unityArgs | Where-Object { $_ -ne $null }
158158

159-
$process = Start-Process -FilePath "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" `
159+
$process = Start-Process -FilePath "$Env:UNITY_PATH\Editor\Unity.exe" `
160160
-ArgumentList $unityArgs `
161161
-PassThru `
162162
-NoNewWindow
163163

164164
while (!$process.HasExited) {
165165
if ($process.HasExited) {
166+
Start-Sleep -Seconds 5
166167
Get-Process
167168

168169
Start-Sleep -Seconds 10
169-
170170
Get-Process
171171

172172
# Display results

dist/platforms/windows/entrypoint.ps1

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Get-Process
2+
Start-Sleep -Seconds 3
23

34
# Import any necessary registry keys, ie: location of windows 10 sdk
45
# No guarantee that there will be any necessary registry keys, ie: tvOS
@@ -22,5 +23,5 @@ Get-Process -Name regsvr32 | ForEach-Object { Stop-Process -Id $_.Id -Force }
2223
# Free the seat for the activated license
2324
& "c:\steps\return_license.ps1"
2425

25-
Start-Sleep 3
26+
Start-Sleep -Seconds 3
2627
Get-Process
+13-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Return the active Unity license
2-
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
3-
-username $Env:UNITY_EMAIL `
4-
-password $Env:UNITY_PASSWORD `
5-
-returnlicense `
6-
-projectPath "c:/BlankProject" `
7-
-logfile | Out-Host
2+
3+
Write-Output ""
4+
Write-Output "###########################"
5+
Write-Output "# Return License #"
6+
Write-Output "###########################"
7+
Write-Output ""
8+
9+
& "$Env:UNITY_PATH\Editor\Unity.exe" -batchmode -quit -nographics `
10+
-username $Env:UNITY_EMAIL `
11+
-password $Env:UNITY_PASSWORD `
12+
-returnlicense `
13+
-projectPath "c:/BlankProject" `
14+
-logfile - | Out-Host

src/model/image-tag.test.ts

+23-10
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ describe('ImageTag', () => {
3030

3131
test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', (version) => {
3232
expect(
33-
() => new ImageTag({ editorVersion: version, targetPlatform: testImageParameters.targetPlatform }),
33+
() =>
34+
new ImageTag({
35+
editorVersion: version,
36+
targetPlatform: testImageParameters.targetPlatform,
37+
}),
3438
).not.toThrow();
3539
});
3640

@@ -46,13 +50,16 @@ describe('ImageTag', () => {
4650

4751
describe('toString', () => {
4852
it('returns the correct version', () => {
49-
const image = new ImageTag({ editorVersion: '2099.1.1111', targetPlatform: testImageParameters.targetPlatform });
53+
const image = new ImageTag({
54+
editorVersion: '2099.1.1111',
55+
targetPlatform: testImageParameters.targetPlatform,
56+
});
5057
switch (process.platform) {
5158
case 'win32':
52-
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2099.1.1111-2`);
59+
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2099.1.1111-3`);
5360
break;
5461
case 'linux':
55-
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-2`);
62+
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-3`);
5663
break;
5764
}
5865
});
@@ -67,27 +74,33 @@ describe('ImageTag', () => {
6774
});
6875

6976
it('returns the specific build platform', () => {
70-
const image = new ImageTag({ editorVersion: '2019.2.11f1', targetPlatform: 'WebGL' });
77+
const image = new ImageTag({
78+
editorVersion: '2019.2.11f1',
79+
targetPlatform: 'WebGL',
80+
});
7181

7282
switch (process.platform) {
7383
case 'win32':
74-
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-webgl-2`);
84+
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-webgl-3`);
7585
break;
7686
case 'linux':
77-
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-webgl-2`);
87+
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-webgl-3`);
7888
break;
7989
}
8090
});
8191

8292
it('returns no specific build platform for generic targetPlatforms', () => {
83-
const image = new ImageTag({ editorVersion: '2019.2.11f1', targetPlatform: 'NoTarget' });
93+
const image = new ImageTag({
94+
editorVersion: '2019.2.11f1',
95+
targetPlatform: 'NoTarget',
96+
});
8497

8598
switch (process.platform) {
8699
case 'win32':
87-
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-2`);
100+
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-3`);
88101
break;
89102
case 'linux':
90-
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-2`);
103+
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-3`);
91104
break;
92105
}
93106
});

src/model/image-tag.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class ImageTag {
3333
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(
3434
isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform,
3535
);
36-
this.imageRollingVersion = 2; // Will automatically roll to the latest non-breaking version.
36+
this.imageRollingVersion = 3; // Will automatically roll to the latest non-breaking version.
3737
}
3838

3939
static get versionPattern(): RegExp {
@@ -86,8 +86,10 @@ class ImageTag {
8686
if (major >= 2020 || (major === 2019 && minor >= 3)) {
8787
return windowsIl2cpp;
8888
} else {
89-
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
90-
If you are trying to build for windows-mono, please use a Linux based OS.`);
89+
throw new Error(
90+
`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
91+
If you are trying to build for windows-mono, please use a Linux based OS.`,
92+
);
9193
}
9294
}
9395

0 commit comments

Comments
 (0)