forked from x42protocol/X42-FullNode-UI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
140 lines (113 loc) · 4.82 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
# 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\fullnodeui
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%\FullNode.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 6" -foregroundcolor "magenta"
Install-Product node 6
Write-Host "--> npm config" -foregroundcolor "magenta"
npm config set unsafe-perm=true
Write-Host "--> npm install" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/FullNode.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/X42-FullNode/src/x42.x42D
dotnet publish -c $env:configuration -v m -r $env:win_runtime -o $env:APPVEYOR_BUILD_FOLDER\FullNode.UI\daemon
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "$env:log_prefix building FullNode.UI" -foregroundcolor "magenta"
cd $env:APPVEYOR_BUILD_FOLDER/FullNode.UI
npm run build:prod
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "$env:log_prefix packaging the FullNode.UI" -foregroundcolor "magenta"
npx electron-builder build --windows --$env:arch
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
Write-Host "[$env:configuration][$env:win_runtime] Finished FullNode.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 " ","." }
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: FullNode.UI\app-builds\*.exe
name: FullNode.UI app
#----------------------------------#
# deployment configuration #
#----------------------------------#
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: HDi4qCaTuAtnvLY6H3WnLJrKJEtCOCe/ThP4UB/jNQCfTfdlBEoZbhAsMfu9/cMc
draft: false
prerelease: true
force_update: true
on:
branch: master # release from master branch only