mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Additional Windows Image Updates (#589)
* Update workflows, bump image version for docker * Fix Unity pathing and cleanup scripts * Fix Unity pathing * Fix activation scripts
This commit is contained in:
parent
4c4611c021
commit
7afabe74da
12
.github/pull_request_template.md
vendored
12
.github/pull_request_template.md
vendored
@ -2,13 +2,21 @@
|
|||||||
|
|
||||||
- ...
|
- ...
|
||||||
|
|
||||||
|
#### Related Issues
|
||||||
|
|
||||||
|
- ...
|
||||||
|
|
||||||
|
#### Related PRs
|
||||||
|
|
||||||
|
- ...
|
||||||
|
|
||||||
#### Checklist
|
#### Checklist
|
||||||
|
|
||||||
<!-- please check all items and add your own -->
|
<!-- please check all items and add your own -->
|
||||||
|
|
||||||
- [x] Read the contribution [guide](https://github.com/game-ci/unity-builder/blob/main/CONTRIBUTING.md) and accept the
|
- [x] Read the contribution [guide](https://github.com/game-ci/unity-builder/blob/main/CONTRIBUTING.md) and accept the
|
||||||
[code](https://github.com/game-ci/unity-builder/blob/main/CODE_OF_CONDUCT.md) of conduct
|
[code](https://github.com/game-ci/unity-builder/blob/main/CODE_OF_CONDUCT.md) of conduct
|
||||||
- [ ] Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make
|
- [ ] Docs (If new inputs or outputs have been added or changes to behavior that should be documented. Please make a PR
|
||||||
a PR in the [documentation repo](https://github.com/game-ci/documentation))
|
in the [documentation repo](https://github.com/game-ci/documentation))
|
||||||
- [ ] Readme (updated or not needed)
|
- [ ] Readme (updated or not needed)
|
||||||
- [ ] Tests (added, updated or not needed)
|
- [ ] Tests (added, updated or not needed)
|
||||||
|
2
.github/workflows/activation.yml
vendored
2
.github/workflows/activation.yml
vendored
@ -13,7 +13,7 @@ jobs:
|
|||||||
id: requestActivationFile
|
id: requestActivationFile
|
||||||
uses: game-ci/unity-request-activation-file@v2.0-alpha-1
|
uses: game-ci/unity-request-activation-file@v2.0-alpha-1
|
||||||
- name: Upload activation file
|
- name: Upload activation file
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ steps.requestActivationFile.outputs.filePath }}
|
name: ${{ steps.requestActivationFile.outputs.filePath }}
|
||||||
path: ${{ steps.requestActivationFile.outputs.filePath }}
|
path: ${{ steps.requestActivationFile.outputs.filePath }}
|
||||||
|
12
.github/workflows/build-tests-mac.yml
vendored
12
.github/workflows/build-tests-mac.yml
vendored
@ -11,7 +11,7 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
buildForAllPlatformsWindows:
|
buildForAllPlatformsMacOS:
|
||||||
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
strategy:
|
strategy:
|
||||||
@ -20,11 +20,9 @@ jobs:
|
|||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.29f1
|
- 2021.3.31f1
|
||||||
- 2022.1.24f1
|
- 2022.3.11f1
|
||||||
- 2022.2.21f1
|
- 2023.1.17f1
|
||||||
- 2022.3.7f1
|
|
||||||
- 2023.1.8f1
|
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
- StandaloneOSX # Build a MacOS executable
|
- StandaloneOSX # Build a MacOS executable
|
||||||
|
|
||||||
@ -32,7 +30,7 @@ jobs:
|
|||||||
###########################
|
###########################
|
||||||
# Checkout #
|
# Checkout #
|
||||||
###########################
|
###########################
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
|
16
.github/workflows/build-tests-ubuntu.yml
vendored
16
.github/workflows/build-tests-ubuntu.yml
vendored
@ -52,11 +52,9 @@ jobs:
|
|||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.29f1
|
- 2021.3.31f1
|
||||||
- 2022.1.24f1
|
- 2022.3.11f1
|
||||||
- 2022.2.21f1
|
- 2023.1.17f1
|
||||||
- 2022.3.7f1
|
|
||||||
- 2023.1.8f1
|
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
|
- StandaloneOSX # Build a macOS standalone (Intel 64-bit) with mono backend.
|
||||||
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
|
- StandaloneWindows64 # Build a Windows 64-bit standalone with mono backend.
|
||||||
@ -64,17 +62,11 @@ jobs:
|
|||||||
- iOS # Build an iOS player.
|
- iOS # Build an iOS player.
|
||||||
- Android # Build an Android .apk.
|
- Android # Build an Android .apk.
|
||||||
- WebGL # WebGL.
|
- WebGL # WebGL.
|
||||||
# - StandaloneWindows # Build a Windows standalone.
|
|
||||||
# - WSAPlayer # Build an Windows Store Apps player.
|
|
||||||
# - PS4 # Build a PS4 Standalone.
|
|
||||||
# - XboxOne # Build a Xbox One Standalone.
|
|
||||||
# - tvOS # Build to Apple's tvOS platform.
|
|
||||||
# - Switch # Build a Nintendo Switch player
|
|
||||||
steps:
|
steps:
|
||||||
###########################
|
###########################
|
||||||
# Checkout #
|
# Checkout #
|
||||||
###########################
|
###########################
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
|
13
.github/workflows/build-tests-windows.yml
vendored
13
.github/workflows/build-tests-windows.yml
vendored
@ -13,19 +13,18 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
buildForAllPlatformsWindows:
|
buildForAllPlatformsWindows:
|
||||||
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
name: ${{ matrix.targetPlatform }} on ${{ matrix.unityVersion }}
|
||||||
runs-on: windows-2019
|
runs-on: windows-2022
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2021.3.29f1
|
- 2021.3.31f1
|
||||||
- 2022.1.24f1
|
- 2022.3.11f1
|
||||||
- 2022.2.21f1
|
- 2023.1.17f1
|
||||||
- 2022.3.7f1
|
|
||||||
- 2023.1.8f1
|
|
||||||
targetPlatform:
|
targetPlatform:
|
||||||
|
- Android # Build an Android apk.
|
||||||
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
||||||
- StandaloneWindows # Build a Windows 32-bit standalone.
|
- StandaloneWindows # Build a Windows 32-bit standalone.
|
||||||
- WSAPlayer # Build a UWP App
|
- WSAPlayer # Build a UWP App
|
||||||
@ -35,7 +34,7 @@ jobs:
|
|||||||
###########################
|
###########################
|
||||||
# Checkout #
|
# Checkout #
|
||||||
###########################
|
###########################
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
|
|
||||||
|
4
.github/workflows/cleanup.yml
vendored
4
.github/workflows/cleanup.yml
vendored
@ -15,11 +15,11 @@ jobs:
|
|||||||
cleanupCloudRunner:
|
cleanupCloudRunner:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
if: github.event.event_type != 'pull_request_target'
|
if: github.event.event_type != 'pull_request_target'
|
||||||
with:
|
with:
|
||||||
lfs: true
|
lfs: true
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
- run: yarn
|
- run: yarn
|
||||||
|
@ -56,7 +56,7 @@ jobs:
|
|||||||
#- k8s
|
#- k8s
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (default)
|
- name: Checkout (default)
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: false
|
lfs: false
|
||||||
- name: Configure AWS Credentials
|
- name: Configure AWS Credentials
|
||||||
@ -116,7 +116,7 @@ jobs:
|
|||||||
#- 'cloud-runner-locking-get-locked'
|
#- 'cloud-runner-locking-get-locked'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (default)
|
- name: Checkout (default)
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: false
|
lfs: false
|
||||||
- name: Configure AWS Credentials
|
- name: Configure AWS Credentials
|
||||||
@ -167,7 +167,7 @@ jobs:
|
|||||||
- Android # Build an Android .apk.
|
- Android # Build an Android .apk.
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout (default)
|
- name: Checkout (default)
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
lfs: false
|
lfs: false
|
||||||
- run: yarn
|
- run: yarn
|
||||||
|
4
.github/workflows/integrity-check.yml
vendored
4
.github/workflows/integrity-check.yml
vendored
@ -16,8 +16,8 @@ jobs:
|
|||||||
name: Tests
|
name: Tests
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '18'
|
node-version: '18'
|
||||||
- run: yarn
|
- run: yarn
|
||||||
|
BIN
dist/index.js
generated
vendored
BIN
dist/index.js
generated
vendored
Binary file not shown.
BIN
dist/index.js.map
generated
vendored
BIN
dist/index.js.map
generated
vendored
Binary file not shown.
19
dist/platforms/windows/activate.ps1
vendored
19
dist/platforms/windows/activate.ps1
vendored
@ -1,7 +1,14 @@
|
|||||||
# Activates Unity
|
# Activates Unity
|
||||||
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
|
|
||||||
-username $Env:UNITY_EMAIL `
|
Write-Output ""
|
||||||
-password $Env:UNITY_PASSWORD `
|
Write-Output "###########################"
|
||||||
-serial $Env:UNITY_SERIAL `
|
Write-Output "# Activating #"
|
||||||
-projectPath "c:/BlankProject" `
|
Write-Output "###########################"
|
||||||
-logfile | Out-Host
|
Write-Output ""
|
||||||
|
|
||||||
|
& "$Env:UNITY_PATH/Editor/Unity.exe" -batchmode -quit -nographics `
|
||||||
|
-username $Env:UNITY_EMAIL `
|
||||||
|
-password $Env:UNITY_PASSWORD `
|
||||||
|
-serial $Env:UNITY_SERIAL `
|
||||||
|
-projectPath "c:/BlankProject" `
|
||||||
|
-logfile - | Out-Host
|
||||||
|
4
dist/platforms/windows/build.ps1
vendored
4
dist/platforms/windows/build.ps1
vendored
@ -156,17 +156,17 @@ $unityArgs = @(
|
|||||||
# Remove null items as that will fail the Start-Process call
|
# Remove null items as that will fail the Start-Process call
|
||||||
$unityArgs = $unityArgs | Where-Object { $_ -ne $null }
|
$unityArgs = $unityArgs | Where-Object { $_ -ne $null }
|
||||||
|
|
||||||
$process = Start-Process -FilePath "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" `
|
$process = Start-Process -FilePath "$Env:UNITY_PATH\Editor\Unity.exe" `
|
||||||
-ArgumentList $unityArgs `
|
-ArgumentList $unityArgs `
|
||||||
-PassThru `
|
-PassThru `
|
||||||
-NoNewWindow
|
-NoNewWindow
|
||||||
|
|
||||||
while (!$process.HasExited) {
|
while (!$process.HasExited) {
|
||||||
if ($process.HasExited) {
|
if ($process.HasExited) {
|
||||||
|
Start-Sleep -Seconds 5
|
||||||
Get-Process
|
Get-Process
|
||||||
|
|
||||||
Start-Sleep -Seconds 10
|
Start-Sleep -Seconds 10
|
||||||
|
|
||||||
Get-Process
|
Get-Process
|
||||||
|
|
||||||
# Display results
|
# Display results
|
||||||
|
3
dist/platforms/windows/entrypoint.ps1
vendored
3
dist/platforms/windows/entrypoint.ps1
vendored
@ -1,4 +1,5 @@
|
|||||||
Get-Process
|
Get-Process
|
||||||
|
Start-Sleep -Seconds 3
|
||||||
|
|
||||||
# Import any necessary registry keys, ie: location of windows 10 sdk
|
# Import any necessary registry keys, ie: location of windows 10 sdk
|
||||||
# No guarantee that there will be any necessary registry keys, ie: tvOS
|
# 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 }
|
|||||||
# Free the seat for the activated license
|
# Free the seat for the activated license
|
||||||
& "c:\steps\return_license.ps1"
|
& "c:\steps\return_license.ps1"
|
||||||
|
|
||||||
Start-Sleep 3
|
Start-Sleep -Seconds 3
|
||||||
Get-Process
|
Get-Process
|
||||||
|
19
dist/platforms/windows/return_license.ps1
vendored
19
dist/platforms/windows/return_license.ps1
vendored
@ -1,7 +1,14 @@
|
|||||||
# Return the active Unity license
|
# Return the active Unity license
|
||||||
& "C:\Program Files\Unity\Hub\Editor\$Env:UNITY_VERSION\Editor\Unity.exe" -batchmode -quit -nographics `
|
|
||||||
-username $Env:UNITY_EMAIL `
|
Write-Output ""
|
||||||
-password $Env:UNITY_PASSWORD `
|
Write-Output "###########################"
|
||||||
-returnlicense `
|
Write-Output "# Return License #"
|
||||||
-projectPath "c:/BlankProject" `
|
Write-Output "###########################"
|
||||||
-logfile | Out-Host
|
Write-Output ""
|
||||||
|
|
||||||
|
& "$Env:UNITY_PATH\Editor\Unity.exe" -batchmode -quit -nographics `
|
||||||
|
-username $Env:UNITY_EMAIL `
|
||||||
|
-password $Env:UNITY_PASSWORD `
|
||||||
|
-returnlicense `
|
||||||
|
-projectPath "c:/BlankProject" `
|
||||||
|
-logfile - | Out-Host
|
||||||
|
@ -30,7 +30,11 @@ describe('ImageTag', () => {
|
|||||||
|
|
||||||
test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', (version) => {
|
test.each(['2000.0.0f0', '2011.1.11f1'])('accepts %p version format', (version) => {
|
||||||
expect(
|
expect(
|
||||||
() => new ImageTag({ editorVersion: version, targetPlatform: testImageParameters.targetPlatform }),
|
() =>
|
||||||
|
new ImageTag({
|
||||||
|
editorVersion: version,
|
||||||
|
targetPlatform: testImageParameters.targetPlatform,
|
||||||
|
}),
|
||||||
).not.toThrow();
|
).not.toThrow();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -46,13 +50,16 @@ describe('ImageTag', () => {
|
|||||||
|
|
||||||
describe('toString', () => {
|
describe('toString', () => {
|
||||||
it('returns the correct version', () => {
|
it('returns the correct version', () => {
|
||||||
const image = new ImageTag({ editorVersion: '2099.1.1111', targetPlatform: testImageParameters.targetPlatform });
|
const image = new ImageTag({
|
||||||
|
editorVersion: '2099.1.1111',
|
||||||
|
targetPlatform: testImageParameters.targetPlatform,
|
||||||
|
});
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2099.1.1111-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2099.1.1111-3`);
|
||||||
break;
|
break;
|
||||||
case 'linux':
|
case 'linux':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2099.1.1111-3`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -67,27 +74,33 @@ describe('ImageTag', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('returns the specific build platform', () => {
|
it('returns the specific build platform', () => {
|
||||||
const image = new ImageTag({ editorVersion: '2019.2.11f1', targetPlatform: 'WebGL' });
|
const image = new ImageTag({
|
||||||
|
editorVersion: '2019.2.11f1',
|
||||||
|
targetPlatform: 'WebGL',
|
||||||
|
});
|
||||||
|
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-webgl-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-webgl-3`);
|
||||||
break;
|
break;
|
||||||
case 'linux':
|
case 'linux':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-webgl-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-webgl-3`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns no specific build platform for generic targetPlatforms', () => {
|
it('returns no specific build platform for generic targetPlatforms', () => {
|
||||||
const image = new ImageTag({ editorVersion: '2019.2.11f1', targetPlatform: 'NoTarget' });
|
const image = new ImageTag({
|
||||||
|
editorVersion: '2019.2.11f1',
|
||||||
|
targetPlatform: 'NoTarget',
|
||||||
|
});
|
||||||
|
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'win32':
|
case 'win32':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:windows-2019.2.11f1-3`);
|
||||||
break;
|
break;
|
||||||
case 'linux':
|
case 'linux':
|
||||||
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-2`);
|
expect(image.toString()).toStrictEqual(`${defaults.image}:ubuntu-2019.2.11f1-3`);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -33,7 +33,7 @@ class ImageTag {
|
|||||||
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(
|
this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(
|
||||||
isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform,
|
isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform,
|
||||||
);
|
);
|
||||||
this.imageRollingVersion = 2; // Will automatically roll to the latest non-breaking version.
|
this.imageRollingVersion = 3; // Will automatically roll to the latest non-breaking version.
|
||||||
}
|
}
|
||||||
|
|
||||||
static get versionPattern(): RegExp {
|
static get versionPattern(): RegExp {
|
||||||
@ -86,8 +86,10 @@ class ImageTag {
|
|||||||
if (major >= 2020 || (major === 2019 && minor >= 3)) {
|
if (major >= 2020 || (major === 2019 && minor >= 3)) {
|
||||||
return windowsIl2cpp;
|
return windowsIl2cpp;
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
|
throw new Error(
|
||||||
If you are trying to build for windows-mono, please use a Linux based OS.`);
|
`Windows-based builds are only supported on 2019.3.X+ versions of Unity.
|
||||||
|
If you are trying to build for windows-mono, please use a Linux based OS.`,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user