forked from flet-dev/flet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
454 lines (379 loc) · 14.3 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
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_WINDOWS_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.3.3-stable.zip
FLUTTER_MACOS_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.3.3-stable.zip
FLUTTER_LINUX_URL: https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.3.3-stable.tar.xz
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.7
job_group: python_tests
job_depends_on: build_flet
python_stack: python 3.7
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.8
job_group: python_tests
job_depends_on: build_flet
python_stack: python 3.8
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.9
job_group: python_tests
job_depends_on: build_flet
python_stack: python 3.9
APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
- job_name: Test Python 3.10
job_group: python_tests
job_depends_on: build_flet
python_stack: python 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_stack
for:
# ======================================
# Build Flet package for Flutter
# ======================================
- matrix:
only:
- job_name: Build Flet package for Flutter
install:
# Flutter SDK
- curl $FLUTTER_LINUX_URL -o "$HOME/flutter_linux_stable.tar.xz"
- tar -xf "$HOME/flutter_linux_stable.tar.xz" -C $HOME
- export PATH="$PATH:$HOME/flutter/bin"
- flutter channel stable
- flutter upgrade
- flutter doctor
build_script:
- cd package
- flutter test
- echo "TODO"
# ======================================
# Build Flet View for Windows
# ======================================
- matrix:
only:
- job_name: Build Flet for Windows
environment:
VC_REDIST_DIR: 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Redist\MSVC\14.29.30133\x64\Microsoft.VC142.CRT'
install:
- ps: |
Write-Host "Downloading Flutter SDK..."
(New-Object Net.WebClient).DownloadFile($env:FLUTTER_WINDOWS_URL, "$env:TEMP\flutter_windows_stable.zip")
Write-Host "Unpacking Flutter SDK..."
7z x "$env:TEMP\flutter_windows_stable.zip" -o"$env:SystemDrive\" | Out-Null
- set PATH=C:\flutter\bin;%PATH%
- flutter channel stable
- flutter upgrade
build_script:
- cd client
- ps: if ($env:APPVEYOR_REPO_TAG_NAME -match "[0-9\.]+") { $env:FLET_VER=$Matches.0 } else { $env:FLET_VER=$env:APPVEYOR_BUILD_VERSION }
- flutter build windows --build-name=%FLET_VER%
- 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-windows.zip flet
- cd %APPVEYOR_BUILD_FOLDER%
test: off
artifacts:
- path: client\build\windows\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
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build macos --build-name=$FLET_VER
- 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:
# Flutter SDK
- sudo apt update
- 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
- curl $FLUTTER_LINUX_URL -o "$HOME/flutter_linux_stable.tar.xz"
- tar -xf "$HOME/flutter_linux_stable.tar.xz" -C $HOME
- export PATH="$PATH:$HOME/flutter/bin"
- flutter channel stable
- flutter upgrade
- flutter doctor
build_script:
- cd client
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build linux --build-name=$FLET_VER
- 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
- 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 master "$HOME/flutter"
- export PATH="$PATH:$HOME/flutter/bin"
- flutter --version
- flutter channel stable
- flutter upgrade
- flutter doctor
build_script:
- cd client
- if [[ "$APPVEYOR_REPO_TAG_NAME" =~ ([0-9\.]+) ]]; then export FLET_VER="${BASH_REMATCH[1]}"; else export FLET_VER="$APPVEYOR_BUILD_VERSION"; fi
- flutter build linux --build-name=$FLET_VER
- 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
- 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}"
export ITMSTRANSPORTER_FORCE_ITMS_PACKAGE_UPLOAD=true
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
- curl $FLUTTER_LINUX_URL -o "$HOME/flutter_linux_stable.tar.xz"
- tar -xf "$HOME/flutter_linux_stable.tar.xz" -C $HOME
- export PATH="$PATH:$HOME/flutter/bin"
- flutter channel stable
- flutter upgrade
- flutter doctor
# 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 ..
# 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 ..
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
(Get-Content flet/version.py).replace("version = `"`"", "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/*