forked from socnetv/app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
226 lines (178 loc) · 7.6 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Build SocNetV on x86 and x86_64 architectures using Qt/MinGW/VS2019 platforms
# https://socnetv.org
# Last Update: July 28, 2021
# Copyright (c) 2021 by Dimitris Kalamaras
#
#
# This script builds SocNetV Windows installers ONLY on tags i.e. 3.0 or 3.0-beta* created by the developer
# as well when the 'continuous' tag is recreated.
# The latter happens each time the uploadtool in travis uploads continuous builds (on a commit containing [ci] or [travis]).
#
#
# NOTE:
# To avoid possible cycles with creating new tags on regular commits or overwriting tags, we
# specify tag: $(APPVEYOR_REPO_TAG_NAME) in deployment settings (without having to set skip_tags = true)
# and use the on: key to conditionally build and deploy only on tags we create manually.
# This way, the manually created tag will be updated instead of a new one being created.
# See: https://www.appveyor.com/docs/deployment/github/#promoting-selected-tag-to-github-release
version: 'continuous.{build}'
#---------------------------------#
# conditional building config #
#---------------------------------#
# whitelist branches
# also whitelist tags, as per https://www.appveyor.com/docs/branches/#white--and-blacklisting
branches:
only:
- master
- develop
- /v\d \.\d /
- /v\d \.\d \.\d /
- /v\d \.\d \-\w /
# Do not build on tags (GitHub and BitBucket)
# skip_tags: true
# Start builds on tags only (GitHub and BitBucket)
# skip_non_tags: true
## Skipping commits affecting specific files (GitHub only).
#skip_commits:
# files:
# - socnetv.spec
# - debian/**/*
# - socnetv.appdata.xml
# - changelog.gz
# - README.md
# - TODO
# - AUTHORS
# - COPYING
# - NEWS
## - .travis*.yml
# Including commits with particular message or from specific user
# At the moment, only commits from developer are allowed for building.
only_commits:
message: /\[appveyor\]|\[ci\]|\[release\]/ # Start a new build if message contains '[appveyor]' or '[ci]'
author: [email protected] # Start a new build for commit of user with my email
#---------------------------------#
# environment configuration #
#---------------------------------#
# Build worker image (VM template)
image: Visual Studio 2019
# clone directory
clone_folder: c:\projects\socnetv
matrix:
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
# Scripts that run after cloning repository
install:
- ps: Write-Host $env:APPVEYOR_REPO_BRANCH
- ps: Write-Host $env:APPVEYOR_REPO_COMMIT
- ps: Write-Host $env:APPVEYOR_REPO_TAG
- ps: Write-Host $env:APPVEYOR_REPO_TAG_NAME
- cmd: echo "Setting last commit short id"
- cmd: git rev-parse --short HEAD > MYVER.txt
- cmd: set /p LAST_COMMIT_SHORT= < MYVER.txt
- cmd: echo %LAST_COMMIT_SHORT%
- cmd: del MYVER.txt
- cmd: echo %APPVEYOR_REPO_COMMIT:~0,7%
- cmd: echo "Setting SocNetV current version..."
# NOTE: This is changed by our update version bash script
- cmd: set SOCNETV_VERSION=3.1
- cmd: echo %SOCNETV_VERSION%
- cmd: echo "Setting build type"
- cmd: set BUILD_TYPE=release
- cmd: echo %BUILD_TYPE%
- cmd: echo "Checking if this is a prerelease deployment..."
- cmd: set SOCNETV_PRERELEASE=false
- cmd: if "%APPVEYOR_REPO_TAG%"=="true" if "%APPVEYOR_REPO_TAG_NAME%"=="continuous" set SOCNETV_PRERELEASE=true
- ps: if ($env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[appveyor]")) {$env:SOCNETV_PRERELEASE = "true"}
- ps: if ($env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[travis]")) {$env:SOCNETV_PRERELEASE = "true"}
- ps: if ($env:APPVEYOR_REPO_COMMIT_MESSAGE.Contains("[ci]")) {$env:SOCNETV_PRERELEASE = "true"}
- ps: if ( $env:APPVEYOR_REPO_TAG_NAME -ne $null ) { if ($env:APPVEYOR_REPO_TAG_NAME.Contains("-beta")) { $env:SOCNETV_PRERELEASE = "true" } }
- ps: if ( $env:APPVEYOR_REPO_TAG_NAME -ne $null ) { if ($env:APPVEYOR_REPO_TAG_NAME.Contains("-rc")) { $env:SOCNETV_PRERELEASE = "true" } }
- ps: Write-Host $env:SOCNETV_PRERELEASE
- cmd: if "%SOCNETV_PRERELEASE%"=="true" echo "This is a prerelease"
- cmd: echo "Setting BUILDNAME"
- set BUILDNAME=%SOCNETV_VERSION%-%LAST_COMMIT_SHORT%
- cmd: echo %BUILDNAME%
- cmd: echo "Setting Qt environment..."
- cmd: echo "Check Qt folders (debug)..."
- cmd: dir C:\Qt
- cmd: dir C:\Qt\6.2.4
- cmd: dir C:\Qt\Tools
- set QTDIR=C:\Qt\6.2.4\mingw_64
- cmd: echo "Check project folder..."
- cmd: dir C:\projects\socnetv
- cmd: echo "Installing Innosetup..."
- choco install -y InnoSetup
- cmd: echo "Setting paths..."
- set PATH=%QTDIR%\bin;C:\Qt\Tools\mingw1120_64\bin;%PATH%;"C:\Program Files (x86)\Inno Setup 6"
#---------------------------------#
# app building starts here #
#---------------------------------#
build_script:
- cmd: echo "Running qmake..."
- qmake "CONFIG =%BUILD_TYPE%" socnetv.pro
- cmd: echo "BUILDING %BUILD_TYPE% starts here with mingw_64..."
- mingw32-make
after_build:
- cmd: echo "check folder contents"
- cmd: dir C:\projects\socnetv
- cmd: dir C:\projects\socnetv\%BUILD_TYPE%
- cmd: echo "Executing windeployqt"
- windeployqt %BUILD_TYPE%/socnetv.exe
- cmd: echo "check folder contents again..."
- cmd: dir C:\projects\socnetv\%BUILD_TYPE%
- cmd: echo "Deleting *.o and *.cpp..."
- cmd: del C:\projects\socnetv\%BUILD_TYPE%\*.cpp
- cmd: del C:\projects\socnetv\%BUILD_TYPE%\*.o
- cmd: echo "check folder contents again..."
- cmd: dir C:\projects\socnetv\%BUILD_TYPE%
- cmd: echo "copy COPYING to LICENCE.txt..."
- cmd: cp COPYING %BUILD_TYPE%/LICENSE.txt
- cmd: echo "Running Innosetup..."
- cmd: echo "Available Innosetup languages:"
- cmd: dir "C:\Program Files (x86)\Inno Setup 6\Languages"
- iscc innosetup.iss
- cmd: type Setup-Manifest.txt
- cmd: dir SocNetV*.exe
- cmd: echo "Renaming file"
- cmd: rename SocNetV-*installer.exe SocNetV-%BUILDNAME%-windows-installer.exe
- cmd: dir SocNetV*.exe
- cmd: dir
artifacts:
- path: SocNetV-*-installer.exe
#---------------------------------#
# Deploy to GitHub Releases #
#---------------------------------#
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
description: 'SocNetV continuous integration prereleases from commit ${APPVEYOR_REPO_COMMIT}'
artifact: /SocNetV.*installer\.exe/
auth_token:
secure: rWpgp9XYDS/Tqr6dsQ2CK1x/vgE4nMyQ3W7oyQlG2L3oF4tecU8CEDW1EY5Us0mZ # encrypted token from GitHub
draft: false
prerelease: true
force_update: true
on:
branch: $(APPVEYOR_REPO_BRANCH) # deploy on same branch
APPVEYOR_REPO_TAG: true # deploy on tag push only -- omitted for annotated tags, see https://www.appveyor.com/docs/branches/#build-on-tags-github-bitbucket-gitlab-gitea
SOCNETV_PRERELEASE: true # deploy only if continuous
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
description: 'SocNetV release for $(APPVEYOR_REPO_TAG_NAME)'
artifact: /SocNetV.*installer\.exe/
auth_token:
secure: rWpgp9XYDS/Tqr6dsQ2CK1x/vgE4nMyQ3W7oyQlG2L3oF4tecU8CEDW1EY5Us0mZ # encrypted token from GitHub
draft: false
prerelease: false
force_update: true
on:
branch: $(APPVEYOR_REPO_BRANCH) # deploy on same branch
APPVEYOR_REPO_TAG: true # deploy on tag push only -- omitted for annotated tags, see https://www.appveyor.com/docs/branches/#build-on-tags-github-bitbucket-gitlab-gitea
SOCNETV_PRERELEASE: false # deploy only if not continuous
# Notify developer on any change
notifications:
# Email
- provider: Email
to:
subject: '[socnetv/app] build {{status}}' # optional
on_build_status_changed: true