workflow
All checks were successful
/ Export Game (push) Successful in 55s

This commit is contained in:
Lucas 2024-07-29 11:58:06 +02:00
parent 459b4b7cc1
commit e3fdb8eddd
3 changed files with 115 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,41 @@
on:
push:
tags:
- "v*"
jobs:
# job id, can be anything
export_game:
# Always use ubuntu-latest for this action
runs-on: linux_amd64
# Add permission for release creation. Can be made narrower according to your needs
permissions: write-all
# Job name, can be anything
name: Export Game
steps:
# Always include the checkout step so that
# your project is available for Godot to export
- name: checkout
uses: actions/checkout@v3.3.0
lfs: true
- name: export game
id: export
# Use latest version (see releases for all versions)
uses: https://github.com/lucastucious/godot-export@v5.3
with:
# Defining all the required inputs
godot_executable_download_url: https://github.com/godotengine/godot/releases/download/4.2.2-stable/Godot_v4.2.2-stable_linux.x86_64.zip
godot_export_templates_download_url: https://github.com/godotengine/godot/releases/download/4.2.2-stable/Godot_v4.2.2-stable_export_templates.tpz
relative_project_path: ./
archive_output: true
cache: true
# This release action has worked well for me. However, you can most likely use any release action of your choosing.
# https://github.com/ncipollo/release-action
- name: create release
uses: https://code.forgejo.org/actions/forgejo-release@v2.2.0
with:
direction: upload
release-dir: ${{ steps.export.outputs.archive_directory }}
token: ${{ env.GITHUB_TOKEN }}
release-notes: "New build"