From 1f5ec0628fefffc61e841e0dbb906a2b52372da7 Mon Sep 17 00:00:00 2001 From: Freddie Wang Date: Tue, 6 Apr 2021 13:29:38 +0800 Subject: [PATCH] build version --- build-arm.sh | 4 ++-- build-linux.sh | 9 +++++++-- build-win.ps1 | 9 ++++++--- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/build-arm.sh b/build-arm.sh index c733837..856ecc8 100644 --- a/build-arm.sh +++ b/build-arm.sh @@ -3,11 +3,11 @@ mkdir -p build regex='VERSION = '"'"'(.*)'"'"'' -[[ $(cat ./src/util/Consts.ts) =~ $regex ]] +[[ $(cat ./src/utils/Consts.ts) =~ $regex ]] VERSION=${BASH_REMATCH[1]} -echo "Building Version $VERSION for arm64" +echo "Building Version $VERSION for Arm" echo "NPM Install" npm ci diff --git a/build-linux.sh b/build-linux.sh index 7f277de..49621d1 100644 --- a/build-linux.sh +++ b/build-linux.sh @@ -2,7 +2,12 @@ mkdir -p build -echo "Building Linux Version" +regex='VERSION = '"'"'(.*)'"'"'' +[[ $(cat ./src/utils/Consts.ts) =~ $regex ]] + +VERSION=${BASH_REMATCH[1]} + +echo "Building Version $VERSION for Linux" echo "NPM Install" npm ci @@ -28,4 +33,4 @@ rm -f ./build/asphyxia-core-linux-x64.zip cd build zip -qq asphyxia-core-linux-x64.zip asphyxia-core cd .. -zip -qq ./build/asphyxia-core-armv7.zip -r plugins +zip -qq ./build/asphyxia-core-linux-x64.zip -r plugins diff --git a/build-win.ps1 b/build-win.ps1 index 1b0fa60..3932d22 100644 --- a/build-win.ps1 +++ b/build-win.ps1 @@ -1,9 +1,12 @@ +# Getting version +$VER_CODE = Select-String -Path ".\src\utils\Consts.ts" -Pattern "VERSION = '(.*)'" +$VERSION = $VER_CODE.Matches.Groups[1].Value; + +Write-Output "Building Version $VERSION for Windows" + # Prepare directories New-Item -Path "." -Name "build" -ItemType "directory" -Force | Out-Null -Write-Output "Building Windows Version" - - Write-Output "Copying windows node binary cache" New-Item -Path "$env:USERPROFILE" -Name ".pkg-cache" -ItemType "directory" -Force | Out-Null New-Item -Path "$env:USERPROFILE\.pkg-cache" -Name "v2.6" -ItemType "directory" -Force | Out-Null