-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-release.sh
executable file
·52 lines (42 loc) · 1.13 KB
/
build-release.sh
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
#!/bin/bash
# Define all target runtime identifiers (RIDs)
PLATFORMS=(
# Windows
"win-x64"
"win-x86"
"win-arm64"
# macOS
"osx-x64"
"osx-arm64"
# Linux
"linux-x64"
"linux-arm"
"linux-arm64"
)
# Create output directory
PUBLISH_DIR="./bin/Publish"
mkdir -p "$PUBLISH_DIR"
# Build for each platform
for PLATFORM in "${PLATFORMS[@]}"; do
echo "Building for $PLATFORM..."
OUTPUT_DIR="$PUBLISH_DIR/$PLATFORM"
# Create self-contained deployment
dotnet publish -c Release -r "$PLATFORM" \
--self-contained true \
-p:PublishSingleFile=true \
-p:IncludeNativeLibrariesForSelfExtract=true \
-p:PublishTrimmed=true \
-o "$OUTPUT_DIR"
# Create zip file
if [ -d "$OUTPUT_DIR" ]; then
ZIP_NAME="BrowserRedirector-$PLATFORM.zip"
echo "Creating $ZIP_NAME..."
# Check if the platform is Windows and rename the executable to include .exe
if [[ $PLATFORM == win* ]]; then
(cd "$OUTPUT_DIR" && zip -r "../../$ZIP_NAME" *)
else
(cd "$OUTPUT_DIR" && zip -r "../../$ZIP_NAME" *)
fi
fi
done
echo "Build complete! Output files are in $PUBLISH_DIR and zip files in ./bin/"