-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_zip.sh
More file actions
executable file
·42 lines (35 loc) · 1.42 KB
/
build_zip.sh
File metadata and controls
executable file
·42 lines (35 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/bash
# Build SystemTrayTerminal_vX.Y.Z.zip for GitHub Releases
set -e
cd "$(dirname "$0")"
VERSION="$(sed -nE 's/^let kAppVersion = "([^"]+)".*/\1/p' systemtrayterminal.swift | head -n1)"
[ -n "$VERSION" ] || { echo "ERROR: kAppVersion not found in systemtrayterminal.swift"; exit 1; }
ZIP_NAME="SystemTrayTerminal_v${VERSION}.zip"
echo "=== Building ${ZIP_NAME} (v${VERSION}) ==="
# ─── Step 1: Build .app bundle ───
echo "[1/2] Building .app bundle..."
bash build_app.sh
# ─── Step 2: Package zip ───
echo "[2/2] Packaging ${ZIP_NAME}..."
rm -f "$ZIP_NAME"
ditto -ck --sequesterRsrc --keepParent SystemTrayTerminal.app "$ZIP_NAME"
# Add documentation files into the zip
# (ditto creates a clean zip, we use /usr/bin/zip to append extra files)
/usr/bin/zip -j "$ZIP_NAME" install.sh FIRST_READ.txt LICENSE README.md
# Generate SHA256 sidecar for updater integrity verification
SHA256_NAME="${ZIP_NAME}.sha256"
shasum -a 256 "$ZIP_NAME" | awk '{print $1}' > "$SHA256_NAME"
ZIP_SIZE=$(du -sh "$ZIP_NAME" | cut -f1)
echo ""
echo " ${ZIP_NAME} → ${ZIP_SIZE}"
echo " Contents:"
echo " SystemTrayTerminal.app"
echo " install.sh"
echo " FIRST_READ.txt"
echo " LICENSE"
echo " README.md"
echo ""
echo " SHA256: ${SHA256_NAME}"
echo ""
echo " Ready for GitHub Release v${VERSION}"
echo " Upload: gh release create v${VERSION} ${ZIP_NAME} ${SHA256_NAME} --title \"v${VERSION}\""