-
Notifications
You must be signed in to change notification settings - Fork 493
/
Copy path.appveyor.yml
375 lines (310 loc) · 10.2 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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
version: 0.0.{build}
skip_branch_with_pr: true
skip_commits:
files:
- docs/**/*
- media/**/*
- "*.md"
environment:
GO_VERSION: 1.18.3
GO_TAGS: --tags release
python_version: 3.10
GITHUB_TOKEN:
secure: doX0dwjWhBmT56aJqR9NCbtMFJpDpdYxPCIB4vQoHfSR+nTa+pLCo6Yv5qWpD/90
DOCKER_REGISTRY_USER:
secure: NJVK0u9M6ZhmQKUeR6Gnxg==
DOCKER_REGISTRY_PASS:
secure: V9nRzVDlIGS0a+dhkC2/vw==
matrix:
- job_name: Build Flet for Windows
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- job_name: Build Flet for macOS
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
- job_name: Build Flet for Linux
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004
- job_name: Build Flet for iOS
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
- job_name: Build Fletd
job_group: build_flet
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.7
job_group: python_tests
job_depends_on: build_flet
python_version: 3.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.8
job_group: python_tests
job_depends_on: build_flet
python_version: 3.8
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.9
job_group: python_tests
job_depends_on: build_flet
python_version: 3.9
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.10
job_group: python_tests
job_depends_on: build_flet
python_version: 3.10
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Build Python wheels
job_group: python_build
job_depends_on: python_tests
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: true
pypi_key:
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw=
test_pypi_key:
secure: cMCzqE9PcLcAiQ7POU0eVmLsXpy/n3WA9USIQNDKKbvUeajtURVITKpQ4MmwUXZAGv8giPPDUppiIf22AwIfx3O43tBVCp/HjvKNCbgY8sTaQBx60mLRbVBfD1F/+VfeuSTm57qtuSxUkZWF1JlWp8UQqIwCMHHDd0/wqDfmPNKj6U617Lp3vIfhsfgaDofspCKSGfG8+Z+6gcpmI+mA1wFHQB+l/BAbsGbgih8HiH6EzcuyIphxQKEA6r2XDPWE
matrix:
fast_finish: true
stack: python $python_version
for:
# ======================================
# Build Flet View for Windows
# ======================================
- matrix:
only:
- job_name: Build Flet for Windows
environment:
VC_REDIST_DIR: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT'
install:
- ps: .\ci\install_flutter.ps1
- set PATH=C:\flutter\bin;%PATH%
- flutter --version
build_script:
- cd client
- flutter test
- flutter build windows
- set RELEASE_DIR=build\windows\runner\Release
- copy "%VC_REDIST_DIR%\msvcp140.dll" %RELEASE_DIR%
- copy "%VC_REDIST_DIR%\vcruntime140.dll" %RELEASE_DIR%
- copy "%VC_REDIST_DIR%\vcruntime140_1.dll" %RELEASE_DIR%
- dir %RELEASE_DIR%
- ren build\windows\runner\Release flet
- cd build\windows\runner
- 7z a flet.zip flet
- cd %APPVEYOR_BUILD_FOLDER%
test: off
artifacts:
- path: client\build\windows\runner\flet.zip
name: flet_windows
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_windows
on:
APPVEYOR_REPO_TAG: true
# ======================================
# Build Flet View for macOS
# ======================================
- matrix:
only:
- job_name: Build Flet for macOS
install:
- brew install cocoapods
- curl https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.0.2-stable.zip -o flutter_macos_stable.zip
- unzip -qq flutter_macos_stable.zip
- export PATH="$PATH:`pwd`/flutter/bin"
- flutter --version
- flutter config --enable-macos-desktop
- flutter doctor
build_script:
# Flutter macOS client
- cd client
- flutter test
- flutter build macos
- tar -czvf flet.app.tar.gz -C build/macos/Build/Products/Release Flet.app
artifacts:
- path: client/flet.app.tar.gz
name: flet_macos
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_macos
on:
APPVEYOR_REPO_TAG: true
# ======================================
# Build Flet View for Linux
# ======================================
- matrix:
only:
- job_name: Build Flet for Linux
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter sdk-path
- flutter --version
build_script:
- cd client
- flutter test
- flutter build linux
- mv build/linux/x64/release/bundle build/linux/x64/release/flet
- tar -czvf flet.tar.gz -C build/linux/x64/release flet
artifacts:
- path: client/flet.tar.gz
name: flet_linux
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_linux
on:
APPVEYOR_REPO_TAG: true
# ======================================
# Build Flet View for iOS
# ======================================
- matrix:
only:
- job_name: Build Flet for iOS
install:
- export LANG=en_US.UTF-8
- curl https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.0.2-stable.zip -o flutter_macos_stable.zip
- unzip -qq flutter_macos_stable.zip
- export PATH="$PATH:`pwd`/flutter/bin"
- flutter --version
- flutter doctor
build_script:
# Flutter iOS client
- cd client
- flutter test
- cd ios
- ruby --version
- bundle install --path vendor/bundle
- sh: |
export FLET_PACKAGE_VERSION="${APPVEYOR_BUILD_VERSION}"
if [[ ! -z "$APPVEYOR_PULL_REQUEST_NUMBER" ]]; then
bundle exec fastlane build_flutter
elif [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then
if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then
export FLET_PACKAGE_VERSION="${BASH_REMATCH[1]}"
echo "FLET_PACKAGE_VERSION: ${FLET_PACKAGE_VERSION}"
bundle exec fastlane upload_appstore
else
echo "Cannot extract version information from a tag."
exit 1
fi
else
bundle exec fastlane build_ipa
fi
artifacts:
- path: client/build/flet.ipa
name: flet_ios
# ======================================
# Build Fletd
# ======================================
- matrix:
only:
- job_name: Build Fletd
install:
# Flutter SDK
- sudo snap install flutter --classic
- flutter sdk-path
- flutter --version
# Go and GoReleaser
- gvm install go${GO_VERSION} -B
- gvm use go${GO_VERSION}
- go version
- bash ./ci/install_goreleaser.sh
- goreleaser --version
build_script:
# Flutter Web client
- cd client
- flutter test
- flutter build web --release
- rm -rf build/web/canvaskit
- ls -alR build/web
- cd ..
# Flet Server in Go
- mkdir server/server/content
- cp -rf client/build/web/* server/server/content
- cd server
- sh: |
if [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then
goreleaser
else
goreleaser --snapshot --skip-publish
fi
- cd ..
# test_script:
# - docker images
# - docker run --name flet-test -d flet/server
# - sleep 10
# - docker logs flet-test
# # publish to docker.io on tagged builds only
# - sh: |
# if [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then
# echo "$DOCKER_REGISTRY_PASS" | docker login --username $DOCKER_REGISTRY_USER --password-stdin
# docker image push --all-tags flet/server
# fi
artifacts:
- path: server/dist/fletd-*
- path: server/dist/fletd_*/*
######################
# Python Tests #
######################
- matrix:
only:
- job_group: python_tests
install:
- python --version
- cd sdk/python
- pip install pdm
- pdm install
build: off
test_script:
- pdm run pytest tests
######################
# Python Build #
######################
- matrix:
only:
- job_group: python_build
install:
- python --version
- cd sdk/python
- pip install --upgrade setuptools wheel twine pdm
- pdm install
test: off
build_script:
- ps: |
$ErrorActionPreference = "Stop"
if ($env:APPVEYOR_REPO_TAG -eq 'true') {
# release mode
# version
$ver = $env:APPVEYOR_REPO_TAG_NAME
if ($ver.StartsWith('v')) { $ver = $ver.Substring(1) }
# prerelease moniker
$idx = $ver.indexOf('-')
if ($idx -ne -1) {
$prerelease = $ver.Substring($idx + 1)
$ver = $ver.Substring(0, $idx)
}
$env:TWINE_PASSWORD = $env:pypi_key
} else {
# build mode
$ver = $env:APPVEYOR_BUILD_VERSION
$env:TWINE_PASSWORD = $env:test_pypi_key
$env:TWINE_REPOSITORY = 'testpypi'
}
# patch version
$env:PACKAGE_VERSION = $ver
(Get-Content pyproject.toml).replace("version = `"0.1.0`"", "version = `"$ver`"") | Set-Content pyproject.toml
("# this file was auto-generated by CI", "version = '$ver'") | Set-Content flet/version.py
# build package
- pdm build
- python3 build-wheels.py
# publish package
- sh: |
if [[ "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then
twine upload dist/*
fi
artifacts:
path: sdk/python/dist/*