forked from flet-dev/flet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
456 lines (379 loc) · 13.5 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
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
version: 0.0.{build}
skip_branch_with_pr: true
skip_commits:
files:
- docs/**/*
- media/**/*
- "*.md"
environment:
GO_VERSION: 1.19
GO_TAGS: --tags release
python_stack: python 3.10
FLUTTER_MACOS_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.10.5-stable.zip
GITHUB_TOKEN:
secure: doX0dwjWhBmT56aJqR9NCbtMFJpDpdYxPCIB4vQoHfSR+nTa+pLCo6Yv5qWpD/90
DOCKER_REGISTRY_USER:
secure: NJVK0u9M6ZhmQKUeR6Gnxg==
DOCKER_REGISTRY_PASS:
secure: V9nRzVDlIGS0a+dhkC2/vw==
matrix:
- job_name: Build Flet package for Flutter
job_group: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004
- job_name: Build Flet for Windows
job_group: build_flet
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
- job_name: Build Flet for macOS
job_group: build_flet
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
- job_name: Build Flet for Linux
job_group: build_flet
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004
- job_name: Build Flet for Linux ARM64
job_group: build_flet
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: ubuntu2004-arm
python_stack: ""
# - job_name: Build Flet for iOS
# job_group: build_flet
# job_depends_on: build_flet_package
# APPVEYOR_BUILD_WORKER_IMAGE: macos-monterey
- job_name: Build Fletd
job_group: build_flet
job_depends_on: build_flet_package
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.8
job_group: python_tests
python_stack: python 3.8
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.9
job_group: python_tests
python_stack: python 3.9
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.10
job_group: python_tests
python_stack: python 3.10
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.11
job_group: python_tests
python_stack: python 3.11
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Build Python wheels
job_group: python_build
job_depends_on: python_tests, build_flet
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
TWINE_USERNAME: __token__
TWINE_PASSWORD:
secure: 174ncAbF5IjSIkmioPt62jeSnzmTlRNchUkE4QdjDWH8xK1olYtySXLJpo2q95HcP7lWJky1hv4APESiRRHnBWoY0XRFafzM/mbCDMzG1tZXiXZmpP1qzHAtRP2QSCIg18xh1TMktraUdTi7sbJnjjRhqzgbW1k0kLBxKw79MPFBhYQ/TiGcmaYWZbWVZNY3HCUCb6Dt7bG1OE2Ul9rD1gvs55xwO9Oq9FOVA1VnMYw=
TWINE_NON_INTERACTIVE: true
matrix:
fast_finish: true
allow_failures:
- job_name: Build Flet for iOS
- job_name: Build Flet Studio for iOS
stack: $python_stack
for:
# ======================================
# Build Flet package for Flutter
# ======================================
- matrix:
only:
- job_name: Build Flet package for Flutter
install:
- ps: |
if ($env:APPVEYOR_REPO_TAG_NAME) {
$v = $env:APPVEYOR_REPO_TAG_NAME.replace("v", "")
} else {
$cv = [version](git describe --abbrev=0).substring(1)
$v = "$($cv.major).$($cv.minor+1).0+$($env:APPVEYOR_BUILD_NUMBER)"
}
Update-AppveyorBuild -Version $v
- flutter upgrade --force
build_script:
- cd package
- flutter test
deploy_script:
# publish package
- sh: |
if [[ "$APPVEYOR_REPO_TAG_NAME" != "" ]]; then
mkdir -p $HOME/.config/dart
echo $PUB_DEV_TOKEN | base64 --decode > $HOME/.config/dart/pub-credentials.json
dart pub publish --force
fi
# ======================================
# Build Flet View for Windows
# ======================================
- matrix:
only:
- job_name: Build Flet for Windows
install:
- flutter upgrade --force
build_script:
- cd client
- flutter build windows --build-name=%APPVEYOR_BUILD_VERSION%
- set RELEASE_DIR=build\windows\x64\runner\Release
- copy "%WINDIR%\system32\msvcp140.dll" %RELEASE_DIR%
- copy "%WINDIR%\system32\vcruntime140.dll" %RELEASE_DIR%
- copy "%WINDIR%\system32\vcruntime140_1.dll" %RELEASE_DIR%
- dir %RELEASE_DIR%
- ren build\windows\x64\runner\Release flet
- cd build\windows\x64\runner
- 7z a flet-windows.zip flet
- cd %APPVEYOR_BUILD_FOLDER%
test: off
artifacts:
- path: client\build\windows\x64\runner\flet-windows.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:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install cocoapods
- curl $FLUTTER_MACOS_URL -o "$HOME/flutter_macos_stable.zip"
- unzip -qq "$HOME/flutter_macos_stable.zip" -d $HOME
- export PATH="$PATH:$HOME/flutter/bin"
- flutter channel stable
- flutter upgrade
- flutter config --enable-macos-desktop
- flutter doctor
build_script:
# Flutter macOS client
- cd client
- flutter build macos --build-name=$APPVEYOR_BUILD_VERSION
- tar -czvf flet-macos-amd64.tar.gz -C build/macos/Build/Products/Release Flet.app
artifacts:
- path: client/flet-macos-amd64.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:
- sudo apt update --allow-releaseinfo-change
- sudo apt install -y libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
- flutter upgrade --force
build_script:
- cd client
- flutter build linux --build-name=$APPVEYOR_BUILD_VERSION
- mv build/linux/x64/release/bundle build/linux/x64/release/flet
- tar -czvf flet-linux-amd64.tar.gz -C build/linux/x64/release flet
artifacts:
- path: client/flet-linux-amd64.tar.gz
name: flet_linux_amd64
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_linux_amd64
on:
APPVEYOR_REPO_TAG: true
# ======================================
# Build Flet View for Linux ARM64
# ======================================
- matrix:
only:
- job_name: Build Flet for Linux ARM64
install:
# Flutter SDK
- sudo apt update --allow-releaseinfo-change
- sudo apt install -y clang libgtk-3-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
- git clone https://github.com/flutter/flutter.git -b stable "$HOME/flutter"
- export PATH="$PATH:$HOME/flutter/bin"
- flutter upgrade
- flutter doctor
# Fix Flutter on ARM
- pushd /tmp
- curl -O https://appveyordownloads.blob.core.windows.net/misc/shader_lib.tar.gz
- tar -zxf shader_lib.tar.gz
- cp -R shader_lib $HOME/flutter/bin/cache/artifacts/engine/linux-arm64
- popd
build_script:
- cd client
- flutter build linux --build-name=$APPVEYOR_BUILD_VERSION
- mv build/linux/arm64/release/bundle build/linux/arm64/release/flet
- tar -czvf flet-linux-arm64.tar.gz -C build/linux/arm64/release flet
artifacts:
- path: client/flet-linux-arm64.tar.gz
name: flet_linux_arm64
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_linux_arm64
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 $FLUTTER_MACOS_URL -o "$HOME/flutter_macos_stable.zip"
- unzip -qq "$HOME/flutter_macos_stable.zip" -d $HOME
- export PATH="$PATH:$HOME/flutter/bin"
- flutter channel stable
- flutter upgrade
- flutter doctor
build_script:
# Flutter iOS client
- cd client
- cd ios
- rvm use 3.0
- ruby --version
- bundle install
- 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
bundle exec fastlane upload_appstore
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 upgrade --force
# 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 build web --release
- rm -rf build/web/canvaskit
- ls -alR build/web
- cd ..
- tar -czvf client/build/flet-web.tar.gz -C client/build/web .
# Flet Server in Go
- cd server
- sh: |
if [[ "$APPVEYOR_REPO_TAG" == "true" ]]; then
goreleaser
else
goreleaser --snapshot --skip-publish
fi
- cd ..
artifacts:
- path: server/dist/fletd-*
- path: server/dist/fletd_*/*
- path: client/build/flet-web.tar.gz
name: flet_web
deploy:
provider: GitHub
auth_token: $(GITHUB_TOKEN)
release: $(APPVEYOR_REPO_TAG_NAME)
artifact: flet_web
on:
APPVEYOR_REPO_TAG: true
######################
# Python Tests #
######################
- matrix:
only:
- job_group: python_tests
install:
- python --version
- cd sdk/python
- pip install --upgrade pip virtualenv
- pip install poetry
- poetry install
build: off
test_script:
- poetry run pytest
######################
# Python Build #
######################
- matrix:
only:
- job_group: python_build
install:
- python --version
- cd sdk/python
- pip install --upgrade setuptools wheel twine poetry tomlkit virtualenv
- poetry install
test: off
build_script:
# patch version
- ps: |
$ErrorActionPreference = "Stop"
$env:PYPI_VER = $env:APPVEYOR_BUILD_VERSION.replace("+", ".dev")
$vp = "packages/flet-core/src/flet_core/version.py"; (Get-Content $vp).replace("version = `"`"", "version = `"$env:PYPI_VER`"") | Set-Content $vp
- python3 patch_toml.py packages/flet/pyproject.toml $PYPI_VER
- python3 patch_toml.py packages/flet-embed/pyproject.toml $PYPI_VER
- python3 patch_toml.py packages/flet-runtime/pyproject.toml $PYPI_VER
- python3 patch_toml.py packages/flet-core/pyproject.toml $PYPI_VER
- python3 patch_toml.py packages/flet-pyodide/pyproject.toml $PYPI_VER
- python3 patch_toml.py packages/flet-fastapi/pyproject.toml $PYPI_VER
# build "flet-core" package
- pushd packages/flet-core
- poetry build
- popd
# build "flet-runtime" package
- pushd packages/flet-runtime
- poetry build
- popd
# build "flet-embed" package
- pushd packages/flet-embed
- poetry build
- popd
# build "flet" package
- pushd packages/flet
- python3 download-web.py
- poetry build
- python3 build-wheels.py
- popd
# build "flet-pyodide" package
- pushd packages/flet-pyodide
- poetry build
- popd
# build "flet-fastapi" package
- pushd packages/flet-fastapi
- poetry build
- popd
# publish package
- sh: |
if [[ ("$APPVEYOR_REPO_BRANCH" == "main" || "$APPVEYOR_REPO_TAG_NAME" != "") && "$APPVEYOR_PULL_REQUEST_NUMBER" == "" ]]; then
twine upload packages/flet-core/dist/* packages/flet-runtime/dist/* packages/flet-embed/dist/* packages/flet/dist/* packages/flet-pyodide/dist/* packages/flet-fastapi/dist/*
fi
artifacts:
- path: sdk/python/packages/flet-core/dist/*
- path: sdk/python/packages/flet-runtime/dist/*
- path: sdk/python/packages/flet/dist/*
- path: sdk/python/packages/flet-embed/dist/*
- path: sdk/python/packages/flet-pyodide/dist/*
- path: sdk/python/packages/flet-fastapi/dist/*