runner test
Some checks failed
/ Godot (linux) (push) Failing after 40s
/ Godot (windows) (push) Failing after 31s

This commit is contained in:
Lucas 2024-07-25 22:12:08 +02:00
parent 2eef87c163
commit 721f2e8297
3 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,35 @@
name: "Build Godot"
description: "Build a Godot project for multiple platforms"
author: josephbmanley
inputs:
name:
description: 'Name of the exported binary'
required: true
preset:
description: 'Name of the preset in `export_presets.cfg` to use'
required: true
subdirectory:
description: 'Optional name of the subdirectory to put exported project in'
default: ""
package:
description: 'Set true to output an artifact zip file'
default: false
projectDir:
description: 'Location of Godot project in repository'
default: "."
debugMode:
description: 'Whether or not to use `--export-debug`'
default: false
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.name }}
- ${{ inputs.preset }}
- ${{ inputs.subdirectory }}
- ${{ inputs.package }}
- ${{ inputs.projectDir }}
- ${{ inputs.debugMode }}
branding:
icon: loader
color: blue

View file

@ -0,0 +1,39 @@
#!/bin/sh
set -e
# Move godot templates already installed from the docker image to home
mkdir -v -p ~/.local/share/godot/export_templates
cp -a /root/.local/share/godot/export_templates/. ~/.local/share/godot/export_templates/
if [ "$3" != "" ]
then
SubDirectoryLocation="$3/"
fi
mode="export-release"
if [ "$6" = "true" ]
then
echo "Exporting in debug mode!"
mode="export-debug"
fi
# Export for project
echo "Building $1 for $2"
mkdir -p $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}
cd "$GITHUB_WORKSPACE/$5"
godot --headless --${mode} "$2" $GITHUB_WORKSPACE/build/${SubDirectoryLocation:-""}$1
echo "Build Done"
echo ::set-output name=build::build/${SubDirectoryLocation:-""}
if [ "$4" = "true" ]
then
echo "Packing Build"
mkdir -p $GITHUB_WORKSPACE/package
cd $GITHUB_WORKSPACE/build
zip $GITHUB_WORKSPACE/package/artifact.zip ${SubDirectoryLocation:-"."} -r
echo ::set-output name=artifact::package/artifact.zip
echo "Done"
fi

View file

@ -0,0 +1,39 @@
on:
push:
branches:
- main
- release
jobs:
Godot:
runs-on: linux_amd64
strategy:
matrix:
platform: [linux, windows]
steps:
- uses: actions/checkout@v3
with:
lfs: true
- name: Build
id: build
uses: ./.forgejo/actions/build-godot
with:
name: StickerClone
preset: ${{ matrix.platform }}
debugMode: "true"
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Client - ${{ matrix.platform }}
path: ${{ github.workspace }}/${{ steps.build.outputs.build }}
# - name: Build
# id: build
# uses: https://github.com/yeslayla/build-godot-action@v1.5.0
# with:
# name: StickerClone
# preset: ${{ matrix.platform }}
# debugMode: "false"
# - name: Upload Artifact
# uses: actions/upload-artifact@v2
# with:
# name: Client - ${{ matrix.platform }}
# path: ${{ github.workspace }}/${{ steps.build.outputs.build }}