Attempt to automate the export process more #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: export-desktop | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
GODOT_VERSION: 4.3-beta1 | |
PROJECT_NAME: GodSVG | |
GODOT_REPO: https://github.com/godotengine/godot.git | |
GODOT_COMMIT_HASH: a4f2ea91a | |
BUILD_OPTIONS: target=template_release lto=full production=yes deprecated=no minizip=no brotli=no vulkan=no openxr=no use_volk=no disable_3d=yes modules_enabled_by_default=no module_freetype_enabled=yes module_gdscript_enabled=yes module_svg_enabled=yes module_jpg_enabled=yes module_text_server_adv_enabled=yes graphite=no module_webp_enabled=yes | |
jobs: | |
build-linux: | |
name: Export GodSVG for Linux | |
runs-on: ubuntu-latest | |
env: | |
PLATFORM: "Linux/X11" | |
EXTENSION: "x86_64" | |
BUILD_NAME: "linux-64bit" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y scons python3 wget unzip | |
- name: Install editor | |
run: | | |
mkdir -p ~/editor | |
cd ~/editor | |
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}/Godot_v${GODOT_VERSION}_linux.x86_64.zip | |
unzip Godot_v${GODOT_VERSION}_linux.x86_64.zip -d ~/editor | |
- name: Clone Godot repository | |
run: git clone $GODOT_REPO godot | |
- name: Checkout specific commit | |
run: | | |
cd godot | |
git fetch | |
git checkout $GODOT_COMMIT_HASH | |
- name: Build Godot template for Linux | |
run: | | |
cd godot | |
scons p=linuxbsd arch=x86_64 ${BUILD_OPTIONS} | |
- name: Export Godot | |
run: | | |
mkdir -v -p ~/${BUILD_NAME} | |
cd ~/editor | |
ls | |
./Godot_v${GODOT_VERSION}_linux.x86_64 --headless --export-release "${PLATFORM}" ~/${BUILD_NAME}/${PROJECT_NAME}.${EXTENSION} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: godot_template_linux.x86_64 | |
path: ~/${BUILD_NAME}/${PROJECT_NAME}.${EXTENSION} | |
if-no-files-found: error | |
retention-days: 14 | |
build-windows: | |
name: Export GodSVG for Windows | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
sudo apt install -y scons python3 | |
sudo apt install -y g++-mingw-w64-x86-64-posix | |
- name: Clone Godot repository | |
run: git clone $GODOT_REPO godot | |
- name: Checkout specific commit | |
run: | | |
cd godot | |
git fetch | |
git checkout $GODOT_COMMIT_HASH | |
- name: Build Godot template for Windows | |
run: | | |
apt search mingw | |
cd godot | |
scons p=windows target=release_debug tools=no ${BUILD_OPTIONS} | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: godot_template_windows.exe | |
path: godot/bin/godot.windows.template_release.x86_64.exe | |
if-no-files-found: error | |
retention-days: 1 | |
build-macos: | |
name: Export GodSVG for MacOS | |
runs-on: macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: brew install scons | |
- name: Clone Godot repository | |
run: git clone $GODOT_REPO godot | |
- name: Checkout specific commit | |
run: | | |
cd godot | |
git fetch | |
git checkout $GODOT_COMMIT_HASH | |
- name: Build Godot template for macOS (arm64 release) | |
run: | | |
cd godot | |
scons p=macos arch=arm64 ${BUILD_OPTIONS} | |
- name: Build Godot template for macOS (x86_64 release) | |
run: | | |
cd godot | |
scons p=macos arch=x86_64 ${BUILD_OPTIONS} | |
- name: Combine binaries with lipo | |
run: | | |
cd godot/bin | |
lipo -create godot.macos.template_release.x86_64 godot.macos.template_release.arm64 -output godot.macos.template_release.universal | |
chmod +x * | |
- name: Prepare .app bundle | |
run: | | |
cd godot/bin | |
cp -R ../misc/dist/macos_template.app . | |
mkdir -p macos_template.app/Contents/MacOS | |
cp godot.macos.template_release.universal macos_template.app/Contents/MacOS/godot_macos_release.universal; | |
chmod +x macos_template.app/Contents/MacOS/godot_macos*; | |
zip -q -9 -r godot_template_macos.zip macos_template.app; | |
- name: Upload macOS template | |
uses: actions/upload-artifact@v3 | |
with: | |
name: godot_template_macos.zip | |
path: godot/bin/godot_template_macos.zip | |
if-no-files-found: error | |
retention-days: 1 | |