Skip to content

Fixes to path aligning with Ctrl (#1800) #2332

Fixes to path aligning with Ctrl (#1800)

Fixes to path aligning with Ctrl (#1800) #2332

name: export-optimized
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
PROJECT_NAME: GodSVG
VERSION_NAME: 1.0-alpha16
# 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
# Emscripten version. Should normally be "latest", but if this causes problems, see what Godot itself is using.
EMSDK_VERSION: 4.0.11
# 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, dds: 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_profile 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_webp_enabled=yes module_dds_enabled=yes module_text_server_adv_enabled=yes graphite=no 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@v6
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/${{ env.FULL_NAME }}.x86_64
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.x86_64
path: godsvg/build/${{ env.FULL_NAME }}.x86_64
if-no-files-found: error
retention-days: 28
- name: Install FUSE
run: |
sudo add-apt-repository universe
# Note: libfuse2 is renamed to libfuse2t64 in Ubuntu 24.04.
sudo apt-get install appstream libfuse2
- name: Prepare AppDir for AppImage
run: |
install -Dm755 godsvg/build/${{ env.FULL_NAME }}.x86_64 AppDir/usr/bin/godsvg
install -Dm644 godsvg/no_export/distribution/com.godsvg.GodSVG.desktop -t AppDir/usr/share/applications/
install -Dm644 godsvg/no_export/distribution/com.godsvg.GodSVG.metainfo.xml -t AppDir/usr/share/metainfo/
install -Dm644 godsvg/assets/logos/icon.svg AppDir/usr/share/icons/hicolor/scalable/apps/godsvg.svg
- name: Download linuxdeploy
run: |
wget -q https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy-x86_64.AppImage
- name: Build AppImage
run: |
mkdir -p godsvg/build
./linuxdeploy-x86_64.AppImage --appdir AppDir --output appimage
env:
LDAI_UPDATE_INFORMATION: gh-releases-zsync|MewPurPur|GodSVG|latest-all|${{ env.PROJECT_NAME }}_v*-x86_64.AppImage.zsync
LDAI_OUTPUT: godsvg/build/${{ env.FULL_NAME }}.AppImage
- name: Package AppImage download
if: github.event_name == 'workflow_dispatch'
run: |
mkdir -p godsvg/dist
mkdir -p package
cp godsvg/build/${{ env.FULL_NAME }}.AppImage package/
cp godsvg/build/${{ env.FULL_NAME }}.AppImage.zsync package/
cd package
zip -q -9 -r ../godsvg/dist/${{ env.FULL_NAME }}.Linux.AppImage.zip .
- name: Upload AppImage artifact
if: github.event_name != 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.AppImage
path: godsvg/build/${{ env.FULL_NAME }}.AppImage
if-no-files-found: error
retention-days: 28
- name: Upload AppImage bundle
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Linux.AppImage
path: godsvg/dist/${{ env.FULL_NAME }}.Linux.AppImage.zip
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@v6
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/${{ env.FULL_NAME }}.exe
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Windows
path: godsvg/build/${{ env.FULL_NAME }}.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@v6
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/${{ env.FULL_NAME }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.MacOS
path: godsvg/build/${{ env.FULL_NAME }}.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@v6
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: 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
- name: Set up Emscripten
uses: emscripten-core/setup-emsdk@v16
with:
version: ${{ env.EMSDK_VERSION }}
- if: ${{ steps.setup.outputs.cache_hit != 'true' }}
name: Build Godot template for Web
run: |
cd godot
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/${{ env.FULL_NAME }}.html
cd build/web
mv ${{ env.FULL_NAME }}.html index.html
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_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@v6
with:
path: godsvg
- uses: ./godsvg/.github/initial-setup
id: setup
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
java-version: 17
distribution: temurin
- name: Set up Android SDK
uses: android-actions/setup-android@v4
- 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/${{ env.FULL_NAME }}.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/${{ env.FULL_NAME }}.Android.apk
- name: Upload debug artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.debug.Android
path: godsvg/build/android/${{ env.FULL_NAME }}.Android.debug.apk
if-no-files-found: error
retention-days: 28
- name: Upload release artifact
uses: actions/upload-artifact@v7
with:
name: ${{ env.FULL_NAME }}.Android
path: godsvg/build/android/${{ env.FULL_NAME }}.Android.apk
if-no-files-found: ignore
retention-days: 28