RetroDECK/.github/workflows/build-godot.yml

102 lines
4.7 KiB
YAML
Raw Normal View History

name: GoDot Configurator Build Debug
run-name: Build Godot Configurator(DEBUG) for RetroDECK
on:
workflow_dispatch:
inputs:
job_target:
description: 'Select the platform'
required: true
default: 'linux'
type: choice
options:
- linux
- windows
2024-08-23 17:36:25 +00:00
- mac
- all
env:
GODOT_VERSION: 4.3
GODOT_PROJECT_LOCATION: tools/configurator/project.godot
EXPORT_FOLDER_LINUX: bin/Linux
EXPORT_FOLDER_WINDOWS: bin/Windows
2024-08-23 17:36:25 +00:00
EXPORT_FOLDER_MAC: bin/macOS
APPLICATION_NAME: godot_configurator
jobs:
linux-build:
runs-on: ubuntu-latest
container:
image: archlinux:latest
steps:
- name: Set up variable
run: |
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
2024-08-23 10:54:00 +00:00
echo "MAIN_FOLDER=$(pwd)" >> $GITHUB_ENV
- name: Installing dependencies
2024-08-23 09:15:30 +00:00
run: pacman -Syu --noconfirm git bash yasm python python-pip scons gcc diffutils make wget unzip tar mingw-w64
2024-08-23 10:41:43 +00:00
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
2024-08-23 10:47:27 +00:00
- name: Prepare Godot
run: |
wget -q -O godot_linux.zip https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_linux.x86_64.zip
unzip godot_linux.zip
wget -q -O godot_export_templates.tpz https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
unzip godot_export_templates.tpz -d ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
mv ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable/templates/* ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable/
2024-08-23 11:03:04 +00:00
sed -i 's/config\/version=\"[^"]\*"/config\/version=\"${{ env.DATE }}-debug\"/' ${{ env.GODOT_PROJECT_LOCATION }}
# DEBUG BUILDS
2024-08-23 17:47:50 +00:00
# LINUX
- name: Building debug Linux
2024-08-23 17:36:25 +00:00
if: ${{ github.event.inputs.job_target == 'linux' || github.event.inputs.job_target == 'all' }}
run: |
mkdir -p ${{ env.EXPORT_FOLDER_LINUX }}
2024-08-23 10:47:27 +00:00
./Godot_v${GODOT_VERSION}-stable_linux.x86_64 --import ${{ env.GODOT_PROJECT_LOCATION }} --quiet --headless --export-debug "Linux/X11 64-bit" ${{ env.MAIN_FOLDER }}/${{ env.EXPORT_FOLDER_LINUX }}/${{ env.APPLICATION_NAME}}.x86_64
chmod +x ${{ env.EXPORT_FOLDER_LINUX }}/${{ env.APPLICATION_NAME }}.sh
chmod +x ${{ env.EXPORT_FOLDER_LINUX }}/${{ env.APPLICATION_NAME }}.x86_64
# TAR to keep permissions set above
- name: Tar File
2024-08-23 17:36:25 +00:00
if: ${{ github.event.inputs.job_target == 'linux' || github.event.inputs.job_target == 'all' }}
run: tar cvf ${{ env.APPLICATION_NAME}}_linux_debug_${{ env.DATE}}.tar ${{ env.EXPORT_FOLDER_LINUX}}
- name: Uploading GDExtension artifact debug
2024-08-23 17:36:25 +00:00
if: ${{ github.event.inputs.job_target == 'linux' || github.event.inputs.job_target == 'all' }}
uses: actions/upload-artifact@v4
with:
2024-08-23 11:03:04 +00:00
name: ${{ env.APPLICATION_NAME }}_linux_debug_${{ env.DATE }}.tar
path: ${{ env.APPLICATION_NAME }}_linux_debug_${{ env.DATE }}.tar
2024-08-23 17:47:50 +00:00
# WINDOWS
- name: Building debug Windows
2024-08-23 17:36:25 +00:00
if: ${{ github.event.inputs.job_target == 'windows' || github.event.inputs.job_target == 'all' }}
run: |
mkdir -p ${{ env.EXPORT_FOLDER_WINDOWS }}
2024-08-23 17:16:52 +00:00
./Godot_v${GODOT_VERSION}-stable_linux.x86_64 --import ${{ env.GODOT_PROJECT_LOCATION }} --quiet --headless --export-debug "windows" ${{ env.MAIN_FOLDER }}/${{ env.EXPORT_FOLDER_WINDOWS }}/${{ env.APPLICATION_NAME}}.exe
- name: Uploading GDExtension artifact debug
2024-08-23 17:36:25 +00:00
if: ${{ github.event.inputs.job_target == 'windows' || github.event.inputs.job_target == 'all' }}
uses: actions/upload-artifact@v4
with:
2024-08-23 11:03:04 +00:00
name: ${{ env.APPLICATION_NAME }}_windows_debug_${{ env.DATE }}
path: ${{ env.EXPORT_FOLDER_WINDOWS }}/
2024-08-23 17:47:50 +00:00
#MAC
2024-08-23 17:36:25 +00:00
- name: Building debug macOS
if: ${{ github.event.inputs.job_target == 'mac' || github.event.inputs.job_target == 'all' }}
run: |
mkdir -p ${{ env.EXPORT_FOLDER_MAC }}
2024-08-23 18:05:15 +00:00
./Godot_v${GODOT_VERSION}-stable_linux.x86_64 --import ${{ env.GODOT_PROJECT_LOCATION }} --quiet --headless --export-debug "macOS" ${{ env.MAIN_FOLDER }}/${{ env.EXPORT_FOLDER_MAC}}/${{ env.APPLICATION_NAME}}.app
2024-08-23 17:36:25 +00:00
- name: Uploading GDExtension artifact debug
if: ${{ github.event.inputs.job_target == 'mac' || github.event.inputs.job_target == 'all' }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.APPLICATION_NAME }}_mac_debug_${{ env.DATE }}
path: ${{ env.EXPORT_FOLDER_MAC }}/