forked from stratisproject/Breeze
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathappveyor.yml
111 lines (90 loc) · 3.77 KB
/
appveyor.yml
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# from https://www.appveyor.com/docs/appveyor-yml/
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
version: 0.1.0.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
# branches to build
branches:
# whitelist
only:
- master
#---------------------------------#
# environment configuration #
#---------------------------------#
image: Visual Studio 2017
clone_folder: c:\projects\breeze
configuration:
# - Debug
- Release
build:
parallel: true
environment:
matrix:
- win_runtime: win7-x64
arch: x64
plat: win32
- win_runtime: win7-x86
arch: ia32
plat: win32
- win_runtime: win10-x64
arch: x64
plat: win32
- win_runtime: win10-x86
arch: ia32
plat: win32
init:
- ps: |
$env:log_prefix = "[$env:win_runtime][$env:configuration]"
$env:app_output_name = "breeze-$env:win_runtime-$env:configuration"
$env:api_output_name = "api-$env:win_runtime-$env:configuration"
#---------------------------------#
# build configuration #
#---------------------------------#
before_build:
- ps: |
Write-Host "$env:log_prefix STARTED restoring dotnet and npm packages" -foregroundcolor "magenta"
cd Breeze
# Initialize dependencies
git submodule update --init --recursive
dotnet restore -v m
cd ../Breeze.UI
Install-Product node 6
npm install
Write-Host "$env:log_prefix FINISHED restoring dotnet and npm packages" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
build_script:
- ps: |
Write-Host "$env:log_prefix running 'dotnet build'" -foregroundcolor "magenta"
cd ../Breeze/src/Breeze.Daemon
dotnet build -c $env:configuration -r $env:win_runtime -v m
Write-Host "$env:log_prefix running 'dotnet publish'" -foregroundcolor "magenta"
dotnet publish -c $env:configuration -v m -r $env:win_runtime -o $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:win_runtime
Write-Host "$env:log_prefix zipping results of 'dotnet publish'" -foregroundcolor "magenta"
7z a $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:api_output_name.zip $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:win_runtime\*
cd ../../../Breeze.UI
Write-Host "$env:log_prefix running 'npm run'" -foregroundcolor "magenta"
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
Write-Host "$env:log_prefix copying the Breeze api into the app" -foregroundcolor "magenta"
New-Item -Path $env:APPVEYOR_BUILD_FOLDER\breeze_out\breeze-ui-$env:plat-$env:arch\resources\app\assets\daemon -ItemType directory
xcopy /s $env:APPVEYOR_BUILD_FOLDER\dotnet_out\$env:win_runtime\* $env:APPVEYOR_BUILD_FOLDER\breeze_out\breeze-ui-$env:plat-$env:arch\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_name.zip $env:APPVEYOR_BUILD_FOLDER\breeze_out\breeze-ui-$env:plat-$env:arch
Write-Host "[$env:configuration][$env:win_runtime] FINISHED dotnet build" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
test_script:
- ps: |
Write-Host "$env:log_prefix no tests to run" -foregroundcolor "magenta"
#if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# artifacts configuration #
#---------------------------------#
# pushing all files in build directory recursively
artifacts:
- path: breeze_out\*.zip
name: Breeze app
- path: dotnet_out\*.zip
name: dotnet libraries