[no ci] tweaked modules to be individual steps

This commit is contained in:
Lachee 2025-09-21 18:52:34 +10:00
parent 64bb887451
commit 183880d764
No known key found for this signature in database
GPG Key ID: F1694B0D3BCBCD55
5 changed files with 104 additions and 48 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
gameci
test

View File

@ -8,12 +8,33 @@ A table of available Docker images for Unity CI/CD:
|6000.0.35f1|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-runner)<br>📦 15.66 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-android-runner)<br>📦 12.02 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-ios-runner)<br>📦 10.47 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-linux-il2cpp-runner)<br>📦 10.37 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-mac-mono-runner)<br>📦 10.70 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-webgl-runner)<br>📦 11.60 GB|[🐳 View](https://docker.lakes.house/repo/unityci/editor/tag/ubuntu-6000.0.35f1-windows-mono-runner)<br>📦 11.07 GB|
<!-- /table -->
# Included Software
**Tools**
- Unity3D (as `unity-editor`)
- Blender `3.4`
- CMake
- CURL
- GCC
- Git
- Make
- Zip & Unzip
**Language and Runtime**
- Bash `5.1.16(1)-release`
- Node.js `20.19.5`
- Python3 `3.10.12`
- lib-sqlite3
- libssl
**Package Management**
- NPM `11.6.0`
- PNPM `10.17.0`
- pip3 `22.0.2`
**SDKs**
- AWS CLI
- Azure SDK
# Usage
TODO:
https://github.com/mob-sakai/unity-changeset/blob/main/src/unityGraphQL.ts
use this library to get the change set.
Might as well orchestrate the build with it too.
...

View File

@ -11,28 +11,29 @@ FROM $HUB_IMAGE AS builder
ARG VERSION
COPY --from=editor "$UNITY_PATH/" /opt/unity/editors/$VERSION/
# Install CMake
RUN apt-get update && apt-get install -y cmake
COPY scripts/install-module.sh /bin/install-module
# Install modules for that editor
ARG MODULE="non-existent-module"
RUN for mod in $MODULE; do \
if [ "$mod" = "base" ] ; then \
echo "running default modules for this baseOs"; \
else \
unity-hub install-modules --version "$VERSION" --module "$mod" --childModules | tee /var/log/install-module-${mod}.log && \
grep 'Missing module\|Completed with errors' /var/log/install-module-${mod}.log | exit $(wc -l); \
fi \
done \
# Set execute permissions for modules
&& chmod -R 755 /opt/unity/editors/$VERSION/Editor/Data/PlaybackEngines
RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*linux' \
&& exit 0 \
|| unity-hub install-modules --version "$VERSION" --module "linux-server" --childModules | \
tee /var/log/install-module-linux-server.log && grep 'Missing module' /var/log/install-module-linux-server.log | exit $(wc -l);
RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?![0-4](?![0-9]))|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*windows' \
&& exit 0 \
|| unity-hub install-modules --version "$VERSION" --module "windows-server" --childModules | \
tee /var/log/install-module-windows-server.log && grep 'Missing module' /var/log/install-module-windows-server.log | exit $(wc -l);
ARG MODULE
RUN install-module "$VERSION" "$MODULE" android
RUN install-module "$VERSION" "$MODULE" ios
RUN install-module "$VERSION" "$MODULE" appletv
RUN install-module "$VERSION" "$MODULE" linux-mono
RUN install-module "$VERSION" "$MODULE" linux-il2cpp
RUN install-module "$VERSION" "$MODULE" webgl
RUN install-module "$VERSION" "$MODULE" windows
RUN install-module "$VERSION" "$MODULE" vuforia-ar
RUN install-module "$VERSION" "$MODULE" windows-mono
RUN install-module "$VERSION" "$MODULE" lumin
RUN install-module "$VERSION" "$MODULE" mac-mono
RUN install-module "$VERSION" "$MODULE" mac-il2cpp
RUN install-module "$VERSION" "$MODULE" universal-windows-platform
RUN install-module "$VERSION" "$MODULE" uwp-il2cpp
RUN install-module "$VERSION" "$MODULE" uwp-.net
RUN install-module "$VERSION" "$MODULE" linux-server
RUN install-module "$VERSION" "$MODULE" windows-server
###########################
# Editor #
@ -45,28 +46,21 @@ ARG MODULE
COPY --from=builder /opt/unity/editors/$VERSION/ "$UNITY_PATH/"
RUN echo $VERSION > "$UNITY_PATH/version"
# Tools
RUN apt-get update && \
apt-get install -y \
git \
build-essential \
cmake \
curl \
gcc \
make \
git \
libsqlite3-dev \
libssl-dev \
make \
pkg-config \
zlib1g-dev \
libsqlite3-dev
zip unzip
# Set up the scripts
RUN git clone --depth=1 https://github.com/game-ci/unity-builder.git /gameci && \
cp -rf /gameci/dist/platforms/ubuntu/steps /steps && \
cp -rf /gameci/dist/default-build-script /UnityBuilderAction && \
cp /gameci/dist/platforms/ubuntu/entrypoint.sh /entrypoint.sh
# Set up Node.js environment for github actions
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
npm install -g npm@latest
# Install Blender
ARG BLENDER_SHORT_VERSION=3.4
ARG BLENDER_FULL_VERSION=3.4.1
RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" && \
@ -77,7 +71,25 @@ RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" && \
rm blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz
ENV PATH="$PATH:/blender-$BLENDER_FULL_VERSION-linux-x64"
# Add custom scripts
# Runtimes, Languages, & Package Managers
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && npm install -g npm@latest
RUN curl -fsSL https://get.pnpm.io/install.sh | bash -
RUN apt-get install -y python3 python3-pip
# SDKs
RUN cd /tmp && curl -sL https://aka.ms/InstallAzureCLIDeb | bash
RUN cd /tmp && curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && ./aws/install
# Scripts
RUN git clone --depth=1 https://github.com/game-ci/unity-builder.git /gameci && \
cp -rf /gameci/dist/platforms/ubuntu/steps /steps && \
cp -rf /gameci/dist/default-build-script /UnityBuilderAction && \
cp /gameci/dist/platforms/ubuntu/entrypoint.sh /entrypoint.sh
COPY scripts/build.sh /build.sh
RUN chmod +x /build.sh
@ -86,5 +98,5 @@ LABEL com.unity3d.modules="$MODULE"
LABEL org.blender.version="$BLENDER_FULL_VERSION"
# Done
ENTRYPOINT [ "/entrypoint.sh" ]
# ENTRYPOINT [ "/bin/bash" ]~
# ENTRYPOINT [ "/entrypoint.sh" ]
ENTRYPOINT [ "/bin/bash" ]

4
make-local-container.sh Normal file
View File

@ -0,0 +1,4 @@
UNITY_VERSION=6000.0.35f1 \
UNITY_MODULES="webgl android ios mac-mono windows-mono linux-il2cpp" \
IMAGE=docker.lakes.house/unityci/editor \
.gitea/workflows/scripts/build-runner-image.sh

18
scripts/install-module.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
VERSION="$1"
ENABLED_MODULES="$2"
MODULE_TO_INSTALL="$3"
CHILDLESS="$4"
# Check if MODULE_TO_INSTALL is in ENABLED_MODULES
if [[ " $ENABLED_MODULES " =~ " $MODULE_TO_INSTALL " ]]; then
CMD="unity-hub install-modules --version \"$VERSION\" --module \"$MODULE_TO_INSTALL\""
if [[ "$CHILDLESS" != "childless" ]]; then
CMD="$CMD --childModules"
fi
echo "Running: $CMD"
$CMD
else
echo "Module '$MODULE_TO_INSTALL' is not enabled. Skipping installation."
fi