Skip to content

Commit

Permalink
Fix build for Godot 4 (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogerclotet authored Apr 29, 2023
1 parent 3aa561e commit 7eaff7a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 23 deletions.
24 changes: 17 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
image: barichello/godot-ci:3.4.2
image: barichello/godot-ci:4.0.2

# NOTE: the `cd` command in each build stage is not necessary if your
# project.godot is at the repo root
Expand All @@ -10,18 +10,28 @@ cache:
- .import/

stages:
- import-assets
- export
- deploy

variables:
EXPORT_NAME: test-project

# Open the editor to import assets in case the cache was empty or outdated
import-assets:
stage: import-assets
script:
- godot -v -e --quit --headless
artifacts:
paths:
- .import/

linux:
stage: export
script:
- mkdir -v -p build/linux
- cd $EXPORT_NAME
- godot -v --export "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
- godot -v --export-release --headless "Linux/X11" ../build/linux/$EXPORT_NAME.x86_64
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand All @@ -32,7 +42,7 @@ windows:
script:
- mkdir -v -p build/windows
- cd $EXPORT_NAME
- godot -v --export "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
- godot -v --export-release --headless "Windows Desktop" ../build/windows/$EXPORT_NAME.exe
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand All @@ -43,7 +53,7 @@ mac:
script:
- mkdir -v -p build/mac
- cd $EXPORT_NAME
- godot -v --export "Mac OSX" ../build/mac/$EXPORT_NAME.zip
- godot -v --export-release --headless "Mac OSX" ../build/mac/$EXPORT_NAME.zip
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand All @@ -54,7 +64,7 @@ web:
script:
- mkdir -v -p build/web
- cd $EXPORT_NAME
- godot -v --export "HTML5" ../build/web/index.html
- godot -v --export-release --headless "HTML5" ../build/web/index.html
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand All @@ -66,7 +76,7 @@ android_debug:
script:
- mkdir -v -p build/android
- cd $EXPORT_NAME
- godot -v --export-debug "Android Debug" ../build/android/$EXPORT_NAME-debug.apk
- godot -v --export-debug --headless "Android Debug" ../build/android/$EXPORT_NAME-debug.apk
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand All @@ -92,7 +102,7 @@ android:
- sed 's@keystore/release=".*"@keystore/release="'/root/release.keystore'"@g' -i export_presets.cfg
- sed 's@keystore/release_user=".*"@keystore/release_user="'$SECRET_RELEASE_KEYSTORE_USER'"@g' -i export_presets.cfg
- sed 's@keystore/release_password=".*"@keystore/release_password="'$SECRET_RELEASE_KEYSTORE_PASSWORD'"@g' -i export_presets.cfg
- godot -v --export "Android" ../build/android/$EXPORT_NAME.apk
- godot -v --export-release --headless "Android" ../build/android/$EXPORT_NAME.apk
artifacts:
name: $EXPORT_NAME-$CI_JOB_NAME
paths:
Expand Down
28 changes: 12 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:jammy
LABEL author="https://github.com/aBARICHELLO/godot-ci/graphs/contributors"

USER root
Expand All @@ -7,8 +7,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
git \
git-lfs \
python \
python-openssl \
unzip \
wget \
zip \
Expand All @@ -17,13 +15,11 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
rsync \
&& rm -rf /var/lib/apt/lists/*

ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

ARG GODOT_VERSION="3.4.2"
ARG GODOT_VERSION="4.0.2"
ARG RELEASE_NAME="stable"
ARG SUBDIR=""
ARG GODOT_TEST_ARGS=""
ARG GODOT_PLATFORM="linux_headless.64"
ARG GODOT_PLATFORM="linux.x86_64"

RUN wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}${SUBDIR}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_${GODOT_PLATFORM}.zip \
&& wget https://downloads.tuxfamily.org/godotengine/${GODOT_VERSION}${SUBDIR}/Godot_v${GODOT_VERSION}-${RELEASE_NAME}_export_templates.tpz \
Expand Down Expand Up @@ -53,17 +49,17 @@ RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922
ENV PATH="${ANDROID_HOME}/cmdline-tools/cmdline-tools/bin:${PATH}"

RUN yes | sdkmanager --licenses \
&& sdkmanager "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" "ndk;21.4.7075529"
&& sdkmanager "platform-tools" "build-tools;33.0.2" "platforms;android-33" "cmdline-tools;latest" "cmake;3.22.1" "ndk;25.2.9519653"

# Adding android keystore and settings
RUN keytool -keyalg RSA -genkeypair -alias androiddebugkey -keypass android -keystore debug.keystore -storepass android -dname "CN=Android Debug,O=Android,C=US" -validity 9999 \
&& mv debug.keystore /root/debug.keystore

RUN godot -e -q ${GODOT_TEST_ARGS}
RUN echo 'export/android/android_sdk_path = "/usr/lib/android-sdk"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/debug_keystore = "/root/debug.keystore"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/debug_keystore_user = "androiddebugkey"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/debug_keystore_pass = "android"' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/force_system_user = false' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/timestamping_authority_url = ""' >> ~/.config/godot/editor_settings-3.tres
RUN echo 'export/android/shutdown_adb_on_exit = true' >> ~/.config/godot/editor_settings-3.tres
RUN godot -v -e --quit --headless ${GODOT_TEST_ARGS}
RUN echo 'export/android/android_sdk_path = "/usr/lib/android-sdk"' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/debug_keystore = "/root/debug.keystore"' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/debug_keystore_user = "androiddebugkey"' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/debug_keystore_pass = "android"' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/force_system_user = false' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/timestamping_authority_url = ""' >> ~/.config/godot/editor_settings-4.tres
RUN echo 'export/android/shutdown_adb_on_exit = true' >> ~/.config/godot/editor_settings-4.tres

0 comments on commit 7eaff7a

Please sign in to comment.