Skip to main content

Automation

The automation tools are command line tools that can be used either manually with a terminal or with a CI system. These tools helps you managing your working environment, your project export and the localization management. It uses Python scripts with nox configuration to handle easily virtual envs and dependencies.

Here is the list of nox sessions available (use nox --list to get it from a command line):

  • build: Build Godot project.
  • export: Export Godot project.
  • publish: Publish Godot project.
  • setup: Setup development environment.
  • release_version: Release a version of the game.
  • update_localization: Update localization files.
  • translate: Translate english localization to another language using DeepL.
  • export_icon: Export icon png file to ico.

Configuration

The automation tools configuration is done in the file automation/common/configuration.py. 

# API url of your repository (used to automatically create a release entry when releasing a new version of your game).
FORGEJO_API_URL = "https://git.collectivit.fr/api/v1/repos/frog-collective/godot-starter-project"
# Your game name. It should automatically be set when creating your project with the dotnet template.
GAME_NAME = "StarterProject"
# List all the platforms supported by your project.
PLATFORM_NAMES: list[Platform] = [Platform.Linux, Platform.Windows]
# List all the DRM supported by your project.
DRM_NAMES: list[Drm] = [Drm.NoDrm, Drm.Steam]
# List the stores where you want to automatically publish when releasing a version.
STORE_NAMES: list[Store] = [Store.Steam, Store.ItchIO]
# The Steam SDK url compatible with your project.
STEAM_SDK_URL = "https://partner.steamgames.com/downloads/steamworks_sdk_160.zip"

# You can register multiple Applications.
# - Each application must have a specific id on each store you want to publish.
# - You must define a depot for each platform you want to publish (with associated depot ids).
# - You can customize Godot features, c# define constants and asset exclude filters per app. 
APPS = (
    Apps()
    .register_app(
        App("Game", steam_app_id=0, itch_io_id="")
        .register_depot(Depot(Platform.Windows, steam_depot_id=0, itch_io_depot_id=""))
        .register_depot(Depot(Platform.Linux, steam_depot_id=0, itch_io_depot_id=""))
    )
    .register_app(
        App("Demo", steam_app_id=0, itch_io_id="")
        .register_depot(Depot(Platform.Windows, steam_depot_id=0, itch_io_depot_id=""))
        .register_depot(Depot(Platform.Linux, steam_depot_id=0, itch_io_depot_id=""))
        .custom_feature("demo")
        .exclude_filter("data/fullgame/*")
        .define_constant("DEMO_ONLY")
    )
)

Nox Sessions

You can list the available arguments of a session by using the --help argument.

nox -s session_name -- --help

You can also sets up the verbosity level using -v, -vv or -vvv (more v for more verbosity) on all sessions.

Setup

Setup session must be used to setup or repair the development environment. It ensure that git configuration is correct, activate or download and install the correct Godot version and sets up Godot editor settings.

nox -s setup

You can use the setup session to force the installation and setup of a specific Godot version using the --force-godot-version argument. This is useful for Godot migration. The new Godot version is stored in global.json and will be used automatically when calling the setup session without arguments.

nox -s setup -- --force-godot-version 4.7

You can tells the setup session which text editor you will use so it can configure the Godot editor settings accordingly. For now the supported values are code for Visual Studio Code and nvim for NeoVim. The settings will be stored in the file .userconfig to ensure it stay applied when calling the setup session without arguments.

nox -s setup -- --text-editor nvim

Build

Build session build your project using Godot. It can be used on CI to ensure that your project compilation can succeed.

nox -s build

Export

Export session create a standalone executable of your project. If no argument are specified, the script will ask you about any information it needs.

nox -s export

When used on CI, be sure to specify all the needed information to avoid the session to be interactive.

nox -s export -- --app Game --platform Linux --configuration Debug --drm NoDrm

Publish

Publish session send an exported build of your project to a destination Store. If no argument are specified, the script will ask you about any information it needs.

nox -s publish

When used on CI, be sure to specify all the needed information to avoid the session to be interactive.

nox -s publish -- --destination Steam --app Game --platform Linux

Release Version

Release Version session gather the changelog from git since the last release, increment the version number, export all builds for each platform and for each drm, then publish them on all stores and create a new release on Forgejo. If no argument are specified, the script will ask you about any information it needs.

nox -s release_version

 When used on CI, be sure to specify all the needed information to avoid the session to be interactive.

nox -s release_version -- --app Game