Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions: Export PCK file from Godot Engine in CI #28

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

cassidyjames
Copy link
Contributor

This is a basic workflow I've used for other Godot Engine games to export them in CI, especially to use a PCK file for Flatpak:

  1. Download (and cache) the specified Godot Engine version (and export templates) from the official GitHub release

  2. Use the downloaded Godot Engine binaries to headlessly export the game as a PCK file (the resources, minus the platform-specific Godot Engine runtime binary itself)

  3. Upload the exported PCK file as an artifact for the CI run

  4. If this is a release that triggered the CI run, attach that exported PCK to the release

Fixes #27

This is a basic workflow I've used for other Godot Engine games to export them in CI, especially to use a PCK file for Flatpak:

1. Download (and cache) the specified Godot Engine version (and export templates) from the official GitHub release

2. Use the downloaded Godot Engine binaries to headlessly export the game as a PCK file (the resources, minus the platform-specific Godot Engine runtime binary itself)

3. Upload the exported PCK file as an artifact for the CI run

4. If this is a release that triggered the CI run, attach that exported PCK to the release
@cassidyjames cassidyjames changed the title GitHub Actions: Create Godot Export workflow GitHub Actions: Export PCK file from Godot Engine in CI Feb 26, 2025
@m4ym4y
Copy link
Owner

m4ym4y commented Feb 26, 2025

This is amazing! Would this build step include settings set in export_presets.cfg or would those settings have to be appended to the godot export command?

Thank you so much for your contribution, I'd like to get this merged. Is it possible to build for other platforms with this kind of workflow too?

@cassidyjames
Copy link
Contributor Author

Would this build step include settings set in export_presets.cfg

Yep, the --export-pack flag takes the name of a preset that is defined in export_presets.cfg. I am explicitly using the pack export instead of the whole release export because that is how Godot Engine works with Flatpak; Flathub actually builds Godot runtime binaries from source for supported architectures, and then you pair that with a PCK file and it gets Flatpaked. This also helps with deduplication since every Godot 4.3 game will actually get the same optimized binary for the platform, so Flatpak can avoid multiple copies. (It always blows my mind that every Godot game uses the same binary and the entire game itself is in the PCK file!)

Is it possible to build for other platforms with this kind of workflow too?

Absolutely! I have done web exports before this way, but it should be fairly straightforward to add a follow-up for other export presets as long as they can be exported from the Linux command line.

@m4ym4y m4ym4y merged commit f73d85d into m4ym4y:main Feb 26, 2025
2 checks passed
@cassidyjames
Copy link
Contributor Author

Just as a note in case you wanted to test out the result: the exported PCK file was attached to the "Godot Export" job run. You can view the summary and download the artifact from there, unzip it, and test it locally e.g. with the Godot command line:

godot --main-pack MuseumOfAllThings.pck

or using the Flatpak of Godot Engine:

flatpak run org.godotengine.Godot --main-pack MuseumOfAllThings.pck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export/upload PCK file with releases
2 participants