Description
Bug description
It appears that when running game-ci/unity-activate@v2.0.0
that the Unity instance will start generating files while the working directory is still in /github/workspace/
. This causes game-ci/unity-builder@v4
to fail as there are dozens of files that have been generated and it makes the branch dirty. Adding allowDirtyBuild: true
does allow the app to build successfully though. As per your documentation, this is not a great solution, however.
How to reproduce
Note: This is using a professional license.
This is what my github workflow contains:
build:
name: Run build pipeline
environment: production
needs: check-runner
runs-on: ${{ needs.check-runner.outputs.runner-label }}
steps:
# Checkout (without LFS)
- name: Checkout repository
uses: actions/checkout@v4
# Git LFS
- name: Create LFS file list
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v3
id: lfs-cache
with:
path: .git/lfs
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}
- name: Git LFS Pull
run: |
git lfs pull
git add .
git reset --hard
# Cache
- uses: actions/cache@v3
with:
path: Library
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
restore-keys: |
Library-
# Attempt Unity activation with the first set of credentials
- name: Unity Activation Attempt 1
uses: game-ci/unity-activate@v2.0.0
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL_1 }}
UNITY_EMAIL: ${{ vars.UNITY_EMAIL_1 }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD_1 }}
# Build
- name: Build MYAPP apk
id: buildApp
uses: game-ci/unity-builder@v4
with:
targetPlatform: Android
androidKeystoreName: MYAPP.keystore
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
allowDirtyBuild: true
env:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL_1 }}
UNITY_EMAIL: ${{ vars.UNITY_EMAIL_1 }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD_1 }}
# Output
- uses: actions/upload-artifact@v3
with:
name: MYAPP-Client-${{ steps.buildApp.outputs.androidVersionCode }}
path: build
# Return License
- name: Return license
uses: game-ci/unity-return-license@v2
if: always()
- Expected behavior
game-ci/unity-activate
Should be able to run without dirtying the branch.
Additional details
I'm a little hesitant to share the full logs of the action as I'm unsure if it contains some sensitive information, but I will send some snippets:
1: Run game-ci/unity-activate@v2.0.0
...
41: /usr/bin/docker run --workdir /github/workspace --rm --env UNITY_LICENSE --env UNITY_EMAIL --env UNITY_PASSWORD --env UNITY_SERIAL --env UNITY_VERSION=2019.2.11f1 --env HOME=/github/home --env GITHUB_REF --env GITHUB_SHA --env GITHUB_REPOSITORY --env GITHUB_ACTOR --env GITHUB_WORKFLOW --env GITHUB_HEAD_REF --env GITHUB_BASE_REF --env GITHUB_EVENT_NAME --env GITHUB_WORKSPACE=/github/workspace --env GITHUB_ACTION --env GITHUB_EVENT_PATH --env RUNNER_OS --env RUNNER_TOOL_CACHE --env RUNNER_TEMP --env RUNNER_WORKSPACE --volume /var/run/docker.sock:/var/run/docker.sock --volume /home/runner/work/_temp/_github_home:/github/home --volume /home/runner/work/_temp/_github_workflow:/github/workflow --volume /home/runner/work/MYAPP-Client/MYAPP-Client:/github/workspace unityci/editor:ubuntu-2019.2.11f1-base-1
42: Changing to "/github/workspace/_activate-license" directory.
43: /github/workspace/_activate-license /github/workspace
44: Requesting activation (professional license)
...
50: User phill@phoria.com.au logged in successfully
102: LICENSE SYSTEM [2025120 5:33:37] Next license update check is after 2025-01-21T05:33:35
...
104: [Package Manager] Server::Start -- Port 35931 was selected
COMMAND LINE ARGUMENTS:
/opt/unity/Editor/Unity
-batchmode
-logFile
/dev/stdout
-quit
-serial
(hidden)
-username
phill@phoria.com.au
-password
(hidden)
/github/workspace/_activate-license
Using Asset Import Pipeline V1.
DisplayProgressbar: Unity Package Manager
Rebuilding Library because the asset database could not be found!
Unable to load player prefs
Loading GUID <-> Path mappings...0.000024 seconds
Loading Asset Database...0.000003 seconds
AssetDatabase consistency checks...0.000069 seconds
[Package Manager] Done resolving packages in 2.02s seconds
[Package Manager]
Registered 40 packages:
Packages from [https://packages.unity.com/]:
com.unity.collab-proxy@1.2.16 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.collab-proxy@1.2.16)
com.unity.ext.nunit@1.0.0 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.ext.nunit@1.0.0)
com.unity.ide.rider@1.1.0 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.ide.rider@1.1.0)
com.unity.ide.vscode@1.1.2 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.ide.vscode@1.1.2)
com.unity.test-framework@1.0.13 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.test-framework@1.0.13)
com.unity.textmeshpro@2.0.1 (location: /github/workspace/_activate-license/Library/PackageCache/com.unity.textmeshpro@2.0.1)
Built-in packages:
com.unity.package-manager-ui@2.2.0 (location: /opt/unity/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.package-manager-ui)
com.unity.timeline@1.1.0 (location: /opt/unity/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.timeline)
com.unity.ugui@1.0.0 (location: /opt/unity/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui)
140: com.unity.modules.ai@1.0.0 (location: /opt/unity/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.modules.ai)
...
222: Hashing assets (990 files)... 0.038 seconds
file read: 0.009 seconds (13.467 MB)
wait for write: 0.001 seconds (I/O thread blocked by consumer, aka CPU bound)
wait for read: 0.002 seconds (CPUT thread waiting for I/O thread, aka disk bound)
hash: 0.013 seconds
Updating Assets - GUID: 00000000000000001000000000000000...
done. [Time: 11.266061 ms]
Updating Packages/com.unity.modules.tilemap - GUID: 09e28640d754a611467eebfb261ed749...
done. [Time: 1.830434 ms]
Updating Packages/com.unity.modules.animation - GUID: 1158e311a3101950348dcecb1bebc42d...
232: done. [Time: 1.788685 ms]
...
<THIS CONTINUES UNTIL THE ACTIVATE ACTION FINISHES SUCCESSFULLY>
1: Build MYAPP apk
Run game-ci/unity-builder@v4
with:
targetPlatform: Android
androidKeystoreName: MYAPP.keystore
androidKeystoreBase64: ***
androidKeystorePass: ***
androidKeyaliasName: ***
androidKeyaliasPass: ***
unityVersion: auto
versioning: Semantic
androidExportType: androidPackage
androidSymbolType: none
runAsHostUser: false
dockerIsolationMode: default
containerRegistryRepository: unityci/editor
containerRegistryImageVersion: 3
awsStackName: game-ci
providerStrategy: local
kubeVolumeSize: 5Gi
watchToEnd: true
cacheUnityInstallationOnMac: false
dockerWorkspacePath: /github/workspace
skipActivation: false
(node:4088) NOTE: We are formalizing our plans to enter AWS SDK for JavaScript into maintenance mode in 202[3]
Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at
(Use `node --trace-warnings ...` to show where the warning was created)
Warning: Changes were made to the following files and folders:
Warning: ?? _activate-license/
Error: Branch is dirty. Refusing to base semantic version on uncommitted changes