Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
6fb6cc9
[email protected]
StephenHodgson Oct 23, 2025
66e45a9
show process
StephenHodgson Oct 23, 2025
07708e6
test hub only install
StephenHodgson Oct 23, 2025
7bdb473
tweak
StephenHodgson Oct 23, 2025
e177bfc
slightly different
StephenHodgson Oct 23, 2025
ceeaefa
revert
StephenHodgson Oct 23, 2025
62b6651
test job-bulider@development
StephenHodgson Oct 23, 2025
88f6ba5
throw error of we can't find which unityhub
StephenHodgson Oct 23, 2025
e450df9
try w/o hyphen
StephenHodgson Oct 24, 2025
981510c
remove another hyphen
StephenHodgson Oct 24, 2025
8e30870
revert
StephenHodgson Oct 24, 2025
e5287d8
install a specific version of unity hub
StephenHodgson Oct 24, 2025
8c3ff23
revert some stuff
StephenHodgson Oct 24, 2025
357fb91
revert more
StephenHodgson Oct 24, 2025
0276974
test unity hub 3.14.3
StephenHodgson Oct 24, 2025
9459651
print version on successful installation
StephenHodgson Oct 24, 2025
faa306b
test setting hub version on install
StephenHodgson Oct 28, 2025
f75001c
fix
StephenHodgson Oct 28, 2025
217ed67
don't install twice
StephenHodgson Oct 28, 2025
083d48e
remove dup logging
StephenHodgson Oct 28, 2025
a6f2456
revert
StephenHodgson Oct 28, 2025
8d6c1ca
show me the file buffer on error
StephenHodgson Oct 28, 2025
05077de
delete different
StephenHodgson Oct 28, 2025
2d17726
revert linux installer upgrade
StephenHodgson Oct 28, 2025
a0756e9
list all files under the asar path
StephenHodgson Oct 28, 2025
1594f10
remove list
StephenHodgson Oct 28, 2025
dfb7261
updated readme
StephenHodgson Oct 28, 2025
d2fd1b6
reorder
StephenHodgson Oct 28, 2025
50de2c5
TOC
StephenHodgson Oct 28, 2025
e1f05d0
reorganize readme
StephenHodgson Oct 28, 2025
77ef939
TOC
StephenHodgson Oct 28, 2025
f7a3651
cleanup
StephenHodgson Oct 28, 2025
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
12 changes: 12 additions & 0 deletions .github/workflows/build-options.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
"6000.2"
],
"include": [
{
"os": "ubuntu-latest",
"unity-version": "none"
},
{
"os": "ubuntu-latest",
"build-target": "StandaloneLinux64"
Expand All @@ -31,10 +35,18 @@
"os": "ubuntu-latest",
"build-target": "Android"
},
{
"os": "windows-latest",
"unity-version": "none"
},
{
"os": "windows-latest",
"build-target": "StandaloneWindows64"
},
{
"os": "macos-latest",
"unity-version": "none"
},
{
"os": "windows-latest",
"build-target": "Android"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- uses: actions/checkout@v5
with:
sparse-checkout: .github/
- uses: RageAgainstThePixel/job-builder@v1
- uses: RageAgainstThePixel/job-builder@development
id: setup-jobs
with:
build-options: ./.github/workflows/build-options.json
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/unity-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ jobs:
timeout-minutes: 30
run: |
unity-cli hub-install --auto-update
unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-target }}" --json
if [ "${{ matrix.unity-version }}" != "none" ]; then
unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-target }}" --json
fi
- name: Verify UNITY_HUB_PATH and UNITY_EDITOR_PATH variables
shell: bash
run: |
Expand All @@ -61,20 +63,23 @@ jobs:
exit 1
fi

if [ -z "${UNITY_EDITOR_PATH}" ]; then
if [ "${{ matrix.unity-version }}" != "none" ] && [ -z "${UNITY_EDITOR_PATH}" ]; then
echo "Error: UNITY_EDITOR_PATH is not set"
exit 1
fi
- name: Activate License
if : ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
- name: Create Unity Project
if : ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
unity-cli list-project-templates --unity-editor "${UNITY_EDITOR_PATH}" --json
unity-cli create-project --name "Unity Project" --unity-editor "${UNITY_EDITOR_PATH}" --json
- name: Verify UNITY_PROJECT_PATH variable
if : ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
if [ -z "${UNITY_PROJECT_PATH}" ]; then
Expand Down Expand Up @@ -119,6 +124,7 @@ jobs:
unity-cli run --log-name Validate -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
unity-cli run --log-name Build -buildTarget ${{ matrix.build-target }} -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity ${{ matrix.build-args }}
- name: Uninstall Editor
if: ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
if [ -z "${UNITY_EDITOR_PATH}" ]; then
Expand Down
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": "@rage-against-the-pixel/unity-cli",
"version": "1.5.0",
"version": "1.5.1",
"description": "A command line utility for the Unity Game Engine.",
"author": "RageAgainstThePixel",
"license": "MIT",
Expand Down
8 changes: 8 additions & 0 deletions src/unity-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ export class UnityEditor {

this.autoAddNoGraphics = this.version.isGreaterThan('2018.0.0');

// check if we have permissions to write to this file
try {
fs.accessSync(this.editorRootPath, fs.constants.W_OK);
} catch (error) {
return;
}

// ensure metadata.hub.json exists and has a productName entry
const hubMetaDataPath = path.join(this.editorRootPath, 'metadata.hub.json');
if (!fs.existsSync(hubMetaDataPath)) {
const metadata = {
Expand Down
4 changes: 2 additions & 2 deletions src/unity-hub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ sudo apt-get install -y --no-install-recommends --only-upgrade unityhub`]);
}
case 'linux': {
await Exec('sudo', ['sh', '-c', `#!/bin/bash
set -e
set -xe
dbus-uuidgen >/etc/machine-id && mkdir -p /var/lib/dbus/ && ln -sf /etc/machine-id /var/lib/dbus/machine-id
wget -qO - https://hub.unity3d.com/linux/keys/public | gpg --dearmor | tee /usr/share/keyrings/Unity_Technologies_ApS.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/Unity_Technologies_ApS.gpg] https://hub.unity3d.com/linux/repos/deb stable main" > /etc/apt/sources.list.d/unityhub.list
echo "deb https://archive.ubuntu.com/ubuntu jammy main universe" | tee /etc/apt/sources.list.d/jammy.list
apt-get update
sudo apt-get update --allow-releaseinfo-change
apt-get install -y --no-install-recommends unityhub ffmpeg libgtk2.0-0 libglu1-mesa libgconf-2-4 libncurses5
apt-get clean
sed -i 's/^\\(.*DISPLAY=:.*XAUTHORITY=.*\\)\\( "\\$@" \\)2>&1$/\\1\\2/' /usr/bin/xvfb-run
Expand Down
2 changes: 1 addition & 1 deletion src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export async function Exec(command: string, args: string[], options: ExecOptions
}

if (exitCode !== 0) {
throw new Error(`${command} failed with exit code ${exitCode}`);
throw new Error(`${command} failed with exit code ${exitCode}\n${output}`);
}
}

Expand Down
Loading