Skip to content
Snippets Groups Projects
Unverified Commit 191853d9 authored by Louis's avatar Louis :fire:
Browse files

Create build & install commands for godot

parents
No related branches found
No related tags found
No related merge requests found
build:
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
fi
- docker build --pull -f Dockerfile -t "$CI_REGISTRY_IMAGE${tag}" .
- docker push "$CI_REGISTRY_IMAGE${tag}"
\ No newline at end of file
FROM debian:12.8-slim
ARG PLATFORM="linux.x86_64"
ARG GODOT_VERSION="4.3-stable"
RUN apt-get update \
&& apt-get install -y wget unzip \
&& rm -rf /var/lib/apt/lists/*
COPY ./godot_build.sh /usr/bin/godot_build
COPY ./godot_install.sh /usr/bin/godot_install
RUN godot_install $GODOT_VERSION $PLATFORM && cp ./godot /usr/bin/godot
\ No newline at end of file
## Godot Builder
A base debian image, configured with tools and helpers required to build godot games in CI
### Commands
#### godot
The docker image contains the full godot editor binary,
available anywhere in the system referenced as `godot`.
If you extend this image to have graphical capabilities,
this can be used to launch full editor instances. Otherwise
the `--headless` option is recommended
#### godot_build
Build a godot project. Paths for this command are based on
the _container_, not the host system, so be aware of your
volume mounts
Usage `godot_build [Output Name] [Preset Name] [Project Path]`
This command expects the given preset name to have already
been configured in your project's Export panel
(`Project` -> `Export` in the editor menu), and that it can
locate a valid Godot project within the path. The Output name
will be used for the generated executable.
_The project path must point to a folder that **contains** a
`project.godot` file, it must not point to the file itself_
**Example**:
Exporting a Linux build of a game mounted to the path "/var/godot_project"
`godot_build excellent_runner Linux /var/godot_project`
#### godot_install
Typically not required in user scripts, but can be used to
install a different version or architecture of godot
Usage: `godot_install [Godot Version] [Platform Slug]`
**Example**:
Install the 4.3 RC 1 build for macOS
`godot_install 4.3-rc1 macos.universal`
This command is most useful for the following platform slugs:
- `linux.x86_64`
- `macos.universal`
- `win64.exe`
\ No newline at end of file
#!/usr/bin/env bash
NAME="$1"
PRESET="$2"
PROJECT_PATH="$3"
godot --headless --export-debug "${PRESET}" "$(pwd)/${NAME}" "${PROJECT_PATH}/project.godot"
\ No newline at end of file
#!/usr/bin/env bash
VERSION="$1"
PLATFORM="$2"
TMP_PATH="/tmp/godot"
mkdir -p "$TMP_PATH"
BINARY_NAME="Godot_v${VERSION}_${PLATFORM}"
TMP_PATH="$TMP_PATH/godot_${VERSION}_${PLATFORM}.zip"
ARTIFACT_PATH="https://github.com/godotengine/godot-builds/releases/download/${VERSION}/${BINARY_NAME}.zip"
wget -O "$TMP_PATH" "$ARTIFACT_PATH"
unzip -o "$TMP_PATH" -d "$(pwd)"
mv "$BINARY_NAME" godot
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment