forked from stratisproject/StratisCore
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d89cf34
commit 1c12795
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/bin/bash | ||
|
||
arch=x64 | ||
configuration=Release | ||
os_platform=win | ||
log_prefix=WINDOWS-BUILD | ||
build_directory=$(dirname $(dirname "$PWD")) | ||
release_directory="/tmp/xds/${log_prefix}" | ||
|
||
# exit if error | ||
set -o errexit | ||
|
||
# print out a few variables | ||
echo "current environment variables:" | ||
echo "OS name:" $os_platform | ||
echo "Build directory:" $build_directory | ||
echo "Release directory:" $release_directory | ||
echo "Architecture:" $arch | ||
echo "Configuration:" $configuration | ||
dotnet --info | ||
|
||
# Initialize dependencies | ||
echo $log_prefix STARTED restoring dotnet and npm packages | ||
cd $build_directory | ||
git submodule update --init --recursive | ||
|
||
cd $build_directory/StratisCore.UI | ||
|
||
echo $log_prefix Running npm install | ||
npm install --verbose | ||
#npm install --save-dev electron-winstaller | ||
#npm install --save-dev electron-builder-squirrel-windows | ||
|
||
echo $log_prefix FINISHED restoring dotnet and npm packages | ||
|
||
# dotnet publish | ||
echo $log_prefix running 'dotnet publish' | ||
cd $build_directory/xds/src/daemon | ||
dotnet clean | ||
dotnet restore | ||
dotnet publish -c $configuration -r $os_platform-$arch -v m -o $build_directory/StratisCore.UI/daemon | ||
|
||
# node Build | ||
cd $build_directory/StratisCore.UI | ||
echo $log_prefix Building and packaging StratisCore.UI | ||
npm install | ||
npm run package:windows64 | ||
echo $log_prefix finished packaging | ||
|
||
echo $log_prefix contents of the app-builds folder | ||
cd $build_directory/StratisCore.UI/app-builds/ | ||
# replace the spaces in the name with a dot as CI system have trouble handling spaces in names. | ||
for file in *.{exe}; do sudo mv "$file" `echo $file | tr ' ' '.'` 2>/dev/null || : ; done | ||
ls -al -h | ||
|
||
# Move files to release directory | ||
sudo rm -rf $release_directory | ||
sudo mkdir -p $release_directory | ||
sudo cp -r $build_directory/StratisCore.UI/app-builds/* $release_directory | ||
|
||
#Clear previous builds | ||
sudo rm -rf $build_directory/StratisCore.UI/app-builds | ||
sudo rm -rf $build_directory/StratisCore.UI/daemon | ||
sudo rm -rf $build_directory/StratisCore.UI/dist | ||
|
||
echo $log_prefix FINISHED build |