-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.sh
More file actions
69 lines (55 loc) · 1.64 KB
/
package.sh
File metadata and controls
69 lines (55 loc) · 1.64 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -e
# Cross‑platform packaging script for PaintPower
# Creates installers for Windows (MSIX), macOS (DMG), Linux (AppImage)
TARGETS=(
"win-x86"
"win-x64"
"win-arm64"
"linux-x64"
"linux-arm64"
"linux-musl-x64"
"linux-musl-arm64"
"osx-x64"
"osx-arm64"
)
mkdir -p dist
for RID in "${TARGETS[@]}"; do
echo "Packaging $RID..."
PUBLISH_DIR="publish/$RID"
OUTPUT_DIR="dist/$RID"
mkdir -p "$OUTPUT_DIR"
if [[ "$RID" == win-* ]]; then
echo " -> Preparing MSIX staging folder..."
cp -r "$PUBLISH_DIR"/* "$OUTPUT_DIR"
# Note: MSIX creation normally uses MakeAppx.exe or VS packaging project
elif [[ "$RID" == osx-* ]]; then
echo " -> Creating DMG..."
APP_NAME="PaintPower.app"
APP_PATH="$OUTPUT_DIR/$APP_NAME"
mkdir -p "$APP_PATH/Contents/MacOS"
mkdir -p "$APP_PATH/Contents/Resources"
cp -r "$PUBLISH_DIR"/* "$APP_PATH/Contents/MacOS"
DMG_NAME="PaintPower-$RID.dmg"
hdiutil create -volname "PaintPower" -srcfolder "$APP_PATH" -ov -format UDZO "dist/$DMG_NAME"
elif [[ "$RID" == linux-* ]]; then
echo " -> Creating AppImage..."
APPDIR="$OUTPUT_DIR/AppDir"
mkdir -p "$APPDIR"
cp -r "$PUBLISH_DIR"/* "$APPDIR"
# AppRun
echo -e "#!/bin/bash\nexec ./PaintPower" > "$APPDIR/AppRun"
chmod +x "$APPDIR/AppRun"
# Desktop entry
echo "[Desktop Entry]
Type=Application
Name=PaintPower
Exec=PaintPower
Icon=paintpower
Categories=Graphics;" > "$APPDIR/paintpower.desktop"
# Build AppImage (requires appimagetool)
APPIMAGE_NAME="PaintPower-$RID.AppImage"
appimagetool "$APPDIR" "dist/$APPIMAGE_NAME"
fi
done
echo "All installers created in /dist"