-
Notifications
You must be signed in to change notification settings - Fork 20
/
build.sh
87 lines (67 loc) · 2.39 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
# exit if error
set -o errexit
# define a few variables
node_output_name="Breeze-$os_platform-$arch"
app_output_name="breeze-$TRAVIS_OS_NAME-$arch"
app_output_zip_name="breeze-$TRAVIS_OS_NAME-$arch.zip"
if [ "$TRAVIS_OS_NAME" = "osx" ]
then
dotnet_resources_path_in_app=$TRAVIS_BUILD_DIR/breeze_out/$app_output_name/Breeze.app/contents/resources/app/assets/daemon
else
dotnet_resources_path_in_app=$TRAVIS_BUILD_DIR/breeze_out/$app_output_name/resources/app/assets/daemon
fi
echo "current environment variables:"
echo "OS name:" $TRAVIS_OS_NAME
echo "Platform:" $os_platform
echo "Build directory:" $TRAVIS_BUILD_DIR
echo "Node version:" $TRAVIS_NODE_VERSION
echo "Architecture:" $arch
echo "Configuration:" $configuration
echo "Node.js output name:" $node_output_name
echo "App output folder name:" $app_output_name
echo "App output zip file name:" $app_output_zip_name
echo "dotnet resources path in app:" $dotnet_resources_path_in_app
echo "Branch:" $TRAVIS_BRANCH
echo "Tag:" $TRAVIS_TAG
echo "Commit:" $TRAVIS_COMMIT
echo "Commit message:" $TRAVIS_COMMIT_MESSAGE
dotnet --info
# Initialize dependencies
echo $log_prefix STARTED restoring dotnet and npm packages
cd $TRAVIS_BUILD_DIR
git submodule update --init --recursive
cd $TRAVIS_BUILD_DIR/Breeze.UI
npm install
npm install -g npx
echo $log_prefix FINISHED restoring dotnet and npm packages
# dotnet publish
echo $log_prefix running 'dotnet publish'
cd $TRAVIS_BUILD_DIR/Breeze/src/Breeze.Daemon
dotnet publish -c $configuration -r $TRAVIS_OS_NAME-$arch -v m -o $TRAVIS_BUILD_DIR/Breeze.UI/daemon
echo $log_prefix chmoding the Breeze.Daemon file
chmod +x $TRAVIS_BUILD_DIR/Breeze.UI/daemon/Breeze.Daemon
# node Build
cd $TRAVIS_BUILD_DIR/Breeze.UI
echo $log_prefix running 'npm run'
npm run build:prod
# node packaging
echo $log_prefix packaging breeze
if [ "$TRAVIS_OS_NAME" = "osx" ]
then
npx electron-builder build --mac --$arch
else
npx electron-builder build --linux --$arch
fi
echo $log_prefix finished packaging
#tests
echo $log_prefix no tests to run
echo $log_prefix contents of TRAVIS_BUILD_DIR
cd $TRAVIS_BUILD_DIR
ls
echo $log_prefix contents of the app-builds folder
cd $TRAVIS_BUILD_DIR/Breeze.UI/app-builds/
# replace the spaces in the name with a dot as CI system have trouble handling spaces in names.
for file in *.{dmg,tar.gz,deb}; do mv "$file" `echo $file | tr ' ' '.'` 2>/dev/null || : ; done
ls
echo $log_prefix FINISHED build