From bd48847a5b70c3e25bb66740258b9d58c531fcdf Mon Sep 17 00:00:00 2001 From: josh Date: Fri, 4 Dec 2026 18:23:49 -0500 Subject: [PATCH] Add Windows and Linux release builds --- README.md | 10 ++++- scripts/build-releases.sh | 84 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 2 deletions(-) create mode 100755 scripts/build-releases.sh diff --git a/README.md b/README.md index d734151..3b874c9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Explore a procedural 3D research complex as Bud or Doyle. The film’s tour name ## Play -Open this folder in Unity Hub with **Unity 6000.6.8f1**. Open `Assets/Scenes/DomeShift.unity` and press **Play**, or launch the local Linux x86-64 player at `Builds/Linux/DomeShift.x86_64` alongside its Unity data files. The player opens in a resizable 1920×1080 window and supports borderless fullscreen at the display’s native resolution. +Download and extract the Windows or Linux x86-64 package from [Releases](https://git.labs.casa/josh/bioDome/releases). Run `DomeShift.exe` on Windows or `DomeShift.x86_64` on Linux from the extracted folder. The player opens in a resizable 1920×1080 window and supports borderless fullscreen at the display’s native resolution. + +To play in the editor, add the project folder to Unity Hub, open it with **Unity 6000.6.8f1**, then open `Assets/Scenes/DomeShift.unity` and press **Play**. | Input | Action | | --- | --- | @@ -28,4 +30,8 @@ In the timed shift, take the fuse to the Technosphere generator, the mesh filter Select **Dome Shift** in the scene Hierarchy and edit its **Dome Environment** component. The Inspector controls the footprint, roof height and bay count, glazing, random seed, terrain relief, and global and per-region density. Changes regenerate the Scene view preview. **Scene Cutaway** opens the shell in the editor, and **Frame the Bio-Dome** zooms to the facility. The player rebuilds the environment from the same values when the scene starts. -To rebuild the standalone player, open **File → Build Profiles**, select **Linux**, and build the included Dome Shift scene. +## Build releases + +Install the **Linux Build Support (Mono)** and **Windows Build Support (Mono)** modules for Unity 6000.6.8f1. On Linux, run `./scripts/build-releases.sh` from the project folder. The script uses the standard Unity Hub install path. Set `UNITY_EDITOR` to the editor executable if it lives elsewhere. + +The script builds both x86-64 players and writes their archives and SHA-256 checksums to `Builds/Releases`. You can also build either player in Unity under **File → Build Profiles** using the included Dome Shift scene. diff --git a/scripts/build-releases.sh b/scripts/build-releases.sh new file mode 100755 index 0000000..7f6b5fc --- /dev/null +++ b/scripts/build-releases.sh @@ -0,0 +1,84 @@ +#!/usr/bin/env bash +set -euo pipefail + +project_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd -P)" +editor_version="$(awk '$1 == "m_EditorVersion:" { print $2 }' "$project_root/ProjectSettings/ProjectVersion.txt")" +release_version="$(awk '$1 == "bundleVersion:" { print $2 }' "$project_root/ProjectSettings/ProjectSettings.asset")" + +if [[ ! "$release_version" =~ ^[0-9]+(\.[0-9]+){2}([-+][A-Za-z0-9.-]+)?$ ]]; then + printf 'Invalid Unity bundle version: %s\n' "$release_version" >&2 + exit 1 +fi + +unity_editor="${UNITY_EDITOR:-$HOME/Unity/Hub/Editor/$editor_version/Editor/Unity}" +if [[ ! -x "$unity_editor" ]]; then + printf 'Set UNITY_EDITOR to the executable for Unity %s.\n' "$editor_version" >&2 + exit 1 +fi + +editor_modules="$(dirname -- "$unity_editor")/Data/PlaybackEngines" +for module in LinuxStandaloneSupport WindowsStandaloneSupport; do + if [[ ! -d "$editor_modules/$module" ]]; then + printf 'Unity %s needs the %s build module.\n' "$editor_version" "$module" >&2 + exit 1 + fi +done + +for program in tar zip unzip sha256sum; do + command -v "$program" >/dev/null +done + +release_dir="${RELEASE_DIR:-$project_root/Builds/Releases}" +mkdir -p -- "$release_dir/logs" +release_dir="$(cd -- "$release_dir" && pwd -P)" +build_workspace="$(mktemp -d "${TMPDIR:-/tmp}/domeshift-build.XXXXXX")" +archive_workspace="" +trap 'rm -rf -- "$build_workspace" "$archive_workspace"' EXIT +archive_workspace="$(mktemp -d "$release_dir/.domeshift-archives.XXXXXX")" + +build_project="$build_workspace/project" +mkdir -p -- "$build_project" +cp -R -- "$project_root/Assets" "$project_root/Packages" "$project_root/ProjectSettings" "$build_project/" + +build_player() { + local platform="$1" target="$2" build_flag="$3" executable="$4" engine_library="$5" + local output_dir="$build_workspace/$platform/DomeShift" + local log="$release_dir/logs/DomeShift-$release_version-$platform.log" + + mkdir -p -- "$output_dir" + printf 'Building Dome Shift %s for %s\n' "$release_version" "$platform" + if ! "$unity_editor" -batchmode -nographics -quit -projectPath "$build_project" \ + -buildTarget "$target" "$build_flag" "$output_dir/$executable" -logFile "$log"; then + printf 'Unity build failed. See %s\n' "$log" >&2 + return 1 + fi + if [[ ! -s "$output_dir/$executable" || ! -s "$output_dir/$engine_library" || + ! -s "$output_dir/DomeShift_Data/globalgamemanagers" ]]; then + printf 'Unity output is incomplete. See %s\n' "$log" >&2 + return 1 + fi +} + +linux_archive="DomeShift-$release_version-linux-x86_64.tar.gz" +windows_archive="DomeShift-$release_version-windows-x86_64.zip" + +build_player linux linux64 -buildLinux64Player DomeShift.x86_64 UnityPlayer.so +tar -czf "$archive_workspace/$linux_archive" -C "$build_workspace/linux" \ + --exclude='*_BackUpThisFolder_ButDontShipItWithYourGame' DomeShift +tar -tzf "$archive_workspace/$linux_archive" >/dev/null + +build_player windows win64 -buildWindows64Player DomeShift.exe UnityPlayer.dll +( + cd -- "$build_workspace/windows" + zip -qr "$archive_workspace/$windows_archive" DomeShift \ + -x '*_BackUpThisFolder_ButDontShipItWithYourGame/*' '*.pdb' +) +unzip -tq "$archive_workspace/$windows_archive" + +( + cd -- "$archive_workspace" + sha256sum "$linux_archive" "$windows_archive" > SHA256SUMS.txt +) +mv -- "$archive_workspace/$linux_archive" "$archive_workspace/$windows_archive" \ + "$archive_workspace/SHA256SUMS.txt" "$release_dir/" +printf 'Release archives are in %s\n' "$release_dir"