name: "Setup Godot" description: "Downloads Godot for Linux, puts it on PATH as `godot` and optionally installs the export templates" inputs: version: description: "Godot version, e.g. 4.7.2" required: true export-templates: description: "Also install the export templates ('true' or 'false')" required: false default: "false" runs: using: "composite" steps: - name: Download Godot shell: bash run: | URL="https://github.com/godotengine/godot-builds/releases/download/${{ inputs.version }}-stable" mkdir -p "$HOME/.godot-bin" curl --fail -L -o godot.zip "$URL/Godot_v${{ inputs.version }}-stable_linux.x86_64.zip" unzip -q godot.zip mv "Godot_v${{ inputs.version }}-stable_linux.x86_64" "$HOME/.godot-bin/godot" chmod +x "$HOME/.godot-bin/godot" rm godot.zip echo "$HOME/.godot-bin" >> "$GITHUB_PATH" - name: Install Export Templates if: inputs.export-templates == 'true' shell: bash run: | URL="https://github.com/godotengine/godot-builds/releases/download/${{ inputs.version }}-stable" TEMPLATES_DIR="$HOME/.local/share/godot/export_templates/${{ inputs.version }}.stable" curl --fail -L -o export_templates.tpz "$URL/Godot_v${{ inputs.version }}-stable_export_templates.tpz" unzip -q export_templates.tpz mkdir -p "$TEMPLATES_DIR" mv templates/* "$TEMPLATES_DIR" rm -r templates export_templates.tpz