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
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
with:
sparse-checkout: .github/
- uses: RageAgainstThePixel/job-builder@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
permissions:
contents: read
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24.x
Expand Down
37 changes: 12 additions & 25 deletions .github/workflows/unity-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: unity-build
permissions:
contents: read
on:
workflow_call:
inputs:
Expand All @@ -15,35 +13,34 @@ on:
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix: ${{ fromJSON(inputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.os }}
permissions:
contents: read
defaults:
run:
shell: bash
env:
UNITY_PROJECT_PATH: '' # Set from create-project step
UNITY_PROJECT_PATH: '' # Create Unity Project step will set this if needed
steps:
- name: Free Disk Space
if: ${{ matrix.os == 'ubuntu-latest' && (matrix.unity-version != '2018' && matrix.unity-version != '2017.4.40f1') }}
uses: endersonmenezes/free-disk-space@713d134e243b926eba4a5cce0cf608bfd1efb89a # v2.1.1
uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3.1.0
with:
remove_android: true
remove_dotnet: false
remove_tool_cache: false
- uses: actions/checkout@v5
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Setup unity-cli
shell: bash
run: |
npm ci
npm run build
npm run link
unity-cli --version
- name: Setup Unity
shell: bash
timeout-minutes: 30
run: |
unity-cli hub-install --hub-version 3.12.0
Expand All @@ -53,7 +50,6 @@ jobs:
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: |
echo "UNITY_HUB_PATH: ${UNITY_HUB_PATH}"
echo "UNITY_EDITOR_PATH: ${UNITY_EDITOR_PATH}"
Expand All @@ -70,20 +66,17 @@ jobs:
fi
- name: Activate License
if: ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
unity-cli license-context
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' }}
id: verify-project-path
shell: bash
run: |
if [ -z "${UNITY_PROJECT_PATH}" ]; then
echo "::error::UNITY_PROJECT_PATH is not set"
Expand All @@ -105,15 +98,13 @@ jobs:
echo "Skipping build: Unity version $version does not support the build pipeline package (requires 2019.4+)"
fi
- name: Install OpenUPM and build pipeline package
shell: bash
if: ${{ steps.verify-project-path.outputs.RUN_BUILD == 'true' }}
working-directory: ${{ env.UNITY_PROJECT_PATH }}
run: |
npm install -g openupm-cli
cd "${UNITY_PROJECT_PATH}"
openupm add com.utilities.buildpipeline
- name: Update Android Target Sdk Version
if: ${{ matrix.build-target == 'Android' }}
shell: bash
run: |
# update AndroidTargetSdkVersion to 32 in ProjectSettings/ProjectSettings.asset
sed -i 's/AndroidTargetSdkVersion: [0-9]*/AndroidTargetSdkVersion: 32/' "${UNITY_PROJECT_PATH}/ProjectSettings/ProjectSettings.asset"
Expand All @@ -122,13 +113,12 @@ jobs:
- name: Build Project
if: ${{ steps.verify-project-path.outputs.RUN_BUILD == 'true' }}
timeout-minutes: 60
shell: bash
run: |
# we don't have to specify the project path or unity editor path as unity-cli will use the environment variables
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
echo "UNITY_EDITOR_PATH is not set, skipping uninstall"
Expand All @@ -137,7 +127,6 @@ jobs:
unity-cli uninstall-unity --unity-editor "${UNITY_EDITOR_PATH}"
- name: Print log paths
if: ${{ matrix.unity-version != 'none' }}
shell: bash
run: |
HUB_LOG_PATH=$(unity-cli hub-logs)
PACKAGE_MANAGER_LOG_PATH=$(unity-cli package-manager-logs)
Expand All @@ -160,11 +149,11 @@ jobs:
fi
# print all files found in ~/.config/
find ~/.config/ -type f -exec echo "{}" \;
echo "::error:: Hub log file does not exist at any known location"
echo "::warning:: Hub log file does not exist at any known location"
fi

if [ ! -f "${PACKAGE_MANAGER_LOG_PATH}" ]; then
echo "::error::Package Manager log file does not exist at ${PACKAGE_MANAGER_LOG_PATH}"
echo "::warning::Package Manager log file does not exist at ${PACKAGE_MANAGER_LOG_PATH}"
fi

if [ ! -f "${LICENSING_CLIENT_LOG_PATH}" ]; then
Expand All @@ -176,6 +165,4 @@ jobs:
fi
- name: Return License
if: always()
shell: bash
run: |
unity-cli return-license --license personal
run: unity-cli return-license --license personal
30 changes: 15 additions & 15 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions 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.8.0",
"version": "1.8.1",
"description": "A command line utility for the Unity Game Engine.",
"author": "RageAgainstThePixel",
"license": "MIT",
Expand Down Expand Up @@ -60,12 +60,12 @@
},
"devDependencies": {
"@types/jest": "^30.0.0",
"@types/node": "^24.10.1",
"@types/node": "^24.10.4",
"@types/semver": "^7.7.1",
"@types/update-notifier": "^6.0.8",
"jest": "^30.2.0",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"typescript": "^5.9.3"
}
}
}
2 changes: 1 addition & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ program.command('open-project')

program.command('editor-logs')
.description('Prints the path to the Unity Editor log files.')
.action(async (options) => {
.action(async () => {
const unityEditorLogsPath = UnityEditor.GetEditorLogsDirectory();
process.stdout.write(`${unityEditorLogsPath}\n`);
process.exit(0);
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export * from './unity-hub';
export * from './unity-project';
export * from './unity-version';
export * from './utilities';
export * from './unity-logging';
2 changes: 1 addition & 1 deletion src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as fs from 'fs';
export enum LogLevel {
DEBUG = 'debug',
CI = 'ci',
UTP = 'utp',
UTP = 'utp', // minimal logging level
INFO = 'info',
WARN = 'warning',
ERROR = 'error',
Expand Down
Loading
Loading