is it wine #31
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-optimized | |
on: | |
push: | |
branches: [rework-workflows] | |
pull_request: | |
branches: [ main ] | |
workflow_dispatch: | |
env: | |
GODOT_VERSION: 4.3 | |
GODOT_FEATURE_VERSION: 4.3 | |
GODOT_RELEASE: stable | |
PROJECT_NAME: GodSVG | |
GODOT_REPO: godotengine/godot | |
GODOT_COMMIT_HASH: 77dcf97 | |
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-and-export: | |
name: Build and Export for ${{ matrix.platform }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- platform: linux | |
os: ubuntu-latest | |
preset: "Linux/X11" | |
artifact: GodSVG.x86_64 | |
- platform: windows | |
os: ubuntu-latest | |
preset: "Windows Desktop" | |
# artifact: GodSVG.exe | |
# - platform: macos | |
# os: macos-latest | |
# preset: "macOS" | |
# artifact: GodSVG.zip | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
path: godsvg | |
- name: Set up Godot editor | |
run: | | |
mkdir -v -p ~/godot-editor | |
cd ~/godot-editor | |
if [ $RUNNER_OS == 'Linux' ]; then | |
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64.zip | |
unzip Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64.zip | |
mv ./Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_linux.x86_64 ~/godot-editor/godot | |
echo "~/godot-editor" >> $GITHUB_PATH | |
elif [ $RUNNER_OS == 'macOS' ]; then | |
wget -q https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-${GODOT_RELEASE}/Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_macos.universal.zip | |
unzip -a Godot_v${GODOT_VERSION}-${GODOT_RELEASE}_macos.universal.zip | |
fi | |
- name: Install dependencies (Linux/Windows) | |
if: matrix.platform == 'linux' || matrix.platform == 'windows' | |
run: | | |
sudo apt update | |
sudo apt install -y scons python3 | |
if [ "${{ matrix.platform }}" = "windows" ]; then | |
sudo apt install -y g++-mingw-w64-x86-64-posix | |
# sudo apt install -y --fix-missing wine64 | |
# wget -q https://github.com/electron/rcedit/releases/download/v2.0.0/rcedit-x64.exe | |
# mkdir -v -p ~/.local/share/rcedit | |
# mv rcedit-x64.exe ~/.local/share/rcedit | |
# godot --headless --quit | |
# echo 'export/windows/wine = "/usr/bin/wine64"' >> ~/.config/godot/editor_settings-${GODOT_FEATURE_VERSION}.tres | |
# echo 'export/windows/rcedit = "/home/runner/.local/share/rcedit/rcedit-x64.exe"' >> ~/.config/godot/editor_settings-${GODOT_FEATURE_VERSION}.tres | |
fi | |
- name: Install dependencies (macOS) | |
if: matrix.platform == 'macos' | |
run: brew install scons | |
- name: Use cached export template | |
id: godot-template-cache | |
uses: | |
actions/cache@v4 | |
with: | |
key: ${{ env.GODOT_COMMIT_HASH }}-${{ matrix.platform}}-${{ env.BUILD_OPTIONS }} | |
path: | | |
~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.${{ env.GODOT_RELEASE }} | |
- name: Get Godot source | |
if: ${{ steps.godot-template-cache.outputs.cache-hit != 'true' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: ${{ env.GODOT_REPO }} | |
ref: ${{ env.GODOT_VERSION }} | |
path: godot | |
- name: Build Godot (Linux) | |
if: ${{ matrix.platform == 'linux' && steps.godot-template-cache.outputs.cache-hit != 'true' }} | |
run: | | |
godot --help | |
cd godot | |
scons p=linuxbsd arch=x86_64 optimize=speed ${BUILD_OPTIONS} | |
mkdir -v -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/ | |
mv ./bin/godot.linuxbsd.template_release.x86_64 ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/linux_release.x86_64 | |
- name: Build Godot (Windows) | |
if: ${{ matrix.platform == 'windows' && steps.godot-template-cache.outputs.cache-hit != 'true' }} | |
run: | | |
godot --help | |
cd godot | |
scons p=windows arch=x86_64 ${BUILD_OPTIONS} | |
mkdir -v -p ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/ | |
mv ./bin/godot.windows.template_release.x86_64.exe ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/windows_release_x86_64.exe | |
- name: Build Godot (macOS) | |
if: ${{ matrix.platform == 'macos' && steps.godot-template-cache.outputs.cache-hit != 'true' }} | |
run: | | |
cd godot | |
scons p=macos arch=arm64 optimize=speed ${BUILD_OPTIONS} | |
scons p=macos arch=x86_64 optimize=speed ${BUILD_OPTIONS} | |
cd bin | |
lipo -create godot.macos.template_release.x86_64 godot.macos.template_release.arm64 -output godot.macos.template_release.universal | |
chmod +x * | |
mv godot.macos.template_release.universal "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}" | |
- name: Export project | |
run: | | |
cd godsvg | |
ls ~/.local/share/godot/export_templates/${GODOT_VERSION}.${GODOT_RELEASE}/ | |
mkdir -p build | |
if [ "${{ matrix.platform }}" = "linux" ]; then | |
godot --headless --export-release "${{ matrix.preset }}" build/${{ matrix.artifact }} | |
elif [ "${{ matrix.platform }}" = "windows" ]; then | |
godot --headless --export-release "${{ matrix.preset }}" build/${{ matrix.artifact }} | |
elif [ "${{ matrix.platform }}" = "macos" ]; then | |
godot --headless --export-release "${{ matrix.preset }}" build/${{ matrix.artifact }} | |
fi | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.PROJECT_NAME }}-${{ matrix.platform }} | |
path: godsvg/build/${{ matrix.artifact }} | |
if-no-files-found: error | |
retention-days: 28 |