Unified build from mac
This commit is contained in:
@@ -3,13 +3,12 @@ param (
|
||||
[Parameter(Mandatory=$true)][string]$version,
|
||||
[Parameter(Mandatory=$true)][string]$prev,
|
||||
[Parameter(Mandatory=$true)][string]$server
|
||||
# [Parameter(Mandatory=$true)][string]$macserver
|
||||
)
|
||||
|
||||
Write-Host "[Initializing]"
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-zec-qt-wallet-v$version.tar.gz
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-zec-qt-wallet-v$version.deb
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-zec-qt-wallet-v$version.zip
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/zec-qt-wallet-v$version.deb
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-zec-qt-wallet-v$version.msi
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-zec-qt-wallet-v$version.dmg
|
||||
|
||||
@@ -23,25 +22,6 @@ Get-Content README.md | Foreach-Object { $_ -replace "$prev", "$version" } | Out
|
||||
Move-Item -Force README-new.md README.md
|
||||
Write-Host ""
|
||||
|
||||
|
||||
#Write-Host "[Building on Mac]"
|
||||
#Write-Host -NoNewline "Copying files.........."
|
||||
#ssh $macserver "rm -rf /tmp/zqwbuild"
|
||||
#ssh $macserver "mkdir /tmp/zqwbuild"
|
||||
#scp -r src/ res/ ./zec-qt-wallet.pro ./application.qrc ./LICENSE ./README.md ${macserver}:/tmp/zqwbuild/ | Out-Null
|
||||
#Write-Host "[OK]"
|
||||
#ssh $macserver "cd /tmp/zqwbuild && /usr/local/bin/dos2unix -q src/scripts/mkmacdmg.sh"
|
||||
#ssh $macserver "cd /tmp/zqwbuild && /usr/local/bin/dos2unix -q src/version.h"
|
||||
#ssh $macserver "cd /tmp/zqwbuild && APP_VERSION=$version QT_PATH=~/Qt/5.11.2/clang_64/ ZCASH_DIR=~/github/zcash bash src/scripts/mkmacdmg.sh"
|
||||
#if (! $?) {
|
||||
# Write-Output "[Error]"
|
||||
# exit 1;
|
||||
#}
|
||||
#New-Item artifacts -itemtype directory -Force | Out-Null
|
||||
#scp ${macserver}:/tmp/zqwbuild/artifacts/* artifacts/ | Out-Null
|
||||
#Write-Host ""
|
||||
|
||||
|
||||
Write-Host "[Building Linux + Windows]"
|
||||
Write-Host -NoNewline "Copying files.........."
|
||||
ssh $server "rm -rf /tmp/zqwbuild"
|
||||
@@ -74,7 +54,6 @@ Write-Host -NoNewline "Checking Build........."
|
||||
if (! (Test-Path ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz) -or
|
||||
! (Test-Path ./artifacts/linux-deb-zec-qt-wallet-v$version.deb) -or
|
||||
! (Test-Path ./artifacts/Windows-binaries-zec-qt-wallet-v$version.zip) -or
|
||||
# ! (Test-Path ./artifacts/macOS-zec-qt-wallet-v$version.dmg) -or
|
||||
! (Test-Path ./artifacts/Windows-installer-zec-qt-wallet-v$version.msi) ) {
|
||||
Write-Host "[Error]"
|
||||
exit 1;
|
||||
|
||||
89
src/scripts/dounifiedbuild.ps1
Normal file
89
src/scripts/dounifiedbuild.ps1
Normal file
@@ -0,0 +1,89 @@
|
||||
# Unified build script for Windows, Linux and Mac builder. Run on a Windows machine inside powershell.
|
||||
param (
|
||||
[Parameter(Mandatory=$true)][string]$version,
|
||||
[Parameter(Mandatory=$true)][string]$prev,
|
||||
[Parameter(Mandatory=$true)][string]$server,
|
||||
[Parameter(Mandatory=$true)][string]$winserver
|
||||
)
|
||||
|
||||
Write-Host "[Initializing]"
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-zec-qt-wallet-v$version.deb
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-zec-qt-wallet-v$version.zip
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-zec-qt-wallet-v$version.msi
|
||||
Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-zec-qt-wallet-v$version.dmg
|
||||
|
||||
Remove-Item -Recurse -Force -ErrorAction Ignore ./bin
|
||||
Remove-Item -Recurse -Force -ErrorAction Ignore ./debug
|
||||
Remove-Item -Recurse -Force -ErrorAction Ignore ./release
|
||||
|
||||
# Create the version.h file and update README version number
|
||||
Write-Output "#define APP_VERSION `"$version`"" > src/version.h
|
||||
Get-Content README.md | Foreach-Object { $_ -replace "$prev", "$version" } | Out-File README-new.md
|
||||
Move-Item -Force README-new.md README.md
|
||||
Write-Host ""
|
||||
|
||||
|
||||
Write-Host "[Building on Mac]"
|
||||
bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --zcash_path ~/github/zcash
|
||||
if (! $?) {
|
||||
Write-Output "[Error]"
|
||||
exit 1;
|
||||
}
|
||||
Write-Host ""
|
||||
|
||||
|
||||
Write-Host "[Building Linux + Windows]"
|
||||
Write-Host -NoNewline "Copying files.........."
|
||||
ssh $server "rm -rf /tmp/zqwbuild"
|
||||
ssh $server "mkdir /tmp/zqwbuild"
|
||||
scp -r src/ res/ ./zec-qt-wallet.pro ./application.qrc ./LICENSE ./README.md ${server}:/tmp/zqwbuild/ | Out-Null
|
||||
ssh $server "dos2unix -q /tmp/zqwbuild/src/scripts/mkrelease.sh" | Out-Null
|
||||
ssh $server "dos2unix -q /tmp/zqwbuild/src/version.h"
|
||||
Write-Host "[OK]"
|
||||
|
||||
ssh $server "cd /tmp/zqwbuild && APP_VERSION=$version PREV_VERSION=$prev bash src/scripts/mkrelease.sh"
|
||||
if (!$?) {
|
||||
Write-Output "[Error]"
|
||||
exit 1;
|
||||
}
|
||||
|
||||
New-Item artifacts -itemtype directory -Force | Out-Null
|
||||
scp ${server}:/tmp/zqwbuild/artifacts/* artifacts/ | Out-Null
|
||||
scp -r ${server}:/tmp/zqwbuild/release . | Out-Null
|
||||
|
||||
Write-Host -NoNewline "Building Installer....."
|
||||
ssh $winserver "Remove-Item -Path zqwbuild -Recurse" | Out-Null
|
||||
ssh $winserver "New-Item zqwbuild -itemtype directory" | Out-Null
|
||||
|
||||
# Note: For some mysterious reason, we can't seem to do a scp from here to windows machine.
|
||||
# So, we'll ssh to windows, and execute an scp command to pull files from here to there.
|
||||
# Same while copying the built msi. A straight scp pull from windows to here doesn't work,
|
||||
# so we ssh to windows, and then scp push the file to here.
|
||||
$myhostname = (hostname) | Out-String -NoNewline
|
||||
Remove-Item -Path /tmp/zqwbuild -Recurse | Out-Null
|
||||
New-Item -Path /tmp/zqwbuild -itemtype directory | Out-Null
|
||||
Copy-Item src /tmp/zqwbuild/ -Recurse
|
||||
Copy-Item res /tmp/zqwbuild/ -Recurse
|
||||
Copy-Item release /tmp/zqwbuild/ -Recurse
|
||||
ssh $winserver "scp -r ${myhostname}:/tmp/zqwbuild/* zqwbuild/"
|
||||
ssh $winserver "cd zqwbuild ; src/scripts/mkwininstaller.ps1 -version $version" >/dev/null
|
||||
if (!$?) {
|
||||
Write-Output "[Error]"
|
||||
exit 1;
|
||||
}
|
||||
ssh $winserver "scp zqwbuild/artifacts/* ${myhostname}:/tmp/zqwbuild/"
|
||||
Copy-Item /tmp/zqwbuild/*.msi artifacts/
|
||||
Write-Host "[OK]"
|
||||
|
||||
# Finally, test to make sure all files exist
|
||||
Write-Host -NoNewline "Checking Build........."
|
||||
if (! (Test-Path ./artifacts/linux-binaries-zec-qt-wallet-v$version.tar.gz) -or
|
||||
! (Test-Path ./artifacts/linux-deb-zec-qt-wallet-v$version.deb) -or
|
||||
! (Test-Path ./artifacts/Windows-binaries-zec-qt-wallet-v$version.zip) -or
|
||||
! (Test-Path ./artifacts/macOS-zec-qt-wallet-v$version.dmg) -or
|
||||
! (Test-Path ./artifacts/Windows-installer-zec-qt-wallet-v$version.msi) ) {
|
||||
Write-Host "[Error]"
|
||||
exit 1;
|
||||
}
|
||||
Write-Host "[OK]"
|
||||
@@ -1,5 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Accept the variables as command line arguments as well
|
||||
POSITIONAL=()
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-q|--qt_path)
|
||||
QT_PATH="$2"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
-z|--zcash_path)
|
||||
ZCASH_DIR="$2"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
-v|--version)
|
||||
APP_VERSION="$2"
|
||||
shift # past argument
|
||||
shift # past value
|
||||
;;
|
||||
*) # unknown option
|
||||
POSITIONAL+=("$1") # save it in an array for later
|
||||
shift # past argument
|
||||
;;
|
||||
esac
|
||||
done
|
||||
set -- "${POSITIONAL[@]}" # restore positional parameters
|
||||
|
||||
if [ -z $QT_PATH ]; then
|
||||
echo "QT_PATH is not set. Please set it to the base directory of Qt";
|
||||
exit 1;
|
||||
@@ -57,7 +87,7 @@ echo "[OK]"
|
||||
|
||||
|
||||
echo -n "Building dmg..........."
|
||||
create-dmg --volname "zec-qt-wallet-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "zec-qt-wallet.app" 200 190 --app-drop-link 600 185 --hide-extension "zec-qt-wallet.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-zec-qt-wallet-v$APP_VERSION.dmg zec-qt-wallet.app >/dev/null
|
||||
create-dmg --volname "zec-qt-wallet-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "zec-qt-wallet.app" 200 190 --app-drop-link 600 185 --hide-extension "zec-qt-wallet.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-zec-qt-wallet-v$APP_VERSION.dmg zec-qt-wallet.app >/dev/null 2>&1
|
||||
|
||||
#mkdir bin/dmgbuild >/dev/null 2>&1
|
||||
#sed "s/RELEASE_VERSION/${APP_VERSION}/g" res/appdmg.json > bin/dmgbuild/appdmg.json
|
||||
|
||||
@@ -4,8 +4,8 @@ param (
|
||||
|
||||
$target="zec-qt-wallet-v$version"
|
||||
|
||||
Remove-Item -Path release/wininstaller -Recurse | Out-Null
|
||||
New-Item release/wininstaller -itemtype directory | Out-Null
|
||||
Remove-Item -Path release/wininstaller -Recurse -ErrorAction Ignore | Out-Null
|
||||
New-Item release/wininstaller -itemtype directory | Out-Null
|
||||
|
||||
Copy-Item release/$target/zec-qt-wallet.exe release/wininstaller/
|
||||
Copy-Item release/$target/LICENSE release/wininstaller/
|
||||
|
||||
Reference in New Issue
Block a user