mirror of
https://github.com/velopack/velopack.git
synced 2025-10-25 15:19:22 +00:00
34 lines
1.1 KiB
Bash
34 lines
1.1 KiB
Bash
#!/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 "Please provide a version number."
|
|
echo "Usage: ./build.sh version_number"
|
|
exit 1
|
|
fi
|
|
|
|
echo "Building Velopack"
|
|
cd "$SCRIPT_DIR/../../src/Rust"
|
|
cargo build
|
|
cd "$SCRIPT_DIR/../.."
|
|
dotnet build src/Velopack.Vpk/Velopack.Vpk.csproj
|
|
cd "$SCRIPT_DIR"
|
|
|
|
version="$1"
|
|
releasesDir="$SCRIPT_DIR/releases"
|
|
|
|
# Write to Const.cs
|
|
echo "class Const { public const string RELEASES_DIR = @\"$releasesDir\"; } " > "$(dirname "$0")/Const.cs"
|
|
echo "Const.cs file updated with releases directory ($releasesDir)."
|
|
|
|
echo "Compiling AvaloniaCrossPlat with dotnet..."
|
|
dotnet publish -c Release --self-contained -r linux-x64 -o "$(dirname "$0")/publish"
|
|
|
|
echo "class Const { public const string RELEASES_DIR = @\"{REPLACE_ME}\"; } " > "$(dirname "$0")/Const.cs"
|
|
echo "Const.cs file reset"
|
|
|
|
echo "Building Velopack Release v$version"
|
|
"$(dirname "$0")/../../build/Debug/net8.0/vpk" pack -u AvaloniaCrossPlat -v "$version" -o "$releasesDir" -p "$(dirname "$0")/publish" -i Velopack.png |