77 lines
4.3 KiB
Markdown
77 lines
4.3 KiB
Markdown
# Godot 4 export action for Gitea
|
|
|
|
This action takes care of the repetitive part of exporting a Godot game in Gitea: getting the right Godot editor, installing its matching export templates, and running one of the presets already in your project.
|
|
|
|
It runs directly on the runner you already have. No Docker image is involved, which makes it a good fit for host-based runners on Linux, macOS, and Windows. Once the first build has finished, Godot and its templates are cached so later builds can get straight to exporting.
|
|
|
|
## What it builds
|
|
|
|
You choose the Godot preset, the build type, and the output filename. The action then puts that build in its own temporary folder and exposes the folder as `build-directory`, ready for an upload or release step.
|
|
|
|
The runner's operating system and architecture determine which Godot editor is downloaded. The export preset determines what you are building, so a Linux runner can still export a Windows game when the preset is set up for it.
|
|
|
|
## Getting started
|
|
|
|
Add the action after checking out your project. In this example, the Godot project lives in `games/my-game` and exports the `Windows Desktop` preset:
|
|
|
|
```yaml
|
|
name: Export game
|
|
|
|
on: [push]
|
|
|
|
jobs:
|
|
export:
|
|
runs-on: linux
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- id: godot-export
|
|
uses: https://gitea.example.com/your-org/godot-export-action@v1
|
|
with:
|
|
godot-version: 4.7.2-stable
|
|
host-os: linux
|
|
host-arch: x86_64
|
|
project-path: games/my-game
|
|
export-preset: Windows Desktop
|
|
export-mode: release
|
|
export-file-name: my-game.exe
|
|
|
|
# On Gitea Runner 2.x, use the Gitea artifact fork. Newer runners can
|
|
# use the artifact action supported by your installation.
|
|
- uses: https://github.com/christopherhx/gitea-upload-artifact@v4
|
|
with:
|
|
name: my-game
|
|
path: ${{ steps.godot-export.outputs.build-directory }}
|
|
```
|
|
|
|
The uploaded artifact is the whole build folder, so companion files such as a `.pck` file are kept together with the executable.
|
|
|
|
## Inputs
|
|
|
|
| Input | Required | Default | Description |
|
|
| --- | --- | --- | --- |
|
|
| `godot-version` | Yes | — | The Godot 4 release tag to use, without the leading `v`; for example, `4.7.2-stable`. |
|
|
| `host-os` | Yes | — | The machine running the job: `linux`, `macos`, or `windows`. The action checks this before it starts. |
|
|
| `host-arch` | Yes | — | The runner's architecture. Linux supports `x86_32`, `x86_64`, `arm32`, and `arm64`; Windows supports `x86_32`, `x86_64`, and `arm64`; macOS supports `x86_64` and `arm64`. |
|
|
| `dotnet` | No | `false` | Set this to `true` for a Godot .NET/C# project. |
|
|
| `project-path` | No | `.` | Where your Godot project sits inside the checked-out repository. |
|
|
| `export-preset` | Yes | — | The preset name exactly as it appears in `export_presets.cfg`. |
|
|
| `export-mode` | No | `release` | Choose `release` for a shipping build or `debug` for a debug build. |
|
|
| `export-file-name` | Yes | — | The name of the exported file, such as `my-game.exe` or `my-game.zip`. Use the extension your target expects. |
|
|
| `cache` | No | `true` | Set to `false` if you need a completely fresh Godot download for a run. |
|
|
|
|
## Outputs
|
|
|
|
| Output | Description |
|
|
| --- | --- |
|
|
| `build-directory` | The absolute path to this export's own folder in the runner's temporary directory. |
|
|
|
|
## A few helpful notes
|
|
|
|
- Your project needs both `project.godot` and `export_presets.cfg`. Preset names with spaces, such as `Windows Desktop`, are fine.
|
|
- Downloads are checked against Godot's published `SHA512-SUMS.txt` file before anything is extracted.
|
|
- On Linux, make sure the runner has `curl`, `unzip`, and `sha512sum`. macOS needs `curl`, `unzip`, and `shasum`. Windows uses the archive and hashing tools built into PowerShell.
|
|
- The cache includes the editor and the full export-template package. Gitea keeps that cache on each runner by default; an administrator can configure shared storage if several runners should reuse it.
|
|
- This action installs Godot, not every SDK around it. Android, iOS, console, and other platform-specific presets may still need their own SDKs, credentials, or signing setup on the runner.
|
|
- The cache step uses `actions/cache@v4.1.0` so it works with Gitea Runner 2.x. That runner generation also needs the Gitea artifact fork instead of the stock artifact action.
|