This is a Godot 4 template based on the excellent abarichello/godot-ci repository, with a number of enhancements:
-
It’s a template, so you can just instance it superfast 🚀
-
It’s optimized for web builds and GitHub Pages, though other platforms can be easily enabled in the GitHub Actions configuration.
-
It runs builds and deploys in separate steps. It’s configured so that the
deploy
steps are skipped on non-mainline branches. -
Uh, it comes with a really spiffy ClickyClicker demo app I made in like, an hour. You can play it here.
-
Create a new repository from the template. Can be private or public, but GitHub Pages only works with public repositories (and Enterprise ones).
-
Delete the
clicky-clicker
directory and replace it with your own new Godot project. Update the corresponding environment variables at the top of .github/workflows/godot-ci.yml. -
Replace the
LICENSE
. -
Have fun!
The GitHub template only sets up the actual repository for you and not any of the settings. To enable GitHub Pages, which you’ll need if you want to play your web export on GitHub, you’ll need to do two things:
-
Ensure your repository is public. This is a bit unfortunate, but the cost of using GitHub I suppose. If not already a public repository, go to
Settings
, then at the bottom of theGeneral
subtab, click the redChange visibility
button and change to public. -
Still on the
Settings
tab, go to thePages
subtab, then ensure you’re publishing,Source
:Deploy from a branch
,Branch
:gh-pages
/ (root)
.
You may need to push another change, but after that, you should be able to access your game at the URL at the top of the Pages
subtab.
-
Create your game (draft is fine) on itch.io.
-
Configure your game, at least setting
Kind of project
toHTML
: -
Follow the directions here to get your itch.io Butler API key.
-
Follow the directions here to create a GitHub secret in your repository called
BUTLER_API_KEY
containing the API key you got from the previous step.New repository secret
is fine. -
Update your godot-ci.yml environment variables to at least refer to your itch.io project name.
-
Commit that, push it, and wait for it to succeed.
-
Once it succeeds, head back to your itch.io project page and ensure
This file will be played in the browser
is checked. -
Finally, make sure your Embed options look like the following, especially the
SharedArrayBuffer support
setting:And…that should be it.
Godot 4, at least 4.2, doesn’t support web, so that’s left out of this template.