Docker image to export Godot Engine games. Templates for Gitlab CI and GitHub Actions to deploy to GitLab Pages/GitHub Pages/Itch.io.
MIT License
Docker image to export Godot Engine games and deploy to GitLab/GitHub Pages and Itch.io using GitLab CI and GitHub Actions.
https://hub.docker.com/r/barichello/godot-ci/
.gitlab-ci.yml
and .github/workflows/godot-ci.yml
are included in this project as reference.
For live projects, examples and tutorials using this template check the list below:
To build a Godot project with Mono (C#) enabled, you must do two things for each job:
image
tag from barichello/godot-ci:VERSION
to barichello/godot-ci:mono-VERSION
in .gitlab-ci.yml
(Gitlab) or godot-ci.yml
(Github). (e.g. barichello/godot-ci:mono-3.2.1
).run: mv /root/.local ...
) from ending with ...${GODOT_VERSION}.stable
to ending with ...${GODOT_VERSION}.stable.mono
. You will need to do this for both directories in the command.mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
becomes:
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable.mono ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable.mono
To build a debug release (debug.keystore), use the android_debug
job example in the gitlab-ci.yml
file.
If you want to export for Android with your own keystore, you can do this with the following steps:
base64 release.keystore -w 0
certutil -encodehex -f release.keystore encoded.txt 0x40000001
SECRET_RELEASE_KEYSTORE_BASE64
as type variable.android
job example in the gitlab-ci.yml
file.See this repository for automating GDNative C++ compilation, which is based off this repository.
You have to compile Godot with the modules included first. See this excellent repository by Calinou for automating Godot builds.
After that, you would use the custom build to export your project as usual. See this guide by Greenfox on how to use a custom Godot build for automated exports.
Not available yet. Automating Xcode projects is doable but not trivial, and macOS runners only recently became available for GitHub actions, so it will happen eventually.
Here's a mapping between each supported CI service, the template jobs and a live example.
CI | Template | Example |
---|---|---|
GitLab CI | Godot Exports / GitHub Pages / GitLab Pages / Itch.io | GitLab CI Pipelines |
GitHub Actions | Godot Exports | GitHub Actions running |
First you need to remove unused jobs/stages from the .yml
file you are using as a template(.gitlab-ci.yml
or .github/workflows/godot-ci.yml
).
Then you have to add these environments to a configuration panel depending on the chosen CI and jobs:
https://github.com/<username>/<project-name>/settings/secrets
https://gitlab.com/<username>/<repo-name>/settings/ci_cd
Secrets needed for a GitHub Pages deploy via GitLab CI:
Variable | Description | Example |
---|---|---|
REMOTE_URL | The git remote where the web export will be hosted (in this case GitHub), it should contain your deploy/personal access token
|
https://<github username>:<deploy token>@github.com/<username>/<repository>.git |
GIT_EMAIL | Git email of the account that will commit to the gh-pages branch. |
[email protected] |
GIT_USERNAME | Username of the account that will commit to the gh-pages branch. |
username |
Others variables are set automatically by the gitlab-runner
, see the documentation for predefined variables.
Deployment to Itch.io is done via Butler. Secrets needed for a Itch.io deploy via GitLab CI:
Variable | Description | Example |
---|---|---|
ITCHIO_USERNAME | Your username on Itch.io, as in your personal page will be at https://<username>.itch.io
|
username |
ITCHIO_GAME | the name of your game on Itchio, as in your game will be available at https://<username>.itch.io/<game>
|
game |
BUTLER_API_KEY | An Itch.io API key is necessary for Butler so that the CI can authenticate on Itch.io on your behalf. Make that API key Masked (GitLab CI) to keep it secret
|
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
export_presets.cfg
) is committed to version control. In other words, export_presets.cfg
must not be in .gitignore
.
export_presets.cfg
match the ones used in your CI script (case-sensitive). Export preset names that contain spaces must be written within quotes (single or double).test-project
template) or not.Greenfox has an excellent repo that is also for automating Godot exports.