-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sh
48 lines (41 loc) · 1.22 KB
/
build.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
#!/bin/bash
# Find the absolute path of the script
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Check if version parameter is provided
if [ "$#" -ne 1 ]; then
echo "Version number is required."
echo "Usage: ./build.sh [version]"
exit 1
fi
# Determine the default RID for the platform
RID=""
if [[ "$OSTYPE" == "darwin"* ]]; then
# macOS
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]; then
RID="osx-x64"
elif [[ "$ARCH" == "arm64" ]]; then
RID="osx-arm64"
fi
elif [[ "$OSTYPE" == "linux"* ]]; then
# Linux
ARCH=$(uname -m)
if [[ "$ARCH" == "x86_64" ]]; then
RID="linux-x64"
elif [[ "$ARCH" == "aarch64" ]]; then
RID="linux-arm64"
fi
else
echo "Unsupported OS type: $OSTYPE"
exit 1
fi
echo "Using RID: $RID"
BUILD_VERSION="$1"
RELEASE_DIR="$SCRIPT_DIR/releases"
PUBLISH_DIR="$SCRIPT_DIR/publish"
echo ""
echo "Compiling Launcher with dotnet..."
dotnet publish ./src/Launcher.sln -c Release --self-contained -r "$RID" -o "$PUBLISH_DIR"
echo ""
echo "Building Velopack Release v$BUILD_VERSION"
vpk pack --packTitle "OSFR Launcher" --packAuthors "OSFR Team" -u OSFRLauncher -e Launcher.exe -o "$RELEASE_DIR" -p "$PUBLISH_DIR" -v $BUILD_VERSION