lbry-desktop/build/build.ps1

55 lines
1.8 KiB
PowerShell
Raw Normal View History

2017-04-11 16:38:32 +02:00
pip install -r build\requirements.txt
2017-06-26 19:07:44 +02:00
2017-04-11 16:38:32 +02:00
# Get the latest stable version of Node.js or io.js
Install-Product node $env:nodejs_version
2017-06-23 21:18:03 +02:00
npm install -g yarn
yarn install
2017-06-26 19:07:44 +02:00
# do app
2017-11-24 15:31:05 +01:00
cd src\main
2017-06-23 21:18:03 +02:00
yarn install
# necessary to ensure native Node modules (e.g. keytar) are built against the correct version of Node)
# yes, it needs to be run twice. it fails the first time, not sure why
node_modules\.bin\electron-rebuild
node_modules\.bin\electron-rebuild
2017-11-24 15:31:05 +01:00
cd ..\..
2017-06-26 19:07:44 +02:00
# build ui
2017-11-27 12:52:11 +01:00
cd src\renderer
yarn install
2017-06-26 19:07:44 +02:00
npm rebuild node-sass
2017-04-11 16:38:32 +02:00
node_modules\.bin\node-sass --output dist\css --sourcemap=none scss\
2017-11-13 16:22:21 +01:00
node_modules\.bin\webpack --config webpack.prod.js
2017-11-24 15:31:05 +01:00
Copy-Item dist ..\main\ -recurse
cd ..\..
2017-04-11 16:38:32 +02:00
2017-06-26 19:07:44 +02:00
2017-04-11 16:38:32 +02:00
# get daemon and cli executable
2017-11-24 15:31:05 +01:00
$package_settings = (Get-Content src\main\package.json -Raw | ConvertFrom-Json).lbrySettings
$daemon_ver = $package_settings.lbrynetDaemonVersion
$daemon_url_template = $package_settings.lbrynetDaemonUrlTemplate
$daemon_url = $daemon_url_template.Replace('OSNAME', 'windows').Replace('DAEMONVER', $daemon_ver)
2017-04-11 16:38:32 +02:00
Invoke-WebRequest -Uri $daemon_url -OutFile daemon.zip
2017-11-24 15:31:05 +01:00
Expand-Archive daemon.zip -DestinationPath src\main\dist\
dir src\main\dist\ # verify that daemon binary is there
2017-04-11 16:38:32 +02:00
rm daemon.zip
2017-06-26 19:07:44 +02:00
2017-04-11 16:38:32 +02:00
# build electron app
node_modules\.bin\build -p never
$binary_name = Get-ChildItem -Path dist -Filter '*.exe' -Name
$new_name = $binary_name -replace '^LBRY Setup (.*)\.exe$', 'LBRY_$1.exe'
Rename-Item -Path "dist\$binary_name" -NewName $new_name
dir dist # verify that binary was built/named correctly
2017-04-25 20:41:26 +02:00
2017-06-26 19:07:44 +02:00
2017-04-25 20:41:26 +02:00
# sign binary
nuget install secure-file -ExcludeVersion
2017-07-24 22:10:57 +02:00
secure-file\tools\secure-file -decrypt build\lbry3.pfx.enc -secret "$env:pfx_key"
& ${env:SIGNTOOL_PATH} sign /f build\lbry3.pfx /p "$env:key_pass" /tr http://tsa.starfieldtech.com /td SHA256 /fd SHA256 dist\*.exe
2017-04-25 20:41:26 +02:00
2017-06-26 19:07:44 +02:00
2017-07-24 22:10:57 +02:00
python build\upload_assets.py