forked from xds-playgrounds/xds-core-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
135 lines (109 loc) · 4.7 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
# 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 2019
clone_folder: c:\projects\implxcorewallet
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%\StratisCore.UI\node_modules'
- '%USERPROFILE%\.nuget\packages'
init:
- ps: |
$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 14.15.1" -foregroundcolor "magenta"
Install-Product node 14.15.1
Write-Host "--> npm config" -foregroundcolor "magenta"
npm config set unsafe-perm=true
Write-Host "--> npm install" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/StratisCore.UI
npm install
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 "*--------------------------------* with $LastExitCode" -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/blockcore-nodes/IMPLX/src/Impleum.Node
dotnet publish -c $env:configuration -v m -r $env:win_runtime -o $env:APPVEYOR_BUILD_FOLDER\StratisCore.UI\daemon
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "$env:log_prefix Building and packaging the ImpleumCoreBE.UI" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/StratisCore.UI
npm run package:windows --$env:arch
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "[$env:configuration][$env:win_runtime] Finished ImpleumCoreBE.UI 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 " ","." -replace "win",$env:win_runtime }
dir
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "Build finished successfully"
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: StratisCore.UI\app-builds\*.exe
name: StratisCore.UI app
#----------------------------------#
# deployment configuration #
#----------------------------------#
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: /ItAP9sbic1GRG2tIaFz+hf8XZmyiccCa6lNb8N9CztTCwCswdaMii9WdZXl6WmV
draft: false
prerelease: true
force_update: true
on:
branch: master # release from master branch only