-
Notifications
You must be signed in to change notification settings - Fork 47
/
appveyor.yml
145 lines (117 loc) · 5.01 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# from https://www.appveyor.com/docs/appveyor-yml/
# you can use {branch} name in version format too
# version: 1.0.{build}-{branch}
version: 0.3.0.{build}
pull_requests:
do_not_increment_build_number: true
# branches to build
branches:
# whitelist
only:
- master
#---------------------------------#
# environment configuration #
#---------------------------------#
image: Visual Studio 2017
clone_folder: c:\projects\breeze
configuration:
- Release
build:
parallel: true
environment:
matrix:
- win_runtime: win-x64
arch: x64
plat: win32
- win_runtime: win-x86
arch: ia32
plat: win32
# build cache to preserve files/folders between builds
cache:
- '%APPVEYOR_BUILD_FOLDER%\Breeze.UI\node_modules'
- '%USERPROFILE%\.nuget\packages'
init:
- ps: |
choco install dotnetcore-sdk --no-progress --confirm --version 2.1.301
dotnet --info
$env:log_prefix = "[$env:win_runtime][$env:configuration]"
if ($env:APPVEYOR_REPO_TAG -eq "false") { $env:APPVEYOR_REPO_TAG_NAME = "cd-unstable" }
install:
- ps: |
Write-Host "Installing dependencies" -foregroundcolor "magenta"
Write-Host "--> git submodule" -foregroundcolor "magenta"
git submodule update --init --recursive
Write-Host "--> node 8.11.2" -foregroundcolor "magenta"
Install-Product node 8.11.2
Write-Host "--> npm 6.2.0" -foregroundcolor "magenta"
npm install -g npm@6.2.0
Write-Host "--> npm config" -foregroundcolor "magenta"
npm config set unsafe-perm=true
Write-Host "--> npm install" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/Breeze.UI
npm install
Write-Host "--> npm install npx" -foregroundcolor "magenta"
npm install -g npx
Write-Host "$env:log_prefix FINISHED restoring dotnet and npm packages" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
#---------------------------------#
# build configuration #
#---------------------------------#
before_build:
- ps: |
Write-Host "*--------------------------------*" -foregroundcolor "magenta"
Write-Host "current environment variables:" -foregroundcolor "magenta"
Write-Host "Windows runtime: $env:win_runtime" -foregroundcolor "magenta"
Write-Host "Build directory: $env:APPVEYOR_BUILD_FOLDER" -foregroundcolor "magenta"
Write-Host "Configuration: $env:configuration" -foregroundcolor "magenta"
Write-Host "Branch: $env:APPVEYOR_REPO_BRANCH" -foregroundcolor "magenta"
Write-Host "Tag is set: $env:APPVEYOR_REPO_TAG" -foregroundcolor "magenta"
Write-Host "Tag: $env:APPVEYOR_REPO_TAG_NAME" -foregroundcolor "magenta"
Write-Host "Commit: $env:APPVEYOR_REPO_COMMIT" -foregroundcolor "magenta"
Write-Host "Commit message: $env:APPVEYOR_REPO_COMMIT_MESSAGE" -foregroundcolor "magenta"
Write-Host "*--------------------------------*" -foregroundcolor "magenta"
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
build_script:
- ps: |
Write-Host "$env:log_prefix running 'dotnet publish'" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/StratisBitcoinFullNode/src/Stratis.BreezeD
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 building Breeze" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/Breeze.UI
npm run build:prod
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
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"
dir
cd app-builds
# replace the spaces in the name with a dot as CI system have trouble handling spaces in names.
Dir *.exe | rename-item -newname { $_.name -replace " ","." }
dir
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.UI\app-builds\*.exe
name: Breeze app
#----------------------------------#
# deployment configuration #
#----------------------------------#
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: faXallYrtShJywqNK+adalNNl50Wjns7dFsCDDx5/eNBegshCLjfshUeMPgIX9Ld
draft: false
prerelease: true
force_update: true
on:
branch: master # release from master branch only