Skip to content

Commit a1e2b54

Browse files
unity-setup@v2.0.8 (#56)
- misc refactoring - updated readme - removed iOS module from linux tests - added timeline workflow reporting
1 parent 6c014e7 commit a1e2b54

File tree

10 files changed

+74
-39
lines changed

10 files changed

+74
-39
lines changed

.github/workflows/build-options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"include": [
2020
{
2121
"os": "ubuntu-latest",
22-
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
22+
"build-targets": "StandaloneLinux64, Android, WebGL",
2323
"modules": "linux-server"
2424
},
2525
{
@@ -70,7 +70,7 @@
7070
{
7171
"os": "ubuntu-latest",
7272
"unity-version": "None",
73-
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
73+
"build-targets": "StandaloneLinux64, Android, WebGL",
7474
"modules": "linux-server"
7575
},
7676
{

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,17 @@ jobs:
2424
UNITY_PROJECT_PATH: '' # set by the unity-setup action
2525
BUILD_OUTPUT_PATH: ${{ github.workspace }}/Builds/${{ matrix.build-target }}
2626
steps:
27+
- name: Free Disk Space
28+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.unity-version == '6000.2' }}
29+
uses: endersonmenezes/free-disk-space@v2
30+
with:
31+
remove_android: true
32+
remove_dotnet: false
33+
remove_tool_cache: false
2734
- uses: actions/checkout@v5
2835
- uses: ./ # RageAgainstThePixel/unity-setup
2936
with:
30-
version-file: 'None'
37+
version-file: None
3138
unity-version: ${{ matrix.unity-version }}
3239
build-targets: ${{ matrix.build-targets }}
3340
modules: ${{ matrix.modules }}

.github/workflows/validate.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
id: setup-jobs
2727
with:
2828
build-options: ./.github/workflows/build-options.json
29-
group-by: 'unity-version'
29+
group-by: unity-version
3030
outputs:
3131
jobs: ${{ steps.setup-jobs.outputs.jobs }}
3232
validate:
@@ -43,3 +43,12 @@ jobs:
4343
uses: ./.github/workflows/build.yml
4444
with:
4545
matrix: ${{ toJSON(matrix.jobs.matrix) }}
46+
timeline:
47+
needs: [setup, validate]
48+
if: always()
49+
runs-on: ubuntu-latest
50+
permissions:
51+
contents: read
52+
steps:
53+
- uses: Kesin11/actions-timeline@c2f474758e8e9ac6f37ec64a6442dead7fd1dad2 # v2.2.5
54+
continue-on-error: true

README.md

Lines changed: 40 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,29 @@ A GitHub Action for setting up the [Unity Game Engine](https://unity.com) on Git
99
```yaml
1010
strategy:
1111
matrix:
12-
os: [ubuntu-latest, windows-latest, macos-latest]
13-
unity-version:
14-
- 'in version file'
15-
- 2019.4.40f1
16-
- 2020.x
17-
- 2021.3.x
18-
- 2022.3
19-
- 6000
20-
include:
21-
- os: ubuntu-latest
22-
build-targets: StandaloneLinux64, Android, iOS
23-
modules: linux-server
24-
- os: windows-latest
25-
build-targets: StandaloneWindows64, Android, WSAPlayer
26-
modules: windows-server
27-
- os: macos-13
28-
build-targets: StandaloneOSX, Android, iOS
29-
modules: mac-server
30-
- os: macos-latest
31-
build-targets: StandaloneOSX, Android, iOS, VisionOS
32-
modules: mac-server
12+
os: [ubuntu-latest, windows-latest, macos-latest]
13+
unity-version:
14+
- None
15+
- 2019.4.40f1 (ffc62b691db5)
16+
- 2020.x
17+
- 2021.3.x
18+
- 2022.3
19+
- 6000.0.x
20+
- 6000.1.*
21+
- 6000
22+
include:
23+
- os: ubuntu-latest
24+
build-targets: StandaloneLinux64, Android, iOS
25+
modules: linux-server
26+
- os: windows-latest
27+
build-targets: StandaloneWindows64, Android, WSAPlayer
28+
modules: windows-server
29+
- os: macos-13
30+
build-targets: StandaloneOSX, Android, iOS
31+
modules: mac-server
32+
- os: macos-latest
33+
build-targets: StandaloneOSX, Android, iOS, VisionOS
34+
modules: mac-server
3335
steps:
3436
- uses: RageAgainstThePixel/unity-setup@v2
3537
with:
@@ -57,6 +59,23 @@ steps:
5759
| `install-path` | Specify the path where Unity will be installed to. | false |
5860
| `auto-update-hub` | Automatically update Unity Hub to the latest version before installing Unity Editors. Can be `true` or `false`. Default is `true`. | false |
5961

62+
#### unity-version formats
63+
64+
Use any of the following patterns to control how the editor version is resolved:
65+
66+
- Fully qualified: `2022.3.62f1` or `2019.4.40f1 (ffc62b691db5)`
67+
- Major + minor: `6000.2` → latest stable in the 6000.2.x line
68+
- Major only: `6000` or `2022` → latest stable in that major (e.g., `6000.2.1f1`, `2022.3.x`)
69+
- Wildcards: `2021.3.x`, `2022.3.*`, `6000.0.x`
70+
- Exact year+minor with trailing zero: `6000.0.0` confines selection to the 6000.0.x line
71+
72+
> [!NOTE]
73+
>
74+
> - If you want the latest across minors within a major, use just the major (e.g., `6000`).
75+
> - If you want to stay within a specific minor, use `MAJOR.MINOR` (e.g., `6000.2`).
76+
> - If you want to lock to the `.0` minor, use `6000.0.0` or `6000.0.x`.
77+
> - Stable (f) releases are preferred unless you explicitly specify a pre-release (a/b/rc) version.
78+
6079
### outputs
6180

6281
- `UNITY_HUB_PATH`: The path to the installed unity hub.

dist/index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33742,7 +33742,7 @@ async function ValidateInputs() {
3374233742
if (!installPath) {
3374333743
core.debug('No install path specified, using default Unity Hub install path.');
3374433744
}
33745-
return [versions, modules, unityProjectPath, installPath];
33745+
return { versions, modules, unityProjectPath, installPath };
3374633746
}
3374733747
function getArrayInput(key) {
3374833748
let input = core.getInput(key);
@@ -63408,9 +63408,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
6340863408
const core = __nccwpck_require__(2186);
6340963409
const inputs_1 = __nccwpck_require__(7063);
6341063410
const unity_cli_1 = __nccwpck_require__(4858);
63411-
const main = async () => {
63411+
async function main() {
6341263412
try {
63413-
const [versions, modules, unityProjectPath, installPath] = await (0, inputs_1.ValidateInputs)();
63413+
const { versions, modules, unityProjectPath, installPath } = await (0, inputs_1.ValidateInputs)();
6341463414
if (unityProjectPath) {
6341563415
core.info(`UNITY_PROJECT_PATH:\n > ${unityProjectPath}`);
6341663416
core.exportVariable('UNITY_PROJECT_PATH', unityProjectPath);
@@ -63446,7 +63446,7 @@ const main = async () => {
6344663446
catch (error) {
6344763447
core.setFailed(error.stack);
6344863448
}
63449-
};
63449+
}
6345063450
main();
6345163451

6345263452
})();

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "2.0.7",
3+
"version": "2.0.8",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",

src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ import {
55
CheckAndroidSdkInstalled,
66
} from '@rage-against-the-pixel/unity-cli';
77

8-
const main = async () => {
8+
async function main() {
99
try {
10-
const [versions, modules, unityProjectPath, installPath] = await ValidateInputs();
10+
const { versions, modules, unityProjectPath, installPath } = await ValidateInputs();
1111

1212
if (unityProjectPath) {
1313
core.info(`UNITY_PROJECT_PATH:\n > ${unityProjectPath}`);
@@ -29,7 +29,7 @@ const main = async () => {
2929
await unityHub.SetInstallPath(installPath);
3030
}
3131

32-
const installedEditors: { version: string; path: string }[] = [];
32+
const installedEditors: { version: string; path: string; }[] = [];
3333

3434
for (const unityVersion of versions) {
3535
const unityEditor = await unityHub.GetEditor(unityVersion, modules);
@@ -53,6 +53,6 @@ const main = async () => {
5353
} catch (error) {
5454
core.setFailed(error.stack);
5555
}
56-
};
56+
}
5757

5858
main();

src/inputs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ResolveGlobToPath
99
} from '@rage-against-the-pixel/unity-cli';
1010

11-
export async function ValidateInputs(): Promise<[UnityVersion[], string[], string | null, string]> {
11+
export async function ValidateInputs(): Promise<{ versions: UnityVersion[], modules: string[], unityProjectPath: string | null, installPath: string }> {
1212
const modules: string[] = [];
1313
const architectureInput = core.getInput('architecture') || getInstallationArch();
1414
let architecture: 'X86_64' | 'ARM64' | null = null;
@@ -115,7 +115,7 @@ export async function ValidateInputs(): Promise<[UnityVersion[], string[], strin
115115
core.debug('No install path specified, using default Unity Hub install path.');
116116
}
117117

118-
return [versions, modules, unityProjectPath, installPath];
118+
return { versions, modules, unityProjectPath, installPath };
119119
}
120120

121121
function getArrayInput(key: string): string[] {

0 commit comments

Comments
 (0)