forked from Conjure-Tools/unity-runner
[no ci] tweaked modules to be individual steps
This commit is contained in:
parent
64bb887451
commit
183880d764
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
gameci
|
gameci
|
||||||
|
test
|
||||||
37
README.md
37
README.md
@ -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|
|
|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 -->
|
<!-- /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
|
# 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.
|
|
||||||
@ -11,28 +11,29 @@ FROM $HUB_IMAGE AS builder
|
|||||||
ARG VERSION
|
ARG VERSION
|
||||||
COPY --from=editor "$UNITY_PATH/" /opt/unity/editors/$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
|
# Install modules for that editor
|
||||||
ARG MODULE="non-existent-module"
|
ARG MODULE
|
||||||
RUN for mod in $MODULE; do \
|
RUN install-module "$VERSION" "$MODULE" android
|
||||||
if [ "$mod" = "base" ] ; then \
|
RUN install-module "$VERSION" "$MODULE" ios
|
||||||
echo "running default modules for this baseOs"; \
|
RUN install-module "$VERSION" "$MODULE" appletv
|
||||||
else \
|
RUN install-module "$VERSION" "$MODULE" linux-mono
|
||||||
unity-hub install-modules --version "$VERSION" --module "$mod" --childModules | tee /var/log/install-module-${mod}.log && \
|
RUN install-module "$VERSION" "$MODULE" linux-il2cpp
|
||||||
grep 'Missing module\|Completed with errors' /var/log/install-module-${mod}.log | exit $(wc -l); \
|
RUN install-module "$VERSION" "$MODULE" webgl
|
||||||
fi \
|
RUN install-module "$VERSION" "$MODULE" windows
|
||||||
done \
|
RUN install-module "$VERSION" "$MODULE" vuforia-ar
|
||||||
# Set execute permissions for modules
|
RUN install-module "$VERSION" "$MODULE" windows-mono
|
||||||
&& chmod -R 755 /opt/unity/editors/$VERSION/Editor/Data/PlaybackEngines
|
RUN install-module "$VERSION" "$MODULE" lumin
|
||||||
|
RUN install-module "$VERSION" "$MODULE" mac-mono
|
||||||
RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?)|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*linux' \
|
RUN install-module "$VERSION" "$MODULE" mac-il2cpp
|
||||||
&& exit 0 \
|
RUN install-module "$VERSION" "$MODULE" universal-windows-platform
|
||||||
|| unity-hub install-modules --version "$VERSION" --module "linux-server" --childModules | \
|
RUN install-module "$VERSION" "$MODULE" uwp-il2cpp
|
||||||
tee /var/log/install-module-linux-server.log && grep 'Missing module' /var/log/install-module-linux-server.log | exit $(wc -l);
|
RUN install-module "$VERSION" "$MODULE" uwp-.net
|
||||||
|
RUN install-module "$VERSION" "$MODULE" linux-server
|
||||||
RUN echo "$VERSION-$MODULE" | grep -q -vP '^(2021.2.(?)|2021.[3-9]|202[2-9]|[6-9][0-9]{3}|[1-9][0-9]{4,}).*windows' \
|
RUN install-module "$VERSION" "$MODULE" windows-server
|
||||||
&& 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);
|
|
||||||
|
|
||||||
###########################
|
###########################
|
||||||
# Editor #
|
# Editor #
|
||||||
@ -45,28 +46,21 @@ ARG MODULE
|
|||||||
COPY --from=builder /opt/unity/editors/$VERSION/ "$UNITY_PATH/"
|
COPY --from=builder /opt/unity/editors/$VERSION/ "$UNITY_PATH/"
|
||||||
RUN echo $VERSION > "$UNITY_PATH/version"
|
RUN echo $VERSION > "$UNITY_PATH/version"
|
||||||
|
|
||||||
|
# Tools
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
git \
|
build-essential \
|
||||||
|
cmake \
|
||||||
curl \
|
curl \
|
||||||
gcc \
|
gcc \
|
||||||
make \
|
git \
|
||||||
|
libsqlite3-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
|
make \
|
||||||
|
pkg-config \
|
||||||
zlib1g-dev \
|
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_SHORT_VERSION=3.4
|
||||||
ARG BLENDER_FULL_VERSION=3.4.1
|
ARG BLENDER_FULL_VERSION=3.4.1
|
||||||
RUN echo "BLENDER_FULL_VERSION: $BLENDER_FULL_VERSION" && \
|
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
|
rm blender-$BLENDER_FULL_VERSION-linux-x64.tar.xz
|
||||||
ENV PATH="$PATH:/blender-$BLENDER_FULL_VERSION-linux-x64"
|
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
|
COPY scripts/build.sh /build.sh
|
||||||
RUN chmod +x /build.sh
|
RUN chmod +x /build.sh
|
||||||
|
|
||||||
@ -86,5 +98,5 @@ LABEL com.unity3d.modules="$MODULE"
|
|||||||
LABEL org.blender.version="$BLENDER_FULL_VERSION"
|
LABEL org.blender.version="$BLENDER_FULL_VERSION"
|
||||||
|
|
||||||
# Done
|
# Done
|
||||||
ENTRYPOINT [ "/entrypoint.sh" ]
|
# ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
# ENTRYPOINT [ "/bin/bash" ]~
|
ENTRYPOINT [ "/bin/bash" ]
|
||||||
4
make-local-container.sh
Normal file
4
make-local-container.sh
Normal 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
18
scripts/install-module.sh
Normal 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
|
||||||
Loading…
x
Reference in New Issue
Block a user