Skip to content

deplicator/github-godot4-itchio

Repository files navigation

Godot4: Github -> Itch.io

This is an example project with a single GitHub actions workflow to push a project to Itch.io. The project will be playable on Itch.io at deplicator.itch.io/github-godot4-itchio and have a download for Linux, MacOS, and Windows.

Running on Itch.io

Setup

Godot

The name of the Godot project and Itch.io project URL are the same. They contain no spaces or invalid URL characters. They don't have to be this way, but the workflow script uses an env called PROJECT_NAME that relies on the consistency.

In Godot Exports, the export names use the same name as Itch.io Channels. The script uses the channel names html, linux, macos, and windows for building and pushing to Itch.io.

Export path is export/<project name>-<channel>.{zip|exe}

  • This example uses exports/github-godot4-itch.io-linux.zip for linux
  • html is an exception, it will be exports/html/index.html, details in Workflow section below

Linux export example

Itch.io

Setup a project in Itch.io with the same url name as the Godot project.

  • Change Kind of project to HTML.

Under Embed options:

  • Change the Viewport dimensions to match the game
    • This project uses Godot defaults of 1152x648
  • Check the box next to SharedArrayBuffer support
    • Note: This will not be playable on Safari, it's a known issue.
    • Godot 4's HTML5 exports currently cannot run on macOS and iOS due to upstream bugs with SharedArrayBuffer and WebGL 2.0.

Get API Key by going to User dropdown -> Settings -> API keys. Generate a new API key or copy an existing one. It will be used in the GitHub section next.

GitHub

Add two secretes to the repository by going to Settings -> Secrets and variables -> Actions -> New repository secret.

  • ITCHIO_API_KEY - API key from Itch.io (copied in previous section)
  • ITCHIO_USERNAME - Your Itch.io username, this doesn't have to be a secret, it can be typed into the script

Using

The workflow defined at .github\workflows\deploy.yml runs manually.

It is started by navigating to the Actions tab, choosing the workflow named Deploy to Itch.io, then clicking the "Run Workflow" dropdown. From there the branch can be chosen, then click the "Run workflow" button.

In the Action tab

Build Job

Builds the Godot project for four platforms; Linux, MacOS, Web, and Windows.

  • Downloads Godot and Export Templates
  • Build 4 versions of the project

Publish Job

Pushes everything to Itch.io using Butler.

Completion

When done, the project will be updated with the version built from this repository. Itch.io will also show a notification.

Itch.io notification

Related