Unverified Commit 6b3fa4fe authored by Jeremy Bokobza's avatar Jeremy Bokobza Committed by GitHub

Packaging for Windows (#370)

* packaging for Windows

* configure appveyor file for windows packaging

* modify daemon path
parent 02f08981
......@@ -10,13 +10,21 @@
},
"win": {
"icon": "dist/assets/images/breeze-logo",
"target": ["nsis"],
"asarUnpack": "assets/daemon/*"
"target": ["nsis"]
},
"nsis": {
"oneClick": false
"oneClick": false,
"perMachine": true,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true,
"guid": "ed20df62-ff5a-4b83-a5e3-a361357c6e51",
"createDesktopShortcut": false,
"createStartMenuShortcut": true,
"artifactName": "${productName}.v${version}.setup.${env.win_runtime}.${ext}"
},
"msi": {
"warningsAsErrors": false
}
},
"extraResources": ["daemon/**/*"]
}
......@@ -157,9 +157,14 @@ function startBitcoinApi() {
//Start Breeze Bitcoin Daemon
let apiPath = path.resolve(__dirname, 'assets//daemon//Stratis.BreezeD');
if (os.platform() === 'win32') {
apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe');
//apiPath = path.resolve(__dirname, '..\\app.asar.unpacked\\assets\\daemon\\Stratis.BreezeD.exe');
}
apiPath = path.resolve(__dirname, '..\\..\\resources\\daemon\\Stratis.BreezeD.exe');
}
// else if(os.platform() === 'darwin') {
// apiPath = path.resolve(__dirname, '..//..//Content//resources//daemon//Stratis.BreezeD.exe');
// } else {
// apiPath = path.resolve(__dirname, '..//..//resources//daemon//Stratis.BreezeD.exe');
// }
if(!testnet) {
bitcoinProcess = spawnBitcoin(apiPath, {
......@@ -184,9 +189,13 @@ function startStratisApi() {
//Start Breeze Stratis Daemon
let apiPath = path.resolve(__dirname, 'assets//daemon//Stratis.BreezeD');
if (os.platform() === 'win32') {
apiPath = path.resolve(__dirname, 'assets\\daemon\\Stratis.BreezeD.exe');
//apiPath = path.resolve(__dirname, '..\\app.asar.unpacked\\assets\\daemon\\Stratis.BreezeD.exe');
}
apiPath = path.resolve(__dirname, '..\\..\\resources\\daemon\\Stratis.BreezeD.exe');
}
// else if(os.platform() === 'darwin') {
// apiPath = path.resolve(__dirname, '..//..//Content//resources//daemon//Stratis.BreezeD.exe');
// } else {
// apiPath = path.resolve(__dirname, '..//..//resources//daemon//Stratis.BreezeD.exe');
// }
if (!testnet) {
stratisProcess = spawnStratis(apiPath, ['stratis'], {
......
......@@ -76,7 +76,8 @@ before_build:
cd $env:APPVEYOR_BUILD_FOLDER/Breeze.UI
Install-Product node 6
Install-Product node 8
npm config set unsafe-perm=true
npm install
Write-Host "$env:log_prefix FINISHED restoring dotnet and npm packages" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
......@@ -85,24 +86,22 @@ build_script:
- ps: |
Write-Host "$env:log_prefix running 'dotnet publish'" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/StratisBitcoinFullNode/Stratis.BreezeD
dotnet publish -c $env:configuration -v m -r $env:win_runtime -o $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:win_runtime
dotnet publish -c $env:configuration -v m -r $env:win_runtime -o $env:APPVEYOR_BUILD_FOLDER\Breeze.UI\daemon
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "$env:log_prefix running 'npm run'" -foregroundcolor "magenta"
Write-Host "$env:log_prefix building Breeze" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/Breeze.UI
npm run build:prod
Write-Host "$env:log_prefix packaging breeze" -foregroundcolor "magenta"
node package.js --platform=$env:plat --arch=$env:arch --path=$env:APPVEYOR_BUILD_FOLDER\breeze_out
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "$env:log_prefix rename the folder generated by npm from $env:node_output_name to $env:app_output_name" -foregroundcolor "magenta"
Rename-Item $env:APPVEYOR_BUILD_FOLDER\breeze_out\$env:node_output_name $env:app_output_name
Write-Host "$env:log_prefix packaging breeze" -foregroundcolor "magenta"
npx electron-builder build --windows --$env:arch
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "[$env:configuration][$env:win_runtime] FINISHED Breeze packaging" -foregroundcolor "magenta"
Write-Host "$env:log_prefix copying the Breeze api into the app" -foregroundcolor "magenta"
New-Item -Path $env:APPVEYOR_BUILD_FOLDER\breeze_out\$env:app_output_name\resources\app\assets\daemon -ItemType directory
xcopy /s $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:win_runtime\* $env:APPVEYOR_BUILD_FOLDER\breeze_out\$env:app_output_name\resources\app\assets\daemon\
Write-Host "$env:log_prefix zipping the result" -foregroundcolor "magenta"
7z a $env:APPVEYOR_BUILD_FOLDER\breeze_out\$env:app_output_zip_name $env:APPVEYOR_BUILD_FOLDER\breeze_out\$env:app_output_name
Write-Host "[$env:configuration][$env:win_runtime] FINISHED dotnet build" -foregroundcolor "magenta"
dir
cd app-builds
dir
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
test_script:
......@@ -116,7 +115,7 @@ test_script:
# pushing all files in build directory recursively
artifacts:
- path: breeze_out\*.zip
- path: Breeze.UI\app-builds\*.exe
name: Breeze app
#----------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment