Skip to content

More work on color picker configurability #1903

More work on color picker configurability

More work on color picker configurability #1903

name: export-optimized
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PROJECT_NAME: GodSVG
# Which Godot version to use for exporting (e.g., 4.4.1, 4.5)
GODOT_VERSION: 4.6
# Which Godot release to use for exporting (e.g., stable, dev5, rc2)
GODOT_RELEASE_TYPE: stable
# Commit hash (found in Github releases)
GODOT_COMMIT_HASH: 89cea143987d564363e15d207438530651d943ac
# deprecated=no disables deprecated Godot features, which exist for compat and we don't use.
# d3d12=no, vulkan=no, use_volk=no since we use Compatibility Renderer. TODO disable rendering_device too (Godot issue #103100).
# disable_3d=yes since we don't use 3D features. This automatically disables 3D physics, 3D navigation, and XR.
# disable_physics_2d=yes since we don't use physics.
# disable_navigation_2d=yes since we don't use navigation.
# graphite=no I'm not sure why we have disabled, but it's a font-shaping engine.
# All modules are disabled by default, except for the following:
# - gdscript, svg: Obvious.
# - jpg, webp: For exporting SVGs as different formats.
# - mbedtls: needed for HTTP requests.
# - text_server_adv: Currently unneeded, but needed for languages like Arabic.
# - freetype: Something about font rendering.
# build_proflie disables a lot of unused classes.
BUILD_OPTIONS: target=template_release lto=full production=yes deprecated=no minizip=no d3d12=no vulkan=no use_volk=no disable_3d=yes disable_physics_2d=yes disable_navigation_2d=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 module_mbedtls_enabled=yes build_profile=../godsvg/.github/disabled_classes.gdbuild
# Links
GODOT_REPO: https://github.com/godotengine/godot.git
ANGLE_DOWNLOAD_BASE_URL: https://github.com/godotengine/godot-angle-static/releases/download/chromium%2F6601.2/godot-angle-static
jobs:
build-linux:
name: Export GodSVG for Linux
# Stay one LTS before latest to increase portability of Linux artifacts.
runs-on: ubuntu-22.04
env:
PLATFORM: "Linux"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt install -y scons python3 libwayland-dev
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Linux
run: |
cd godot
scons p=linuxbsd arch=x86_64 ${BUILD_OPTIONS}
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.linuxbsd.template_release.x86_64 ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/linux_release.x86_64
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "${{ env.PLATFORM }}" build/GodSVG.x86_64
- name: Debug — show export templates & file info
run: |
echo "HOME: $HOME"
echo "Expected template dir: $HOME/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}"
ls -la "$HOME/.local/share/godot/export_templates/" || true
ls -la "$HOME/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}" || true
echo "--- template file ---"
file "$HOME/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/linux_release.x86_64" || true
echo "--- exported artifact ---"
file godsvg/build/GodSVG.x86_64 || true
if command -v readelf >/dev/null 2>&1; then
echo "--- readelf symbol count (template) ---"
readelf -s "$HOME/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/linux_release.x86_64" 2>/dev/null | head -n 20 || true
echo "--- readelf symbol count (artifact) ---"
readelf -s godsvg/build/GodSVG.x86_64 2>/dev/null | head -n 20 || true
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.Linux
path: godsvg/build/GodSVG.x86_64
if-no-files-found: error
retention-days: 28
build-windows:
name: Export GodSVG for Windows
runs-on: ubuntu-latest
env:
PLATFORM: "Windows"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: |
sudo apt install -y scons python3
sudo apt install -y g++-mingw-w64-x86-64-posix
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Download ANGLE Static Libraries
run: |
mkdir -p ~/angle
cd ~/angle
curl -L -o windows_x86_64.zip ${ANGLE_DOWNLOAD_BASE_URL}-x86_64-gcc-release.zip
unzip -o windows_x86_64.zip
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Windows
run: |
cd godot
scons p=windows ${BUILD_OPTIONS} angle_libs=~/angle module_astcenc_enabled=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.windows.template_release.x86_64.exe ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/windows_release_x86_64.exe
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "Windows Desktop" build/GodSVG.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.Windows
path: godsvg/build/GodSVG.exe
if-no-files-found: error
retention-days: 28
build-macos:
name: Export GodSVG for MacOS
runs-on: macos-latest
env:
PLATFORM: "macOS"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_macos.universal.zip
unzip -a Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_macos.universal.zip
echo "~/godot-editor/Godot.app/Contents/MacOS" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: brew install scons
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for macOS (arm64 release)
run: |
godot --help
cd godot
scons p=macos arch=arm64 ${BUILD_OPTIONS}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for macOS (x86_64 release)
run: |
cd godot
scons p=macos arch=x86_64 ${BUILD_OPTIONS}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
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 *
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
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 macos.zip macos_template.app;
mkdir -p "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}"
mv macos.zip "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}"
- name: Export project
run: |
cd godsvg
mkdir -p build
godot --headless --export-release "macOS" build/GodSVG.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.MacOS
path: godsvg/build/GodSVG.zip
if-no-files-found: error
retention-days: 28
build-web:
name: Export GodSVG for Web
runs-on: ubuntu-latest
env:
PLATFORM: "Web"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt-get install -y scons python3
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install Emscripten
run: |
git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh
shell: bash
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Web
run: |
cd godot
source ../emsdk/emsdk_env.sh
scons p=web arch=wasm32 ${BUILD_OPTIONS} threads=no
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/godot.web.template_release.wasm32.nothreads.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/web_nothreads_release.zip
- name: Export project
run: |
cd godsvg
mkdir -p build/web
godot --headless --export-release "Web" build/web/GodSVG.html
cd build/web
mv GodSVG.html index.html
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.Web
path: godsvg/build/web
if-no-files-found: error
retention-days: 28
build-android:
name: Export GodSVG for Android
runs-on: ubuntu-latest
env:
PLATFORM: "Android"
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: temurin
- name: Set up Android SDK
uses: android-actions/setup-android@v3
- name: Check Installed Android SDK Packages
run: |
echo "Checking installed Android SDK packages..."
/usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager --list_installed
- name: Set up Godot Editor
run: |
mkdir -p ~/godot-editor
cd ~/godot-editor
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE_TYPE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64.zip
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE_TYPE}_linux.x86_64 ~/godot-editor/godot
echo "~/godot-editor" >> $GITHUB_PATH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Install dependencies
run: sudo apt-get install -y scons python3
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Clone Godot repository
run: git clone $GODOT_REPO godot
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Checkout specific commit
run: |
cd godot
git fetch
git checkout $GODOT_COMMIT_HASH
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Android
run: |
cd godot
scons p=android arch=arm32 swappy=no ${BUILD_OPTIONS} target=template_debug
scons p=android arch=arm64 swappy=no ${BUILD_OPTIONS} target=template_debug generate_apk=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/android_debug.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_debug.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_source.zip
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot release template for Android
run: |
cd godot
scons p=android arch=arm32 swappy=no ${BUILD_OPTIONS} target=template_release
scons p=android arch=arm64 swappy=no ${BUILD_OPTIONS} target=template_release generate_apk=yes
mkdir -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/
mv ./bin/android_release.apk ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_release.apk
mv ./bin/android_source.zip ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE_TYPE}/android_source.zip
- name: Export debug project
env:
GODOT_ANDROID_KEYSTORE_DEBUG_PATH: "./no_export/debug.keystore"
GODOT_ANDROID_KEYSTORE_DEBUG_USER: "androiddebugkey"
GODOT_ANDROID_KEYSTORE_DEBUG_PASSWORD: "android"
run: |
cd godsvg
mkdir -p build/android
godot --headless --export-debug "Android" build/android/GodSVG.Android.debug.apk
- name: Export release project
if: github.event_name == 'workflow_dispatch'
env:
GODOT_ANDROID_KEYSTORE_RELEASE_PATH: "/tmp/release.keystore"
GODOT_ANDROID_KEYSTORE_RELEASE_USER: ${{ secrets.KEY_ALIAS }}
GODOT_ANDROID_KEYSTORE_RELEASE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
run: |
cd godsvg
mkdir -p build/android
echo "${{ secrets.KEYSTORE }}" | base64 -d > /tmp/release.keystore
godot --headless --export-release "Android" build/android/GodSVG.Android.apk
- name: Upload debug artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.debug.Android
path: godsvg/build/android/GodSVG.Android.debug.apk
if-no-files-found: error
retention-days: 28
- name: Upload release artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PROJECT_NAME }}.Android
path: godsvg/build/android/GodSVG.Android.apk
if-no-files-found: ignore
retention-days: 28