Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"include": [
{
"os": "ubuntu-latest",
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
"build-targets": "StandaloneLinux64, Android, WebGL",
"modules": "linux-server"
},
{
Expand Down Expand Up @@ -70,7 +70,7 @@
{
"os": "ubuntu-latest",
"unity-version": "None",
"build-targets": "StandaloneLinux64, Android, iOS, WebGL",
"build-targets": "StandaloneLinux64, Android, WebGL",
"modules": "linux-server"
},
{
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,17 @@
UNITY_PROJECT_PATH: '' # set by the unity-setup action
BUILD_OUTPUT_PATH: ${{ github.workspace }}/Builds/${{ matrix.build-target }}
steps:
- name: Free Disk Space
if: ${{ matrix.os == 'ubuntu-latest' && matrix.unity-version == '6000.2' }}
uses: endersonmenezes/free-disk-space@v2
with:
remove_android: true
remove_dotnet: false
remove_tool_cache: false
- uses: actions/checkout@v5
- uses: ./ # RageAgainstThePixel/unity-setup
with:
version-file: 'None'
version-file: None
unity-version: ${{ matrix.unity-version }}
build-targets: ${{ matrix.build-targets }}
modules: ${{ matrix.modules }}
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
id: setup-jobs
with:
build-options: ./.github/workflows/build-options.json
group-by: 'unity-version'
group-by: unity-version
outputs:
jobs: ${{ steps.setup-jobs.outputs.jobs }}
validate:
Expand All @@ -43,3 +43,12 @@ jobs:
uses: ./.github/workflows/build.yml
with:
matrix: ${{ toJSON(matrix.jobs.matrix) }}
timeline:
needs: [setup, validate]
if: always()
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: Kesin11/actions-timeline@c2f474758e8e9ac6f37ec64a6442dead7fd1dad2 # v2.2.5
continue-on-error: true
61 changes: 40 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,29 @@ A GitHub Action for setting up the [Unity Game Engine](https://unity.com) on Git
```yaml
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
unity-version:
- 'in version file'
- 2019.4.40f1
- 2020.x
- 2021.3.x
- 2022.3
- 6000
include:
- os: ubuntu-latest
build-targets: StandaloneLinux64, Android, iOS
modules: linux-server
- os: windows-latest
build-targets: StandaloneWindows64, Android, WSAPlayer
modules: windows-server
- os: macos-13
build-targets: StandaloneOSX, Android, iOS
modules: mac-server
- os: macos-latest
build-targets: StandaloneOSX, Android, iOS, VisionOS
modules: mac-server
os: [ubuntu-latest, windows-latest, macos-latest]
unity-version:
- None
- 2019.4.40f1 (ffc62b691db5)
- 2020.x
- 2021.3.x
- 2022.3
- 6000.0.x
- 6000.1.*
- 6000
include:
- os: ubuntu-latest
build-targets: StandaloneLinux64, Android, iOS
modules: linux-server
- os: windows-latest
build-targets: StandaloneWindows64, Android, WSAPlayer
modules: windows-server
- os: macos-13
build-targets: StandaloneOSX, Android, iOS
modules: mac-server
- os: macos-latest
build-targets: StandaloneOSX, Android, iOS, VisionOS
modules: mac-server
steps:
- uses: RageAgainstThePixel/unity-setup@v2
with:
Expand Down Expand Up @@ -57,6 +59,23 @@ steps:
| `install-path` | Specify the path where Unity will be installed to. | false |
| `auto-update-hub` | Automatically update Unity Hub to the latest version before installing Unity Editors. Can be `true` or `false`. Default is `true`. | false |

#### unity-version formats

Use any of the following patterns to control how the editor version is resolved:

- Fully qualified: `2022.3.62f1` or `2019.4.40f1 (ffc62b691db5)`
- Major + minor: `6000.2` → latest stable in the 6000.2.x line
- Major only: `6000` or `2022` → latest stable in that major (e.g., `6000.2.1f1`, `2022.3.x`)
- Wildcards: `2021.3.x`, `2022.3.*`, `6000.0.x`
- Exact year+minor with trailing zero: `6000.0.0` confines selection to the 6000.0.x line

> [!NOTE]
>
> - If you want the latest across minors within a major, use just the major (e.g., `6000`).
> - If you want to stay within a specific minor, use `MAJOR.MINOR` (e.g., `6000.2`).
> - If you want to lock to the `.0` minor, use `6000.0.0` or `6000.0.x`.
> - Stable (f) releases are preferred unless you explicitly specify a pre-release (a/b/rc) version.

### outputs

- `UNITY_HUB_PATH`: The path to the installed unity hub.
Expand Down
8 changes: 4 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33742,7 +33742,7 @@ async function ValidateInputs() {
if (!installPath) {
core.debug('No install path specified, using default Unity Hub install path.');
}
return [versions, modules, unityProjectPath, installPath];
return { versions, modules, unityProjectPath, installPath };
}
function getArrayInput(key) {
let input = core.getInput(key);
Expand Down Expand Up @@ -63408,9 +63408,9 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __nccwpck_require__(2186);
const inputs_1 = __nccwpck_require__(7063);
const unity_cli_1 = __nccwpck_require__(4858);
const main = async () => {
async function main() {
try {
const [versions, modules, unityProjectPath, installPath] = await (0, inputs_1.ValidateInputs)();
const { versions, modules, unityProjectPath, installPath } = await (0, inputs_1.ValidateInputs)();
if (unityProjectPath) {
core.info(`UNITY_PROJECT_PATH:\n > ${unityProjectPath}`);
core.exportVariable('UNITY_PROJECT_PATH', unityProjectPath);
Expand Down Expand Up @@ -63446,7 +63446,7 @@ const main = async () => {
catch (error) {
core.setFailed(error.stack);
}
};
}
main();

})();
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "unity-setup",
"version": "2.0.7",
"version": "2.0.8",
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
"author": "RageAgainstThePixel",
"license": "MIT",
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import {
CheckAndroidSdkInstalled,
} from '@rage-against-the-pixel/unity-cli';

const main = async () => {
async function main() {
try {
const [versions, modules, unityProjectPath, installPath] = await ValidateInputs();
const { versions, modules, unityProjectPath, installPath } = await ValidateInputs();

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

const installedEditors: { version: string; path: string }[] = [];
const installedEditors: { version: string; path: string; }[] = [];

for (const unityVersion of versions) {
const unityEditor = await unityHub.GetEditor(unityVersion, modules);
Expand All @@ -53,6 +53,6 @@ const main = async () => {
} catch (error) {
core.setFailed(error.stack);
}
};
}

main();
4 changes: 2 additions & 2 deletions src/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ResolveGlobToPath
} from '@rage-against-the-pixel/unity-cli';

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

return [versions, modules, unityProjectPath, installPath];
return { versions, modules, unityProjectPath, installPath };
}

function getArrayInput(key: string): string[] {
Expand Down