CI specialised docker images for Unity3d.
The image names and tags are defined as follows:
# image name/tag
# - ghcr.io/mob-sakai/unity3d:<UnityVersion>[Module]
# - docker.io/mobsakai/unity3d:<UnityVersion>[Module]
# - mobsakai/unity3d:<UnityVersion>[Module]
# Use Unity 2022.3.0f1
$ docker pull ghcr.io/mob-sakai/unity3d:2022.3.0f1
# Use Unity 2022.3.0f1 with the added WebGL module
$ docker pull ghcr.io/mob-sakai/unity3d:2022.3.0f1-webgl- UnityVersion: Required. Specifies the Unity version. Beta versions are also available.
2022.3.5f12023.3.0a6
- Module: Optional. Specifies the Unity module. (default:
-base)-base: No additional modules. Equivalent to "linux-mono".-linux-il2cpp-linux-server-mac-mono-windows-mono-android-ios-webgl
In the following steps, you can activate the Unity license, build the Unity project, and run tests:
# Mount the current directory to the home directory in the container and start
$ docker run -v "$(pwd):/home" -w "/home" -it ghcr.io/mob-sakai/unity3d:2022.3.0f1-webgl /bin/bash
# In container,
# first, activate the license
/home$ unity-editor -batchmode -manualLicenseFile <your_ulf_file>
# Run tests (com.unity.test-framework)
/home$ unity-editor -batchmode -nographics -projectPath . -buildTarget WebGL -runTests
# Build (com.coffee.simple-build-interface)
/home$ unity-editor -batchmode -nographics -projectPath . -buildTarget WebGL -build
# Build (your script)
/home$ unity-editor -batchmode -nographics -projectPath . -buildTarget WebGL -executeMethod YourClass.BuildMethodUnity - Builder and Unity - Test runner actions support customImage parameter:
- uses: game-ci/unity-test-runner@v2
with:
customImage: ghcr.io/mob-sakai/unity3d:2020.3.0f1-webgl
...jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
unityVersion:
[
2019.3.15f1,
2019.4.16f1,
2020.1.16f1,
]
include:
- targetPlatform: StandaloneLinux64
module: -base
- targetPlatform: StandaloneOSX
module: -mac
- targetPlatform: StandaloneWindows64
module: -windows
- targetPlatform: iOS
module: -ios
- targetPlatform: Android
module: -android
- targetPlatform: WebGL
module: -webgl
steps:
- uses: actions/checkout@v5
- uses: game-ci/unity-test-runner@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}${{ matrix.module }}
customParameters: -nographics
targetPlatform: ${{ matrix.targetPlatform }}
githubToken: ${{ github.token }}
- uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}${{ matrix.module }}
targetPlatform: ${{ matrix.targetPlatform }}
- uses: actions/upload-artifact@v4
with:
name: Build
path: buildFor details, see https://game.ci/docs/github/getting-started
β³οΈ Changes from game-ci/docker
- Remove original workflows
- Cats
- Docs
- New Versions (Base/Hub/Editor/Retry)
- PR
- Remove backend-versioning server (Use
workflow_dispatchand unity-changeset instead) - Release automatically with semantic-release
- The release is based on a committed message
- Tagging based on Semantic Versioning 2.0.0
- Use
v1.0.0insted ofv1.0
- Use
- Run build workflow automatically or manually
- Run workflow when a new version is released in this repository
- Run workflow when a new version of Unity is released (RSS)
- https://unity.com/releases/editor/releases.xml
- https://unity3d.com/unity/beta/latest.xml
- Zapier creates a new comment in this issue
- Run workflow when a comment start with
/build-all
- Run workflow daily at 0:00 (UTC)
- Run workflow manually from Actions page
- Fast skip earlier builds of images that already exist
- Add build configurations file (
.github/workflow/.env) - Support for alpha/beta versions of Unity (e.g. 2022.1.0a, 2021.2.0a)
β οΈ NOTE: The versions removed from Unity beta will not be updated
- Grouping workflows in a module (base, ios, android, ...)
- Improve the visibility of actions page
- Easy to retry
- Support short image tags (eg.
ghcr.io/mob-sakai/unity3d:2020.3.0f1for Linux (Mono),ghcr.io/mob-sakai/unity3d:2020.3.0f1-webglfor WebGL, etc.) - Image tags that fail to build twice will automatically be ignored
- This locked issue is used for failure log
For details, see https://github.com/mob-sakai/docker/blob/main/DEVELOPMENT.md
Minimum Unity version for build
2019.4Excluded image tags for build (Regular expressions)
2019.1
2019.2
2019.3| Name | Description |
|---|---|
DOCKER_USERNAME |
Docker username to login. |
DOCKER_PASSWORD |
Docker password or access token to login. |
GH_WORKFLOW_TOKEN |
A Github parsonal access token with workflow premission. |
All workflows will be run automatically.
| Workflow | Description | Trigger |
|---|---|---|
Release |
Release new tag. | - Pushed commits (include feat or fix) on main branch |
Build All |
Build base/hub images and dispatch Build Editor workflows. |
- Released a new version - Scheduled (daily) - New Unity version released |
Build Editor |
Build editor images with a specific Unity module | - Dispatched from Build All |
You can run them manually from the Actions page.
NOTE: You need permissions to run the workflow.
Because the combination of the editor build is so large, the builds may fail due to the time limit of github actions (<6 hours) or API limitations.
Re-run Build All workflow manually after all jobs are done.
If a missing library is found, fix the editor/Dockerfile or base/Dockerfile.
π << The following is the original Readme >> π
(Not affiliated with Unity Technologies)
Source of CI specialised docker images for Unity, free to use for everyone.
Please find our website for any related documentation.
See the base readme for base image usage.
See the hub readme for hub image usage.
See the editor readme for editor image usage.
Feel free to join us on
and engage with the community.
To contribute, please see the development readme after you agree with our code of conduct and have read the contribution guide.
GameCI is free for everyone forever.
You can support us at OpenCollective.
This repository is MIT licensed.
This includes all contributions from the community.