Godot CI/CD: Level Up Your Game Development

Godot CI/CD: Level Up Your Game Development

Making game builds can be a real drag, especially when you’re supporting multiple platforms. Manually compiling and uploading your game for each platform can eat up a ton of your time.

In this blog post, we’ll explore the power of Godot CI/CD (Continuous Integration and Continuous Delivery) to automate your game builds and publishing process.

By the end of this post, you’ll be able to:

  • Set up a Godot CI/CD pipeline using Github Actions
  • Automate your game builds for multiple platforms
  • Automatically publish your game to itch.io

For this demo, we’ll use a simple Godot project with a single main scene. To ensure your CI/CD pipeline supports the desired platforms, navigate to Project > Export and select the target platforms. In this example, we’ll focus on Web, Windows, and Linux.

We will now create a new GitHub action by creating new yml file in root of our Godot project:
our_godot_project/.github/workflows/godot-ci.yml

First we need to define name and triggers for our workflow. Name can be whatever you want, and trigger will be only push to main branch. This prevents accidental publishing of features that are still under development on other branches, ensuring a controlled and stable release process.

name: "godot-ci export" 
on: 
  push: 
    branches: [ "main" ]

For environment variables we will define:

env: 
  GODOT_VERSION: 4.3 
  EXPORT_NAME: MyGameName 
  PROJECT_PATH: . 
  ITCH_USERNAME: myusername 
  ITCH_GAME_ID: my-game-id

GODOT_VERSION — Define Godot version that you are using
EXPORT_NAME — Define you project name
PROJECT_PATH — This is path to your Godot project, if you are using root, leave as “:”, but if you godot project is in subfolder write it as “./subfolder”
ITCH_USERNAME — Define you itchio username
ITCH_GAME_ID- Define you project id, you can find it in URL of your game

We’ll define a separate job for each exported platform to run in parallel. Here is an example of job for windows, you can find others on my GitHub repository.

jobs: 
  export-windows: 
    name: Windows Export 
    runs-on: ubuntu-24.04 
    container: 
      image: barichello/godot-ci:4.3 
    steps: 
      - name: Checkout 
        uses: actions/checkout@v4 
        with: 
          lfs: true 
      - name: Setup 
        run: | 
          mkdir -v -p ~/.local/share/godot/export_templates/ 
          mkdir -v -p ~/.config/ 
          mv /root/.config/godot ~/.config/godot 
          mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable 
      - name: Windows Build 
        run: | 
          mkdir -v -p build/windows 
          EXPORT_DIR="$(readlink -f build)" 
          cd $PROJECT_PATH 
          godot --headless --verbose --export-release "Windows Desktop" "$EXPORT_DIR/windows/$EXPORT_NAME.exe" 
      - name: Upload Artifact 
        uses: actions/upload-artifact@v4 
        with: 
          name: windows 
          path: build/windows

And finally we need to publish our game to Itch.io
For this we will need Itchio API key page and create new API key. Do not share this key, because its used for publishing game updates as you.

We will keep it as secret, so we will need to go under our Github project settings > Secrets and variables > Actions and create new BUTLER_API_KEY secret with our Itchio API key as value.

deploy: 
    name: Upload to Itch 
    runs-on: ubuntu-24.04 
    needs: [ export-web, export-windows, export-linux ] 
    strategy: 
      fail-fast: true 
      matrix: 
        channel: 
          - html5 
          - windows 
          - linux 
    steps: 
      - uses: actions/download-artifact@v4 
        with: 
          name: ${{ matrix.channel }} 
          path: build/${{ matrix.channel }} 
      - uses: KikimoraGames/[email protected] 
        with: 
          butlerApiKey: ${{ secrets.BUTLER_API_KEY }} 
          gameData: ./build/${{ matrix.channel }} 
          itchUsername: ${{ env.ITCH_USERNAME }} 
          itchGameId: ${{ env.ITCH_GAME_ID }} 
          buildChannel: ${{ matrix.channel }} 
          buildNumber: ${{ github.run_number }}

For “needs:” we will add names of our jobs that needs to be done in order to publish game. Just write all jobs from previous part as needs.
Similar to that we will add matrix channels that matches Itch.io documentation.

You can find full source code for this project on my Github repository, and also you can see working demo on Itch.io

Comments

Sign up for more like this.