-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.gitlab-ci.yml
73 lines (68 loc) · 1.73 KB
/
.gitlab-ci.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
stages:
- format # List of stages for jobs, and their order of execution
- build
- deploy
variables:
FLUTTER_VERSION: "3.27.1"
format:
image: ghcr.io/cirruslabs/flutter:$FLUTTER_VERSION
stage: format
before_script:
- flutter doctor -v
script:
- echo "Verify the code dart code is formated"
- dart format --set-exit-if-changed lib
tags:
- saas-linux-small-amd64
# source: https://medium.com/kinandcartacreated/setup-a-flutter-ci-cd-with-gitlab-ci-part-3-8e67c91c6da7
build-ios:
# This job runs in the build stage, which runs first.
stage: build
before_script:
- fvm use $FLUTTER_VERSION -f
- fvm flutter doctor -v
- fvm flutter pub get
- fvm flutter clean
script:
- echo "Compiling the code for iOS..."
- fvm flutter build ipa
after_script:
- mv build/ios/ipa/AELF.ipa aelf-$CI_COMMIT_SHORT_SHA.ipa
artifacts:
name: aelf-$CI_COMMIT_SHORT_SHA.ipa
paths:
- aelf-$CI_COMMIT_SHORT_SHA.ipa
tags:
- aelf
- macos
build-android:
image: ghcr.io/cirruslabs/flutter:$FLUTTER_VERSION
stage: build
before_script:
- flutter doctor -v
- flutter pub get
- flutter clean
script:
- echo "Compiling the code for Android..."
- flutter build apk
after_script:
- mv build/app/outputs/apk/release/app-release.apk aelf-flutter-"$CI_COMMIT_SHORT_SHA".apk
artifacts:
name: aelf-flutter-$CI_COMMIT_SHORT_SHA
paths:
- aelf-flutter-$CI_COMMIT_SHORT_SHA.apk
tags:
- saas-linux-small-amd64
deploy-ios:
stage: deploy
# dependencies:
# - build-ios
needs: [ "build-ios" ]
script:
- echo "Uploading to testflight..."
- xcrun altool --upload-app --type ios -f *.ipa --username $ci_username_apple --password $ci_pwd_apple
tags:
- macos
- aelf
rules:
- if: $CI_COMMIT_TAG != null