Skip to content

Commit 19f9aa9

Browse files
com.utilities.buildpipeline 1.8.2 (#69)
- Added `DISABLE_EMBEDDED_BUILD_PIPELINE_PLUGIN_LOGGING` environment variable to disable CI logging for new unity-cli features
1 parent 11b0f9d commit 19f9aa9

File tree

9 files changed

+101
-77
lines changed

9 files changed

+101
-77
lines changed

.github/workflows/build-options.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"2022",
1212
"6000.0",
1313
"6000.1",
14-
"6000.2"
14+
"6000.2",
15+
"6000.3"
1516
],
1617
"include": [
1718
{

.github/workflows/build.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
name: build
2-
permissions:
3-
contents: read
42
on:
53
workflow_call:
64
inputs:
@@ -21,35 +19,37 @@ jobs:
2119
runs-on: ${{ matrix.os }}
2220
permissions:
2321
contents: read
24-
env:
25-
UNITY_PROJECT_PATH: '' # set by unity-setup action
2622
steps:
27-
- uses: actions/checkout@v5
28-
with:
29-
clean: true
23+
- uses: actions/checkout@v6
24+
3025
- uses: RageAgainstThePixel/unity-setup@v2
26+
id: unity-setup
3127
with:
3228
unity-version: ${{ matrix.unity-version }}
3329
build-targets: ${{ matrix.build-target }}
34-
- uses: RageAgainstThePixel/activate-unity-license@v1
30+
31+
- uses: RageAgainstThePixel/activate-unity-license@v2
3532
with:
36-
license: 'Personal'
33+
license: personal
3734
username: ${{ secrets.UNITY_USERNAME }}
3835
password: ${{ secrets.UNITY_PASSWORD }}
39-
- uses: RageAgainstThePixel/unity-action@v2
36+
37+
- uses: RageAgainstThePixel/unity-action@v3
4038
name: ${{ matrix.build-target }}-Validate
4139
with:
4240
build-target: ${{ matrix.build-target }}
43-
project-path: ${{ env.UNITY_PROJECT_PATH }}
41+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
4442
log-name: ${{ matrix.build-target }}-Validate
4543
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
46-
- uses: RageAgainstThePixel/unity-action@v2
44+
45+
- uses: RageAgainstThePixel/unity-action@v3
4746
name: ${{ matrix.build-target }}-Build
4847
with:
4948
build-target: ${{ matrix.build-target }}
50-
project-path: ${{ env.UNITY_PROJECT_PATH }}
49+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
5150
log-name: ${{ matrix.build-target }}-Build
5251
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ matrix.build-args }}
52+
5353
- name: Validate Text Mesh Pro Resources
5454
shell: bash
5555
run: |
@@ -60,18 +60,18 @@ jobs:
6060
exit 0
6161
fi
6262
# Validate Text Mesh Pro Resources
63-
TMPRO_PATH="${{ env.UNITY_PROJECT_PATH }}/Assets/TextMesh Pro"
63+
TMPRO_PATH="${{ steps.unity-setup.outputs.unity-project-path }}/Assets/TextMesh Pro"
6464
if [ -d "$TMPRO_PATH" ]; then
6565
echo "Text Mesh Pro Resources found at $TMPRO_PATH"
6666
else
6767
echo "Text Mesh Pro Resources not found at $TMPRO_PATH"
6868
# list the top level folders in the Assets directory
69-
ls -al "${{ env.UNITY_PROJECT_PATH }}/Assets"
69+
ls -al "${{ steps.unity-setup.outputs.unity-project-path }}/Assets"
7070
exit 1
7171
fi
72-
- uses: actions/upload-artifact@v4
73-
name: Upload Artifacts
72+
73+
- uses: actions/upload-artifact@v6
7474
if: failure()
7575
with:
76-
name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.unity-version }} ${{ matrix.name }} Artifacts
76+
name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.os }} ${{ matrix.unity-version }} ${{ matrix.build-target }} Artifacts
7777
path: ${{ github.workspace }}/**/*.log

