-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild_all.sh
More file actions
executable file
·99 lines (82 loc) · 3.28 KB
/
Copy pathbuild_all.sh
File metadata and controls
executable file
·99 lines (82 loc) · 3.28 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
set -e
# Define version
VERSION="0.4.8"
OUTPUT_DIR="build_artifacts"
echo "=================================="
echo "Playerr Build Script v$VERSION"
echo "=================================="
# 1. Build Frontend
echo "[1/2] Building Frontend..."
npm install
npm run build
# 2. Build Backend for multiple targets
echo "[2/2] Building Backend executables..."
mkdir -p $OUTPUT_DIR
# Windows x64
echo " -> Building for Windows (x64)..."
dotnet publish src/Playerr.Host/Playerr.Host.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true -o $OUTPUT_DIR/win-x64
echo " Copying assets..."
mkdir -p $OUTPUT_DIR/win-x64/_output/UI
cp -R _output/UI/* $OUTPUT_DIR/win-x64/_output/UI/
cp src/Playerr.Host/appsettings.json $OUTPUT_DIR/win-x64/
# Ensure no personal configs are included
rm -f $OUTPUT_DIR/win-x64/config/*.json
rm -f $OUTPUT_DIR/win-x64/settings/*.json
echo " Packaging Windows Zip..."
cd $OUTPUT_DIR
zip -r -q "Playerr-Windows-x64.zip" "win-x64"
cd ..
echo " Generating Windows Installer (NSIS) via Docker..."
docker run --rm -v "$(pwd):/work" -w /work debian:stable-slim bash -c "apt-get update && apt-get install -y nsis && makensis installer.nsi"
# Linux x64
echo " -> Building for Linux (x64)..."
dotnet publish src/Playerr.Host/Playerr.Host.csproj -c Release -r linux-x64 --self-contained true -p:PublishSingleFile=true -o $OUTPUT_DIR/linux-x64
echo " Copying assets..."
mkdir -p $OUTPUT_DIR/linux-x64/_output/UI
cp -R _output/UI/* $OUTPUT_DIR/linux-x64/_output/UI/
cp src/Playerr.Host/appsettings.json $OUTPUT_DIR/linux-x64/
# Ensure no personal configs are included
rm -f $OUTPUT_DIR/linux-x64/config/*.json
rm -f $OUTPUT_DIR/linux-x64/settings/*.json
echo " Packaging Linux..."
# Create Launcher for Linux
cat > $OUTPUT_DIR/linux-x64/Playerr <<EOF
#!/bin/bash
DIR="\$( cd "\$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
cd "\$DIR"
./Playerr.Host "\$@"
EOF
chmod +x $OUTPUT_DIR/linux-x64/Playerr
cd $OUTPUT_DIR
tar -czf "Playerr-Linux-x64.tar.gz" "linux-x64"
cd ..
# MacOS x64 (Intel)
echo " -> Building for MacOS (Intel)..."
dotnet publish src/Playerr.Host/Playerr.Host.csproj -c Release -r osx-x64 --self-contained true -o $OUTPUT_DIR/osx-x64
echo " Copying assets..."
mkdir -p $OUTPUT_DIR/osx-x64/_output/UI
cp -R _output/UI/* $OUTPUT_DIR/osx-x64/_output/UI/
cp src/Playerr.Host/appsettings.json $OUTPUT_DIR/osx-x64/
# Ensure no personal configs are included
rm -f $OUTPUT_DIR/osx-x64/config/*.json
rm -f $OUTPUT_DIR/osx-x64/settings/*.json
echo "Packaging MacOS Intel..."
./create_mac_app.sh osx-x64
# MacOS arm64 (Apple Silicon)
echo " -> Building for MacOS (Apple Silicon)..."
dotnet publish src/Playerr.Host/Playerr.Host.csproj -c Release -r osx-arm64 --self-contained true -o $OUTPUT_DIR/osx-arm64
echo " Copying assets..."
mkdir -p $OUTPUT_DIR/osx-arm64/_output/UI
cp -R _output/UI/* $OUTPUT_DIR/osx-arm64/_output/UI/
cp src/Playerr.Host/appsettings.json $OUTPUT_DIR/osx-arm64/
# Ensure no personal configs are included
rm -f $OUTPUT_DIR/osx-arm64/config/*.json
rm -f $OUTPUT_DIR/osx-arm64/settings/*.json
echo "=================================="
echo "Packaging MacOS Silicon..."
./create_mac_app.sh osx-arm64
echo "=================================="
echo "Build Complete!"
echo "Artifacts available in: $OUTPUT_DIR"
echo "=================================="