Skip to content

Commit 89e7372

Browse files
- cleanup unity telemetry logging
1 parent f36f87f commit 89e7372

File tree

12 files changed

+403
-171
lines changed

12 files changed

+403
-171
lines changed

.github/workflows/integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
permissions:
1717
contents: read
1818
steps:
19-
- uses: actions/checkout@v5
19+
- uses: actions/checkout@v6
2020
with:
2121
sparse-checkout: .github/
2222
- uses: RageAgainstThePixel/job-builder@v1

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
permissions:
1010
contents: read
1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@v6
1313
- uses: actions/setup-node@v6
1414
with:
1515
node-version: 24.x

.github/workflows/unity-build.yml

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: unity-build
2-
permissions:
3-
contents: read
42
on:
53
workflow_call:
64
inputs:
@@ -15,35 +13,34 @@ on:
1513
jobs:
1614
build:
1715
name: ${{ matrix.name }}
16+
runs-on: ${{ matrix.os }}
1817
strategy:
1918
matrix: ${{ fromJSON(inputs.matrix) }}
2019
fail-fast: false
21-
runs-on: ${{ matrix.os }}
22-
permissions:
23-
contents: read
20+
defaults:
21+
run:
22+
shell: bash
2423
env:
25-
UNITY_PROJECT_PATH: '' # Set from create-project step
24+
UNITY_PROJECT_PATH: '' # Create Unity Project step will set this if needed
2625
steps:
2726
- name: Free Disk Space
2827
if: ${{ matrix.os == 'ubuntu-latest' && (matrix.unity-version != '2018' && matrix.unity-version != '2017.4.40f1') }}
29-
uses: endersonmenezes/free-disk-space@713d134e243b926eba4a5cce0cf608bfd1efb89a # v2.1.1
28+
uses: endersonmenezes/free-disk-space@e6ed9b02e683a3b55ed0252f1ee469ce3b39a885 # v3.1.0
3029
with:
3130
remove_android: true
3231
remove_dotnet: false
3332
remove_tool_cache: false
34-
- uses: actions/checkout@v5
33+
- uses: actions/checkout@v6
3534
- uses: actions/setup-node@v6
3635
with:
3736
node-version: 24.x
3837
- name: Setup unity-cli
39-
shell: bash
4038
run: |
4139
npm ci
4240
npm run build
4341
npm run link
4442
unity-cli --version
4543
- name: Setup Unity
46-
shell: bash
4744
timeout-minutes: 30
4845
run: |
4946
unity-cli hub-install --hub-version 3.12.0
@@ -53,7 +50,6 @@ jobs:
5350
unity-cli setup-unity --unity-version "${{ matrix.unity-version }}" --build-targets "${{ matrix.build-target }}" --json
5451
fi
5552
- name: Verify UNITY_HUB_PATH and UNITY_EDITOR_PATH variables
56-
shell: bash
5753
run: |
5854
echo "UNITY_HUB_PATH: ${UNITY_HUB_PATH}"
5955
echo "UNITY_EDITOR_PATH: ${UNITY_EDITOR_PATH}"
@@ -70,20 +66,17 @@ jobs:
7066
fi
7167
- name: Activate License
7268
if: ${{ matrix.unity-version != 'none' }}
73-
shell: bash
7469
run: |
7570
unity-cli license-context
7671
unity-cli activate-license --license personal --email "${{ secrets.UNITY_USERNAME }}" --password "${{ secrets.UNITY_PASSWORD }}"
7772
- name: Create Unity Project
7873
if: ${{ matrix.unity-version != 'none' }}
79-
shell: bash
8074
run: |
8175
unity-cli list-project-templates --unity-editor "${UNITY_EDITOR_PATH}" --json
8276
unity-cli create-project --name "Unity Project" --unity-editor "${UNITY_EDITOR_PATH}" --json
8377
- name: Verify UNITY_PROJECT_PATH variable
8478
if: ${{ matrix.unity-version != 'none' }}
8579
id: verify-project-path
86-
shell: bash
8780
run: |
8881
if [ -z "${UNITY_PROJECT_PATH}" ]; then
8982
echo "::error::UNITY_PROJECT_PATH is not set"
@@ -105,15 +98,13 @@ jobs:
10598
echo "Skipping build: Unity version $version does not support the build pipeline package (requires 2019.4+)"
10699
fi
107100
- name: Install OpenUPM and build pipeline package
108-
shell: bash
109101
if: ${{ steps.verify-project-path.outputs.RUN_BUILD == 'true' }}
102+
working-directory: ${{ env.UNITY_PROJECT_PATH }}
110103
run: |
111104
npm install -g openupm-cli
112-
cd "${UNITY_PROJECT_PATH}"
113105
openupm add com.utilities.buildpipeline
114106
- name: Update Android Target Sdk Version
115107
if: ${{ matrix.build-target == 'Android' }}
116-
shell: bash
117108
run: |
118109
# update AndroidTargetSdkVersion to 32 in ProjectSettings/ProjectSettings.asset
119110
sed -i 's/AndroidTargetSdkVersion: [0-9]*/AndroidTargetSdkVersion: 32/' "${UNITY_PROJECT_PATH}/ProjectSettings/ProjectSettings.asset"
@@ -122,13 +113,12 @@ jobs:
122113
- name: Build Project
123114
if: ${{ steps.verify-project-path.outputs.RUN_BUILD == 'true' }}
124115
timeout-minutes: 60
125-
shell: bash
126116
run: |
117+
# we don't have to specify the project path or unity editor path as unity-cli will use the environment variables
127118
unity-cli run --log-name Validate -quit -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
128119
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 }}
129120
- name: Uninstall Editor
130121
if: ${{ matrix.unity-version != 'none' }}
131-
shell: bash
132122
run: |
133123
if [ -z "${UNITY_EDITOR_PATH}" ]; then
134124
echo "UNITY_EDITOR_PATH is not set, skipping uninstall"
@@ -137,7 +127,6 @@ jobs:
137127
unity-cli uninstall-unity --unity-editor "${UNITY_EDITOR_PATH}"
138128
- name: Print log paths
139129
if: ${{ matrix.unity-version != 'none' }}
140-
shell: bash
141130
run: |
142131
HUB_LOG_PATH=$(unity-cli hub-logs)
143132
PACKAGE_MANAGER_LOG_PATH=$(unity-cli package-manager-logs)
@@ -160,11 +149,11 @@ jobs:
160149
fi
161150
# print all files found in ~/.config/
162151
find ~/.config/ -type f -exec echo "{}" \;
163-
echo "::error:: Hub log file does not exist at any known location"
152+
echo "::warning:: Hub log file does not exist at any known location"
164153
fi
165154
166155
if [ ! -f "${PACKAGE_MANAGER_LOG_PATH}" ]; then
167-
echo "::error::Package Manager log file does not exist at ${PACKAGE_MANAGER_LOG_PATH}"
156+
echo "::warning::Package Manager log file does not exist at ${PACKAGE_MANAGER_LOG_PATH}"
168157
fi
169158
170159
if [ ! -f "${LICENSING_CLIENT_LOG_PATH}" ]; then
@@ -176,6 +165,4 @@ jobs:
176165
fi
177166
- name: Return License
178167
if: always()
179-
shell: bash
180-
run: |
181-
unity-cli return-license --license personal
168+
run: unity-cli return-license --license personal

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rage-against-the-pixel/unity-cli",
3-
"version": "1.8.0",
3+
"version": "1.8.1",
44
"description": "A command line utility for the Unity Game Engine.",
55
"author": "RageAgainstThePixel",
66
"license": "MIT",
@@ -60,12 +60,12 @@
6060
},
6161
"devDependencies": {
6262
"@types/jest": "^30.0.0",
63-
"@types/node": "^24.10.1",
63+
"@types/node": "^24.10.4",
6464
"@types/semver": "^7.7.1",
6565
"@types/update-notifier": "^6.0.8",
6666
"jest": "^30.2.0",
6767
"ts-jest": "^29.4.6",
6868
"ts-node": "^10.9.2",
6969
"typescript": "^5.9.3"
7070
}
71-
}
71+
}

src/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ program.command('open-project')
710710

711711
program.command('editor-logs')
712712
.description('Prints the path to the Unity Editor log files.')
713-
.action(async (options) => {
713+
.action(async () => {
714714
const unityEditorLogsPath = UnityEditor.GetEditorLogsDirectory();
715715
process.stdout.write(`${unityEditorLogsPath}\n`);
716716
process.exit(0);

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ export * from './unity-hub';
77
export * from './unity-project';
88
export * from './unity-version';
99
export * from './utilities';
10+
export * from './unity-logging';

src/logging.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as fs from 'fs';
33
export enum LogLevel {
44
DEBUG = 'debug',
55
CI = 'ci',
6-
UTP = 'utp',
6+
UTP = 'utp', // minimal logging level
77
INFO = 'info',
88
WARN = 'warning',
99
ERROR = 'error',

0 commit comments

Comments
 (0)