From a8eaf0d12ee0d37ad5c36da82ad0fa8c70665569 Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Thu, 5 Nov 2026 16:40:47 +0000 Subject: [PATCH] Packaged builds: macOS (universal, ad-hoc signed) and Windows, tools/export.sh --- .gitignore | 2 +- README.md | 19 +++++++++ docs/ROADMAP.md | 7 +++- export_presets.cfg | 101 +++++++++++++++++++++++++++++++++++++++++++++ project.godot | 2 + tools/export.sh | 43 +++++++++++++++++++ 6 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 export_presets.cfg create mode 100755 tools/export.sh diff --git a/.gitignore b/.gitignore index 77ada73..295badd 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ .import/ *.import export.cfg -export_presets.cfg +# (export_presets.cfg is kept: signing passwords live in .godot/export_credentials.cfg) # Exported builds /build/ diff --git a/README.md b/README.md index 74ff111..9a2040d 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,25 @@ godot --path . godot --headless --path . -- --server ``` +## Packaged builds +```bash +tools/export.sh # build/Emberwild--macos.zip and -windows.zip +tools/export.sh macOS # or just one ("macOS" / "Windows") +``` +Needs the Godot export templates for your Godot version (Editor > Manage +Export Templates). The version number is `application/short_version` in +`export_presets.cfg`. +- **Mac:** a universal .app, ad-hoc signed but not notarised. On another Mac, + the first launch needs right-click > Open (or System Settings > Privacy & + Security > Open Anyway). +- **Windows:** unzip and run `Emberwild.exe` (keep `Emberwild.pck` beside + it). It's unsigned, so SmartScreen says "Windows protected your PC": + More info > Run anyway. +- A packaged copy is also a dedicated server: + `Emberwild.app/Contents/MacOS/Emberwild --headless -- --server` (Mac) or + `Emberwild.exe --headless -- --server` (Windows). Saves and settings live in + the same user folder as a copy run from source. + ## Layout ``` project.godot Godot project definition diff --git a/docs/ROADMAP.md b/docs/ROADMAP.md index 3e869f6..1d2a68a 100644 --- a/docs/ROADMAP.md +++ b/docs/ROADMAP.md @@ -87,7 +87,12 @@ phases M2.0-M2.7). - PvP / raiding rules, building damage - Better UI, settings, controls - Audio, music, weather -- Packaged builds for Win/Mac/Linux (+ Mac signing/notarisation) +- Packaged builds for Win/Mac/Linux (+ Mac signing/notarisation). + *First cut done:* `tools/export.sh` makes a universal macOS .app (ad-hoc + signed, not notarised) and a Windows x86_64 .exe + .pck (unsigned), zipped + in build/. The same build runs a dedicated server (`--headless -- --server`). + Still to do: notarising (Apple Developer account), Windows signing, the + game icon on the .exe (rcedit), Linux, and the update check below. - **Updates**: the game (and a dedicated server) needs to notice when a new version is out, download what's needed and install it. See below. diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..0ced66d --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,101 @@ +[preset.0] + +name="macOS" +platform="macOS" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="data/*.json" +exclude_filter="tests/*, docs/*, tools/*, server/*" +export_path="build/macos/Emberwild.zip" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.0.options] + +export/distribution_type=1 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=0 +application/icon="" +application/icon_interpolation=4 +application/bundle_identifier="com.pbailey.emberwild" +application/signature="" +application/app_category="Games" +application/short_version="0.1.0" +application/version="0.1.0" +application/copyright="" +display/high_res=true +codesign/codesign=1 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +notarization/notarization=0 +privacy/network_volumes_usage_description="" + +[preset.1] + +name="Windows" +platform="Windows Desktop" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="data/*.json" +exclude_filter="tests/*, docs/*, tools/*, server/*" +export_path="build/windows/Emberwild/Emberwild.exe" +patches=PackedStringArray() +encryption_include_filters="" +encryption_exclude_filters="" +seed=0 +encrypt_pck=false +encrypt_directory=false +script_export_mode=2 + +[preset.1.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false +texture_format/s3tc_bptc=true +texture_format/etc2_astc=false +binary_format/architecture="x86_64" +codesign/enable=false +application/modify_resources=false +application/icon="" +application/console_wrapper_icon="" +application/icon_interpolation=4 +application/file_version="0.1.0" +application/product_version="0.1.0" +application/company_name="" +application/product_name="Emberwild" +application/file_description="Emberwild" +application/copyright="" +application/trademarks="" +application/export_angle=0 +application/export_d3d12=0 +application/d3d12_agility_sdk_multiarch=true diff --git a/project.godot b/project.godot index 3b7ee10..29ddc88 100644 --- a/project.godot +++ b/project.godot @@ -89,6 +89,8 @@ weather_wind={ [rendering] +textures/vram_compression/import_etc2_astc=true + lights_and_shadows/directional_shadow/size=8192 lights_and_shadows/directional_shadow/soft_shadow_filter_quality=3 anti_aliasing/quality/msaa_3d=2 diff --git a/tools/export.sh b/tools/export.sh new file mode 100755 index 0000000..82c510b --- /dev/null +++ b/tools/export.sh @@ -0,0 +1,43 @@ +#!/bin/sh +# Builds the packaged game (export_presets.cfg) into build/: +# +# tools/export.sh # macOS and Windows +# tools/export.sh macOS # just one ("macOS" or "Windows") +# +# build/Emberwild--macos.zip the .app (universal: Apple silicon + Intel), +# ad-hoc signed, not notarised +# build/Emberwild--windows.zip Emberwild.exe + Emberwild.pck (+ a console +# wrapper), unsigned +# +# Needs the Godot export templates for this Godot's version (Editor > Manage +# Export Templates, or the .tpz from the Godot release page). + +cd "$(dirname "$0")/.." || exit 1 +. tools/godot_env.sh + +VERSION=$(sed -n 's/^application\/short_version="\(.*\)"/\1/p' export_presets.cfg | head -1) +which=${1:-all} +mkdir -p build +"$GODOT" --headless --path . --import >/dev/null 2>&1 + +if [ "$which" = all ] || [ "$which" = macOS ]; then + rm -rf build/macos && mkdir -p build/macos + "$GODOT" --headless --path . --export-release "macOS" build/macos/Emberwild.zip > build/export-macos.log 2>&1 + if [ -f build/macos/Emberwild.zip ]; then + mv build/macos/Emberwild.zip "build/Emberwild-$VERSION-macos.zip" + echo "built build/Emberwild-$VERSION-macos.zip" + else + echo "macOS export failed: see build/export-macos.log"; exit 1 + fi +fi + +if [ "$which" = all ] || [ "$which" = Windows ]; then + rm -rf build/windows && mkdir -p build/windows/Emberwild + "$GODOT" --headless --path . --export-release "Windows" build/windows/Emberwild/Emberwild.exe > build/export-windows.log 2>&1 + if [ -f build/windows/Emberwild/Emberwild.exe ]; then + (cd build/windows && rm -f "../Emberwild-$VERSION-windows.zip" && zip -qr "../Emberwild-$VERSION-windows.zip" Emberwild) + echo "built build/Emberwild-$VERSION-windows.zip" + else + echo "Windows export failed: see build/export-windows.log"; exit 1 + fi +fi