|
1 | | -# github-action-js-template |
| 1 | +# unity-setup |
2 | 2 |
|
3 | | -A GitHub Actions template repository for JavaScript based Actions |
| 3 | +A GitHub Action for setting up the [Unity Game Engine](https://unity.com) on GitHub Action Runners. |
4 | 4 |
|
5 | 5 | ## How to use |
6 | 6 |
|
7 | 7 | ### workflow |
8 | 8 |
|
9 | 9 | ```yaml |
| 10 | +strategy: |
| 11 | + matrix: |
| 12 | + os: [ubuntu-latest, windows-latest, macos-13, macos-latest] |
| 13 | + unity-versions: [2020.3.48f1 (b805b124c6b7), 2021.3.41f1 (6c5a9e20c022), 2022.3.40f1 (cbdda657d2f0)] |
| 14 | + include: |
| 15 | + - os: ubuntu-latest |
| 16 | + build-targets: StandaloneLinux64, Android, iOS |
| 17 | + modules: linux-server |
| 18 | + - os: windows-latest |
| 19 | + build-targets: StandaloneWindows64, Android, WSAPlayer |
| 20 | + modules: windows-server |
| 21 | + - os: macos-13 |
| 22 | + build-targets: StandaloneOSX, Android, iOS |
| 23 | + modules: mac-server |
| 24 | + - os: macos-latest |
| 25 | + build-targets: StandaloneOSX, Android, iOS, VisionOS |
| 26 | + modules: mac-server |
10 | 27 | steps: |
11 | | - - uses: RageAgainstThePixel/<github-action>@v1 |
| 28 | + - uses: RageAgainstThePixel/unity-setup@v1 |
| 29 | + with: |
| 30 | + version-file: 'path/to/your/ProjectSettings.ProjectVersion.txt' |
| 31 | + unity-version: ${{ matrix.unity-versions }} # overrides version in version-file |
| 32 | + build-targets: ${{ matrix.build-targets }} |
| 33 | + modules: ${{ matrix.modules }} |
| 34 | + |
| 35 | + - run: | |
| 36 | + echo "UNITY_HUB_PATH: '${{ env.UNITY_HUB_PATH }}'" |
| 37 | + echo "UNITY_EDITORS: '${{ env.UNITY_EDITORS }}'" |
| 38 | + echo "UNITY_EDITOR_PATH: '${{ env.UNITY_EDITOR_PATH }}'" |
| 39 | + echo "UNITY_PROJECT_PATH: '${{ env.UNITY_PROJECT_PATH }}'" |
12 | 40 | ``` |
13 | 41 |
|
14 | 42 | ### inputs |
15 | 43 |
|
16 | 44 | | name | description | required | |
17 | | -| ---- | ----------- | -------- | |
18 | | -| .... | ........... | ........ | |
| 45 | +| ----------- | ----------- | ----------- | |
| 46 | +| `version-file` | Specify a path to search for the unity project version text file. Useful if there are multiple projects in a single repo. | false | |
| 47 | +| `unity-version` | Specify the Unity version(s) to install. You must include the changeset! i.e `2019.4.13f1 (518737b1de84)`. ***This will override any version specified in the `version-file`!*** | false | |
| 48 | +| `build-targets` | Specify the build targets to install for. Remaps to corresponding module. One or more of `StandaloneWindows64` `WSAPlayer` `StandaloneOSX` `iOS` `StandaloneLinux64` `Android` `Lumin` `WebGL`. | false | |
| 49 | +| `modules` | Modules to install with the editor. This list can be different per editor version. | false | |
| 50 | +| `architecture` | Specify the architecture to install. Either `x86_64` or `arm64`. | false | |
19 | 51 |
|
20 | 52 | ### outputs |
| 53 | + |
| 54 | +- `UNITY_HUB_PATH`: The path to the installed unity hub. |
| 55 | +- `UNITY_PROJECT_PATH`: The path to the Unity project. |
| 56 | +- `UNITY_EDITOR_PATH`: The path to the last installed version of Unity. |
| 57 | +- `UNITY_EDITORS`: A json object of each editor installation `{"version":"path"}`. |
0 commit comments