.github/workflows/upm-subtree-split.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.github/workflows/validate.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ jobs:
1818
permissions:
1919
contents: read
2020
steps:
21-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@v6
2222
with:
2323
sparse-checkout: .github/
2424
- uses: RageAgainstThePixel/job-builder@v1
2525
id: setup-jobs
2626
with:
2727
build-options: ./.github/workflows/build-options.json
28-
group-by: 'unity-version'
28+
group-by: unity-version
2929
outputs:
3030
jobs: ${{ steps.setup-jobs.outputs.jobs }}
3131
validate:
@@ -42,3 +42,12 @@ jobs:
4242
uses: ./.github/workflows/build.yml
4343
with:
4444
matrix: ${{ toJSON(matrix.jobs.matrix) }}
45+
timeline:
46+
needs: [setup, validate]
47+
if: always()
48+
runs-on: ubuntu-latest
49+
permissions:
50+
contents: read
51+
steps:
52+
- uses: Kesin11/actions-timeline@c2f474758e8e9ac6f37ec64a6442dead7fd1dad2 # v2.2.5
53+
continue-on-error: true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ obj/
5353
*.suo
5454
/*.sln
5555
*.sln
56+
/*.slnx
57+
*.slnx
5658
*.user
5759
*.unityproj
5860
*.ipch
@@ -79,11 +81,13 @@ _ReSharper.Caches
7981
# Project Specific List #
8082
# ===================== #
8183
--Version/
84+
.artifacts/
8285
artifacts/
8386
ThirdParty/
8487
ThirdParty.meta
8588
StreamingAssets/
8689
StreamingAssets.meta
90+
8791
Utilities.BuildPipeline/Packages/com.unity.asset-store-tools
8892
Utilities.BuildPipeline/Assets/Icons/WSAPlayer
8993
Utilities.BuildPipeline/Assets/Icons/WSAPlayer.meta

README.md

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,21 @@ openupm add com.utilities.buildpipeline
4040

4141
## Documentation
4242

43-
This package is designed to be use in conjunction with a CI/CD pipeline, such as [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Unity%20Build%20Pipeline%20Utility&color=0076D6&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace/actions/unity-build-pipeline-utility).
44-
4543
### Example Usage
4644

4745
#### Create Github Action Workflow
4846

49-
1. Create a new action workflow file using [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Unity%20Build%20Pipeline%20Utility&color=0076D6&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace/actions/unity-build-pipeline-utility)
50-
`.github/workflows/unity-build.yml`
51-
52-
2. Add the following content to the file:
47+
Create a new workflow file in your Unity project repository at `.github/workflows/build.yml` with the following content:
5348

5449
```yml
5550
name: unity-build
5651

5752
on:
5853
push:
59-
branches:
60-
- 'main'
54+
branches: ['main']
6155
pull_request:
62-
branches:
63-
- '*'
64-
# Allows you to run this workflow manually from the Actions tab
65-
workflow_dispatch:
56+
branches: ['*']
57+
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
6658
concurrency:
6759
group: ${{ github.workflow }}-${{ github.ref }}
6860
cancel-in-progress: true
@@ -83,30 +75,44 @@ jobs:
8375
build-target: StandaloneOSX
8476

8577
steps:
86-
- uses: actions/checkout@v4
78+
- uses: actions/checkout@v6
8779

8880
# Installs the Unity Editor based on your project version text file
89-
# sets -> env.UNITY_EDITOR_PATH
90-
# sets -> env.UNITY_PROJECT_PATH
91-
- uses: RageAgainstThePixel/unity-setup@v1
81+
- uses: RageAgainstThePixel/unity-setup@v2
82+
id: unity-setup # used to get project path output in later steps
9283
with:
9384
unity-version: ${{ matrix.unity-versions }}
9485
build-targets: ${{ matrix.build-target }}
86+
version-file: path/to/your/ProjectSettings/ProjectVersion.txt # optional, this step will attempt to auto detect if not provided
9587

9688
# Activates the installation with the provided credentials
97-
- uses: RageAgainstThePixel/activate-unity-license@v1
89+
- uses: RageAgainstThePixel/activate-unity-license@v2
9890
with:
9991
license: 'Personal' # Choose license type to use [ Personal, Professional ]
10092
username: ${{ secrets.UNITY_USERNAME }}
10193
password: ${{ secrets.UNITY_PASSWORD }}
10294
# serial: ${{ secrets.UNITY_SERIAL }} # Required for pro activations
10395

104-
- name: Unity Build (${{ matrix.build-target }})
105-
uses: RageAgainstThePixel/unity-build@v1
96+
- uses: RageAgainstThePixel/unity-action@v3
97+
name: ${{ matrix.build-target }}-Validate
10698
with:
99+
log-name: ${{ matrix.build-target }}-Validate
107100
build-target: ${{ matrix.build-target }}
101+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
102+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
103+
104+
- uses: RageAgainstThePixel/unity-action@v3
105+
name: ${{ matrix.build-target }}-Build
106+
with:
107+
log-name: ${{ matrix.build-target }}-Build
108+
build-target: ${{ matrix.build-target }}
109+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
110+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ matrix.build-args }}
108111
```
109112
113+
> [!NOTE]
114+
> Embedded CI Logging in GitHub Actions and Azure DevOps can be disabled by adding the `DISABLE_EMBEDDED_BUILD_PIPELINE_PLUGIN_LOGGING` environment variable to the build step with a value of `true` or `1`.
115+
110116
### Executable Methods
111117

112118
These methods can be executed using the `-executeMethod` command line argument to validate, sync, and build the Unity project.

Utilities.BuildPipeline/Packages/com.utilities.buildpipeline/Documentation~/README.md

Lines changed: 29 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,21 @@ openupm add com.utilities.buildpipeline
4040

4141
## Documentation
4242

43-
This package is designed to be use in conjunction with a CI/CD pipeline, such as [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Unity%20Build%20Pipeline%20Utility&color=0076D6&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace/actions/unity-build-pipeline-utility).
44-
4543
### Example Usage
4644

4745
#### Create Github Action Workflow
4846

49-
1. Create a new action workflow file using [![marketplace](https://img.shields.io/static/v1?label=&labelColor=505050&message=Unity%20Build%20Pipeline%20Utility&color=0076D6&logo=github-actions&logoColor=0076D6)](https://github.com/marketplace/actions/unity-build-pipeline-utility)
50-
`.github/workflows/unity-build.yml`
51-
52-
2. Add the following content to the file:
47+
Create a new workflow file in your Unity project repository at `.github/workflows/build.yml` with the following content:
5348

5449
```yml
5550
name: unity-build
5651

5752
on:
5853
push:
59-
branches:
60-
- 'main'
54+
branches: ['main']
6155
pull_request:
62-
branches:
63-
- '*'
64-
# Allows you to run this workflow manually from the Actions tab
65-
workflow_dispatch:
56+
branches: ['*']
57+
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
6658
concurrency:
6759
group: ${{ github.workflow }}-${{ github.ref }}
6860
cancel-in-progress: true
@@ -83,30 +75,44 @@ jobs:
8375
build-target: StandaloneOSX
8476

8577
steps:
86-
- uses: actions/checkout@v4
78+
- uses: actions/checkout@v6
8779

8880
# Installs the Unity Editor based on your project version text file
89-
# sets -> env.UNITY_EDITOR_PATH
90-
# sets -> env.UNITY_PROJECT_PATH
91-
- uses: RageAgainstThePixel/unity-setup@v1
81+
- uses: RageAgainstThePixel/unity-setup@v2
82+
id: unity-setup # used to get project path output in later steps
9283
with:
9384
unity-version: ${{ matrix.unity-versions }}
9485
build-targets: ${{ matrix.build-target }}
86+
version-file: path/to/your/ProjectSettings/ProjectVersion.txt # optional, this step will attempt to auto detect if not provided
9587

9688
# Activates the installation with the provided credentials
97-
- uses: RageAgainstThePixel/activate-unity-license@v1
89+
- uses: RageAgainstThePixel/activate-unity-license@v2
9890
with:
9991
license: 'Personal' # Choose license type to use [ Personal, Professional ]
10092
username: ${{ secrets.UNITY_USERNAME }}
10193
password: ${{ secrets.UNITY_PASSWORD }}
10294
# serial: ${{ secrets.UNITY_SERIAL }} # Required for pro activations
10395

104-
- name: Unity Build (${{ matrix.build-target }})
105-
uses: RageAgainstThePixel/unity-build@v1
96+
- uses: RageAgainstThePixel/unity-action@v3
97+
name: ${{ matrix.build-target }}-Validate
10698
with:
99+
log-name: ${{ matrix.build-target }}-Validate
107100
build-target: ${{ matrix.build-target }}
101+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
102+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset
103+
104+
- uses: RageAgainstThePixel/unity-action@v3
105+
name: ${{ matrix.build-target }}-Build
106+
with:
107+
log-name: ${{ matrix.build-target }}-Build
108+
build-target: ${{ matrix.build-target }}
109+
project-path: ${{ steps.unity-setup.outputs.unity-project-path }}
110+
args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild ${{ matrix.build-args }}
108111
```
109112
113+
> [!NOTE]
114+
> Embedded CI Logging in GitHub Actions and Azure DevOps can be disabled by adding the `DISABLE_EMBEDDED_BUILD_PIPELINE_PLUGIN_LOGGING` environment variable to the build step with a value of `true` or `1`.
115+
110116
### Executable Methods
111117

112118
These methods can be executed using the `-executeMethod` command line argument to validate, sync, and build the Unity project.
@@ -150,6 +156,7 @@ In addition to any already defined [Unity Editor command line arguments](https:/
150156
| `-buildOutputDirectory` | Sets the output directory for the build. |
151157
| `-acceptExternalModificationsToPlayer` | Sets the build options to accept external modifications to the player. |
152158
| `-development` | Sets the build options to build a development build of the player. |
159+
| `-patch` | Sets the build options to build a patch of the player for platforms that support it. |
153160
| `-colorSpace` | Sets the color space of the application, if the provided color space string is a valid `ColorSpace` enum value. |
154161
| `-compressionMethod` | Set the build compression. Can be: `LZ4`, `LZ4HC` |
155162
| `-buildConfiguration` | Sets the build configuration of the application. Can be: `debug`, `master`, or `release`. |
@@ -163,6 +170,9 @@ In addition to any already defined [Unity Editor command line arguments](https:/
163170
| `-buildWithDeepProfilingSupport` | Enables deep profiling support in the player. |
164171
| `-il2cppCompilerConfiguration` | C++ compiler configuration used when compiling IL2CPP. Can be: `Debug`, `Release`, or `Master` |
165172
| `-il2cppCodeGeneration` | Control code generation for IL2CPP. Can be: `OptimizeSpeed` or `OptimizeSize` |
173+
| `-buildProfileName` | Sets the build profile by name. |
174+
| `-buildProfilePath` | Sets the build profile by path. |
175+
| `-buildProfileGuid` | Sets the build profile by asset guid. |
166176

167177
#### Platform specific Command Line Arguments
168178

Utilities.BuildPipeline/Packages/com.utilities.buildpipeline/Editor/Logging/CILoggingUtility.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ public static bool LoggingEnabled
3232
set
3333
{
3434
if (loggingEnabled == value) { return; }
35-
3635
Debug.Log(value ? "CI Logging Enabled" : "CI Logging Disabled");
37-
3836
loggingEnabled = value;
3937
}
4038
}
@@ -59,6 +57,17 @@ public static bool LoggingEnabled
5957

6058
static CILoggingUtility()
6159
{
60+
var disableLoggingVar = Environment.GetEnvironmentVariable("DISABLE_EMBEDDED_BUILD_PIPELINE_PLUGIN_LOGGING", EnvironmentVariableTarget.Process);
61+
62+
if (!string.IsNullOrWhiteSpace(disableLoggingVar) &&
63+
(disableLoggingVar.Equals("1") ||
64+
disableLoggingVar.Equals("true", StringComparison.OrdinalIgnoreCase)))
65+
{
66+
Debug.Log("DISABLE_EMBEDDED_BUILD_PIPELINE_PLUGIN_LOGGING detected, disabling embedded logging");
67+
loggingEnabled = false;
68+
return;
69+
}
70+
6271
if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("TF_BUILD", EnvironmentVariableTarget.Process)))
6372
{
6473
Logger = new AzurePipelinesLogger();

Utilities.BuildPipeline/Packages/com.utilities.buildpipeline/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Utilities.BuildPipeline",
44
"description": "The Build Pipeline Utilities aims to give developers more tools and options when making builds with the command line or with continuous integration.",
55
"keywords": [],
6-
"version": "1.8.1",
6+
"version": "1.8.2",
77
"unity": "2019.4",
88
"documentationUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeline#documentation",
99
"changelogUrl": "https://github.com/RageAgainstThePixel/com.utilities.buildpipeline/releases",

0 commit comments

Comments
 (0)