Using custom export templates
This page presents a Codemagic use case for exporting a Godot project using custom export templates. We won't go into the writing rules, composition or operation of a codemagic.yaml
file.
- To learn how
codemagic.yaml
files work, see Creating codemagic.yaml.

Image by Codemagic, used under CC BY-ND 4.0 license. See gallery
Requirements
To use your own export templates, you'll need to package them in a zip
file and host them online. We'll use the URL of this file to download and install your templates on the build machine. This will allow your Godot project to be exported using your customized export templates.
Make sure you package your export templates in a zip
file and host it online. The zip
file must contain only the export templates. Once unpacked, only the templates should be obtained, not a folder.
To host your file, you can use a free file hosting service such as SwissTransfer.
In the export options, make sure to set the path to the custom export templates using: /Users/builder/Downloads/Custom Export Templates. This is the directory where the export templates will be stored on the build machine.
This tutorial assumes that you have a configuration file (codemagic.yaml
). This file allows you to export a Godot project for a given platform. If you do not have a configuration file, refer to the following table. It may help you find a configuration file suited to your needs:
Tutoriels 1 | Turoriels 2 |
---|---|
Exporting to Android | Exporting to macOS |
Exporting to iOS | Exporting to Windows Desktop |
Exporting to le Web | Exporting to Linux |
Process
We need to fetch and install your custom export templates on the build machine. We'll use an environment variable to retrieve the download URL. In the environment
section of your workflow, add the following variable:
Variable name | Description |
---|---|
EXPORT_TEMPLATES_URL | The URL where your custom templates are hosted |
- To learn more about environment variables in a
codemagic.yaml
file see Configuring Environment Variables
Make sure your workflow now looks like this:
my-workflow:
environment:
vars:
...
EXPORT_TEMPLATES_URL: https://download-url
Additionally, before the script that exports your project, add the following script:
- name: Custom Export Templates Configuration
script: |
cd ~Downloads
mkdir "Custom Export Templates"
export FILE=templates.zip
curl -L "$CUSTOM_EXPORT_TEMPLATES_URL" -o "$FILE" && unzip "$FILE"
rm $FILE
Then make sure your scripts
section now looks like this:
scripts:
...
- name: Custom Export Templates Configuration ...
- *export_project
This script download your export templates and unzip them in /Users/builder/Downloads/Custom Export Templates
.
And it's done, all we need to do now is to start a new build to export the project. To do this, you can use Codemagic's interface, or events affecting your repository such as push.
Optional resources to help refine your configuration:
- Caching
- Build automatically
- Build notifications
- Publishing
- Compiling Godot custom export templates with Codemagic
Note
When using a Script Encryption Key, make sure to define GODOT_SCRIPT_ENCRYPTION_KEY
as an environment variable containing your encryption key.
This allows Godot to encrypt your data properly when exporting the project on the build machine.
- Learn more about environment variables with Codemagic with Creating Environment variables
- Learn more about script encryption in Godot with Compiling with Script encryption key
Getting help and support
If you have a technical question or need help with some particular issue, you can get help in the GitHub Discussions community.