Update to 0.1.6-alpha-1

- Update version number that were omitted from the previous commit.
- Add generate dmg support for build_macos.sh.
This commit is contained in:
wei committed 2026-11-13 11:57:14 +08:00
1 parent 9c3b7ea293
commit fea979fb6f
3 files changed
+64 -6

No files matched your search

+62 -4
View File
@@ -6,9 +6,9 @@ usage() {
cat <<'EOF'
Usage: ./build_macos.sh [--dry-run] [Nuitka options...]
Sync build dependencies and create build/TapLauncher.app for the current
Python architecture (Apple Silicon or Intel). Requires uv and Xcode Command
Line Tools (install with: xcode-select --install).
Sync build dependencies and create build/TapLauncher.app and TapLauncher.dmg
for the current Python architecture (Apple Silicon or Intel). Requires uv and
Xcode Command Line Tools (install with: xcode-select --install).
--dry-run Print the build command without syncing or compiling.
--help Show this help.
@@ -37,6 +37,12 @@ if ! command -v uv >/dev/null 2>&1; then
echo "Error: uv is required. See https://docs.astral.sh/uv/getting-started/installation/" >&2
exit 1
fi
for command_name in ditto hdiutil; do
if ! command -v "$command_name" >/dev/null 2>&1; then
echo "Error: required macOS command not found: $command_name" >&2
exit 1
fi
done
project_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd "$project_dir"
@@ -72,4 +78,56 @@ fi
uv sync --group build
"${build_command[@]}"
printf '\nBuild completed. Default application path: %s/build/TapLauncher.app\n' "$project_dir"
app_path="$project_dir/build/TapLauncher.app"
dmg_path="$project_dir/build/TapLauncher.dmg"
if [[ ! -d "$app_path/Contents/MacOS" ]]; then
echo "Error: application output is missing or incomplete: $app_path" >&2
exit 1
fi
printf '\nApplication build completed: %s\n' "$app_path"
dmg_staging_dir="$(mktemp -d "$project_dir/build/dmg-temp.XXXXXX")"
dmg_output_dir="$(mktemp -d "$project_dir/build/dmg-output.XXXXXX")"
dmg_candidate="$dmg_output_dir/TapLauncher.dmg"
cleanup() {
rm -rf "$dmg_staging_dir"
rm -rf "$dmg_output_dir"
}
trap cleanup EXIT INT TERM
ditto --noqtn "$app_path" "$dmg_staging_dir/TapLauncher.app"
ln -s /Applications "$dmg_staging_dir/Applications"
create_dmg() {
hdiutil create \
-volname "TapLauncher" \
-srcfolder "$dmg_staging_dir" \
-format UDZO \
-imagekey zlib-level=9 \
"$dmg_candidate"
}
for attempt in 1 2 3; do
if create_dmg; then
break
fi
if [[ "$attempt" -eq 3 ]]; then
echo "Error: unable to create DMG after $attempt attempts." >&2
exit 1
fi
echo "DMG creation failed (attempt $attempt/3); retrying..." >&2
rm -f "$dmg_candidate"
sleep "$attempt"
done
if ! hdiutil verify "$dmg_candidate"; then
echo "Error: DMG verification failed; existing output was not replaced." >&2
exit 1
fi
mv -f "$dmg_candidate" "$dmg_path"
printf 'DMG build completed: %s\n' "$dmg_path"
+1 -1
View File
@@ -1,4 +1,4 @@
LAUNCHER_VERSION = "0.1.5-alpha"
LAUNCHER_VERSION = "0.1.6-alpha-1"
LAUNCHER_NAME = "TapLauncher"
LAUNCHER_DIR_NAME = "TapLauncher"
MAIN_REPO_URL = "https://repo.weispace.net/wei/Launcher/"
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "testlauncher"
version = "0.1.6a0"
version = "0.1.6a1"
description = "A lightweight Minecraft launcher."
readme = "README.md"
requires-python = ">=3.10"