godot-cpp-template/.github/actions/build/action.yml

54 lines
2.1 KiB
YAML

name: GDExtension Build
description: Build GDExtension
inputs:
platform:
required: true
description: Target platform.
arch:
required: true
description: Target architecture.
float-precision:
default: 'single'
description: Float precision (single or double).
build-target-type:
default: 'template_debug'
description: Build type (template_debug or template_release).
scons-cache:
default: '.scons-cache/'
description: Scons cache folder name, relative to each scons directory. Must not contain relative path signifiers (. or ..). Must be a transparent path part (empty or 'path/to/directory/', ending in a slash).
em_version:
default: 3.1.62
description: Emscripten version.
em-cache-directory:
default: emsdk-cache
description: Emscripten cache directory.
gdextension-directory:
default: ''
description: Location of the gdextension project within the repository. Must not contain relative path signifiers (. or ..). Must be a transparent path part (empty or 'path/to/directory/', ending in a slash).
runs:
using: composite
steps:
- name: Setup godot-cpp
uses: ./.github/actions/setup-godot-cpp
with:
platform: ${{ matrix.platform }}
em-version: ${{ inputs.em_version }}
em-cache-directory: ${{ inputs.em-cache-directory }}.${{ inputs.float-precision }}.${{ inputs.build-target-type }}
# Build
- name: Cache .scons_cache
uses: actions/cache@v4
with:
path: |
${{ github.workspace }}/${{ inputs.gdextension-directory }}${{ inputs.scons-cache }}
key: ${{ inputs.platform }}_${{ inputs.arch }}_${{ inputs.float-precision }}_${{ inputs.build-target-type }}_cache
# Build gdextension
- name: Build GDExtension Debug Build
shell: sh
env:
SCONS_CACHE: ${{ github.workspace }}/${{ inputs.gdextension-directory }}${{ inputs.scons-cache }}
run: |
scons target=${{ inputs.build-target-type }} platform=${{ inputs.platform }} arch=${{ inputs.arch }} precision=${{ inputs.float-precision }}
working-directory: ${{ inputs.gdextension-directory }}