Skip to content

Commit 0c0d266

Browse files
unity-setup@v2.1.0 (#40)
- added `hub-version` input option to manually specify a version of unity-hub to install - updated unity-cli@v1.5.1
1 parent 54ca9f3 commit 0c0d266

File tree

9 files changed

+347
-130
lines changed

9 files changed

+347
-130
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ jobs:
3939
build-targets: ${{ matrix.build-targets }}
4040
modules: ${{ matrix.modules }}
4141
auto-update-hub: ${{ !contains(matrix.modules, 'None') }}
42+
hub-version: ${{ contains(matrix.modules, 'None') && '3.12.0' || '' }}
4243
- run: |
4344
echo 'UNITY_HUB_PATH: ${{ env.UNITY_HUB_PATH }}'
4445
echo 'UNITY_EDITORS: ${{ env.UNITY_EDITORS }}'

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ steps:
5757
| `architecture` | Specify the architecture to install. Either `x86_64` or `arm64`. | false |
5858
| `install-path` | Specify the path where Unity will be installed to. | false |
5959
| `auto-update-hub` | Automatically update Unity Hub to the latest version before installing Unity Editors. Can be `true` or `false`. Default is `true`. | false |
60+
| `hub-version` | Specify a specific version of Unity Hub to install. Example: `3.12.0`. Cannot be used with `auto-update-hub`. | false |
6061

6162
#### unity-version formats
6263

action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ inputs:
3131
description: 'Automatically update Unity Hub to the latest version before installing Unity Editors. Can be `true` or `false`.'
3232
required: false
3333
default: 'true'
34+
hub-version:
35+
description: 'Specify a specific version of Unity Hub to install. Example: `3.12.0`. Cannot be used with `auto-update-hub` set to `true`.'
36+
required: false
37+
default: ''
3438
runs:
3539
using: node20
3640
main: dist/index.js

dist/index.js

Lines changed: 234 additions & 79 deletions
Large diffs are not rendered by default.

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.

dist/licenses.txt

Lines changed: 53 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -258,22 +258,62 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
258258

259259

260260
minimatch
261-
ISC
262-
The ISC License
261+
BlueOak-1.0.0
262+
# Blue Oak Model License
263263

264-
Copyright (c) 2011-2023 Isaac Z. Schlueter and Contributors
264+
Version 1.0.0
265265

266-
Permission to use, copy, modify, and/or distribute this software for any
267-
purpose with or without fee is hereby granted, provided that the above
268-
copyright notice and this permission notice appear in all copies.
266+
## Purpose
269267

270-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
271-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
272-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
273-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
274-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
275-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
276-
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
268+
This license gives everyone as much permission to work with
269+
this software as possible, while protecting contributors
270+
from liability.
271+
272+
## Acceptance
273+
274+
In order to receive this license, you must agree to its
275+
rules. The rules of this license are both obligations
276+
under that agreement and conditions to your license.
277+
You must not do anything with this software that triggers
278+
a rule that you cannot or will not follow.
279+
280+
## Copyright
281+
282+
Each contributor licenses you to do everything with this
283+
software that would otherwise infringe that contributor's
284+
copyright in it.
285+
286+
## Notices
287+
288+
You must ensure that everyone who gets a copy of
289+
any part of this software from you, with or without
290+
changes, also gets the text of this license or a link to
291+
<https://blueoakcouncil.org/license/1.0.0>.
292+
293+
## Excuse
294+
295+
If anyone notifies you in writing that you have not
296+
complied with [Notices](#notices), you can keep your
297+
license by taking all practical steps to comply within 30
298+
days after the notice. If you do not do so, your license
299+
ends immediately.
300+
301+
## Patent
302+
303+
Each contributor licenses you to do everything with this
304+
software that would otherwise infringe any patent claims
305+
they can license or become able to license.
306+
307+
## Reliability
308+
309+
No contributor can revoke this license.
310+
311+
## No Liability
312+
313+
**_As far as the law allows, this software comes as is,
314+
without any warranty or condition, and no contributor
315+
will be liable to anyone for any damages related to this
316+
software or this license, under any kind of legal claim._**
277317

278318

279319
minipass

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unity-setup",
3-
"version": "2.0.1",
3+
"version": "2.1.0",
44
"description": "A GitHub action for setting up the Unity Game Engine for CI/CD workflows.",
55
"author": "Buildalon",
66
"license": "MIT",
@@ -27,12 +27,12 @@
2727
"@actions/core": "^1.11.1",
2828
"@actions/exec": "^1.1.1",
2929
"@actions/glob": "^0.5.0",
30-
"@rage-against-the-pixel/unity-cli": "^1.5.0",
30+
"@rage-against-the-pixel/unity-cli": "^1.5.1",
3131
"semver": "^7.7.3",
3232
"yaml": "^2.8.1"
3333
},
3434
"devDependencies": {
35-
"@types/node": "^22.18.12",
35+
"@types/node": "^22.18.13",
3636
"@types/semver": "^7.7.1",
3737
"@vercel/ncc": "^0.34.0",
3838
"shx": "^0.4.0",
@@ -44,4 +44,4 @@
4444
"watch": "ncc build src/index.ts -o dist --source-map --license licenses.txt --watch",
4545
"clean": "npm install && shx rm -rf dist/ out/ node_modules/ && npm ci"
4646
}
47-
}
47+
}

src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ async function main() {
1515
}
1616

1717
const autoUpdate = core.getInput('auto-update-hub');
18+
const hubVersion = core.getInput('hub-version');
19+
20+
if (autoUpdate === 'true' && hubVersion && hubVersion.length > 0) {
21+
throw new Error('Cannot specify a specific Unity Hub version when auto-update is set to true.');
22+
}
23+
1824
const unityHub = new UnityHub();
19-
const unityHubPath = await unityHub.Install(autoUpdate === 'true');
25+
const unityHubPath = await unityHub.Install(autoUpdate === 'true', hubVersion);
2026

2127
if (!unityHubPath || unityHubPath.length === 0) {
2228
throw new Error('Failed to install or locate Unity Hub!');

0 commit comments

Comments
 (0)