Skip to content

Commit e85cf27

Browse files
- Initial Release! 🎉🚀
1 parent 2324a6f commit e85cf27

20 files changed

+35840
-25
lines changed

.github/workflows/validate.yml

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,52 @@ concurrency:
1313
cancel-in-progress: true
1414
jobs:
1515
validate:
16+
env:
17+
UNITY_EDITORS: '' # set by the unity-setup action
18+
UNITY_HUB_PATH: '' # set by the unity-setup action
19+
UNITY_EDITOR_PATH: '' # set by the unity-setup action
20+
UNITY_PROJECT_PATH: '' # set by the unity-setup action
1621
runs-on: ${{ matrix.os }}
1722
strategy:
1823
fail-fast: false
1924
matrix:
20-
os: [ubuntu-latest, windows-latest, macos-latest ]
25+
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
26+
unity-versions:
27+
- 2019.4.40f1 (ffc62b691db5)
28+
- 2020.3.48f1 (b805b124c6b7)
29+
- 2021.3.41f1 (6c5a9e20c022)
30+
- 2022.3.40f1 (cbdda657d2f0)
31+
- 6000.0.13f1 (53a692e3fca9)
32+
include:
33+
- os: ubuntu-latest
34+
build-targets: StandaloneLinux64, Android, iOS
35+
modules: linux-server
36+
- os: windows-latest
37+
build-targets: StandaloneWindows64, Android, WSAPlayer
38+
modules: windows-server
39+
- os: macos-13
40+
build-targets: StandaloneOSX, Android, iOS
41+
modules: mac-server
42+
- os: macos-latest
43+
build-targets: StandaloneOSX Android iOS VisionOS
44+
modules: mac-server
2145
steps:
2246
- uses: actions/checkout@v4
23-
- run: echo "hello world"
47+
- uses: actions/checkout@v4
48+
with:
49+
repository: RageAgainstThePixel/com.utilities.buildpipeine
50+
path: com.utilities.buildpipline
51+
ref: development
52+
53+
- uses: ./ # RageAgainstThePixel/unity-setup
54+
with:
55+
# version-file: 'com.utilities.buildpipline/Utilities.BuildPipeline/ProjectSettings/ProjectVersion.txt'
56+
unity-version: ${{ matrix.unity-versions }} # overrides the version in the version file
57+
build-targets: ${{ matrix.build-targets }}
58+
modules: ${{ matrix.modules }}
59+
60+
- run: |
61+
echo "UNITY_HUB_PATH: '${{ env.UNITY_HUB_PATH }}'"
62+
echo "UNITY_EDITORS: '${{ env.UNITY_EDITORS }}'"
63+
echo "UNITY_EDITOR_PATH: '${{ env.UNITY_EDITOR_PATH }}'"
64+
echo "UNITY_PROJECT_PATH: '${{ env.UNITY_PROJECT_PATH }}'"

README.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,57 @@
1-
# github-action-js-template
1+
# unity-setup
22

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.
44

55
## How to use
66

77
### workflow
88

99
```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
1027
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 }}'"
1240
```
1341
1442
### inputs
1543
1644
| 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 |
1951

2052
### 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"}`.

action.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
name: <github-action>
2-
description: 'A GitHub Actions template repository for JavaScript based Actions'
3-
# inputs:
4-
# outputs:
1+
name: 'unity-setup'
2+
description: 'A GitHub action for setting up the Unity Game Engine for CI/CD workflows.'
3+
inputs:
4+
version-file:
5+
description: 'Specify a path to search for the unity project version text file. Useful if there are multiple projects in a single repo.'
6+
required: false
7+
default: ''
8+
unity-version:
9+
description: '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`!***'
10+
required: false
11+
default: ''
12+
build-targets:
13+
description: 'Specify the build targets to install modules for. One or more of `StandaloneWindows64` `WSAPlayer` `StandaloneOSX` `iOS` `StandaloneLinux64` `Android` `Lumin` `WebGL`.'
14+
required: false
15+
default: ''
16+
modules:
17+
description: 'Modules to install with the editor. This list can be different per editor version.'
18+
required: false
19+
default: ''
20+
architecture:
21+
description: 'Specify the architecture to install. Either `x86_64` or `arm64`.'
22+
required: false
23+
default: ''
524
runs:
625
using: 'node20'
726
main: 'dist/index.js'
8-
#post: 'dist/index.js'

0 commit comments

Comments
 (0)