forked from maocypher/dogsportsdiary
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodemagic.yaml
More file actions
220 lines (209 loc) · 7.21 KB
/
Copy pathcodemagic.yaml
File metadata and controls
220 lines (209 loc) · 7.21 KB
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
workflows:
ios-workflow:
name: DogSportsDiary iOS Workflow
max_build_duration: 60
instance_type: mac_mini_m1
# triggering:
# events: # List the events that trigger builds
# - tag
# branch_patterns: # Include or exclude watched branches
# - pattern: 'master'
# include: true
# source: true
environment:
ios_signing:
provisioning_profiles:
- io.github.maocypher.dogsportsdiary-mobileprovision
certificates:
- io.github.maocypher.dogsportsdiary-p12-ios
vars:
PACKAGE_NAME: "io.github.maocypher.dogsportsdiary"
APP_ID: HSP6K6D926.io.github.maocypher.dogsportsdiary
flutter: 3.27.2
integrations:
app_store_connect: codemagic-integration-apple-developer-portal
scripts:
- name: Get Flutter packages
script: |
flutter packages pub get
- name: Install pods
script: |
find . -name "Podfile" -execdir pod install \;
- name: Flutter analyze
script: |
flutter analyze --no-fatal-infos --no-fatal-warnings
- name: Flutter unit tests
script: |
flutter test
ignore_failure: true
- name: Check code signing
script: |
ls -la /Users/builder/Library/MobileDevice/Provisioning\ Profiles/
security find-identity -v -p codesigning
flutter doctor -v
- name: Setup project in Xcode with signing
script: |
xcode-project use-profiles --project ios/Runner.xcodeproj
- name: Flutter build simulator debug version
script: |
VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
BUILD_NUMBER=$(echo $VERSION | cut -d+ -f2)
flutter build ios --debug --no-codesign \
--simulator \
--build-name=$BUILD_NAME \
--build-number=$BUILD_NUMBER
- name: Rename the simulator file
script: |
mv build/ios/iphonesimulator/Runner.app \
build/ios/iphonesimulator/Runner-debug-simulator.app
- name: Flutter build real device debug version
script: |
VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
BUILD_NUMBER=$(echo $VERSION | cut -d+ -f2)
flutter build ios --debug --no-codesign \
--build-name=$BUILD_NAME \
--build-number=$BUILD_NUMBER
- name: Rename the device file
script: |
mv build/ios/iphoneos/Runner.app \
build/ios/iphoneos/Runner-debug.app
- name: Flutter build real device release version
script: |
VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
BUILD_NUMBER=$(echo $VERSION | cut -d+ -f2)
flutter build ios --release --no-codesign \
--build-name=$BUILD_NAME \
--build-number=$BUILD_NUMBER
- name: Rename the release file
script: |
mv build/ios/iphoneos/Runner.app \
build/ios/iphoneos/Runner-release.app
- name: Build IPA for App Store
script: |
VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
BUILD_NUMBER=$(echo $VERSION | cut -d+ -f2)
flutter build ipa \
--release \
--build-name=$BUILD_NAME \
--build-number=$BUILD_NUMBER \
--export-options-plist=/Users/builder/export_options.plist
artifacts:
- build/ios/ipa/*.ipa
- build/ios/*/*.app
- /tmp/xcodebuild_logs/*.log
- flutter_drive.log
publishing:
email:
recipients:
- maocypher@gmail.com
notify:
success: true
failure: true
app_store_connect:
auth: integration
# submit_to_testflight: true
# submit_to_app_store: false
# beta_groups:
# - "beta"
# android-release-workflow:
# name: DogSportsDiary Android Workflow
# max_build_duration: 60
# instance_type: mac_mini_m1
#
## triggering:
## events: # List the events that trigger builds
## - tag
## branch_patterns: # Include or exclude watched branches
## - pattern: 'master'
## include: true
## source: true
#
# environment:
# android_signing:
# - dogsportsdiary_signature
# #- keystore_reference
# groups:
# - google_credentials
# - github_credentials
# vars:
# PACKAGE_NAME: "io.github.maocypher.dogsportsdiary"
# GOOGLE_PLAY_TRACK: alpha
# flutter: stable
#
# scripts:
# - name: Set up local.properties
# script: |
# echo "flutter.sdk=$HOME/programs/flutter" > "$CM_BUILD_DIR/android/local.properties"
# - name: Get Flutter packages
# script: |
# flutter packages pub get
# - name: Flutter analyze
# script: |
# flutter analyze --no-fatal-infos --no-fatal-warnings
# - name: Flutter unit tests
# script: |
# flutter test
# ignore_failure: false
# #- name: Build AAB with Flutter
# # script: |
# # flutter build appbundle --release \
# # --build-name=1.0.$PROJECT_BUILD_NUMBER \
# # --build-number=$PROJECT_BUILD_NUMBER
## - name: Build AAB with Flutter
## script: |
## BUILD_NUMBER=$(($(google-play get-latest-build-number --package-name "$PACKAGE_NAME") + 1))
## flutter build appbundle --release \
## --build-name=1.0.$BUILD_NUMBER \
## --build-number=$BUILD_NUMBER
# - name: Zip source code
# script: |
# VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
# BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
# zip -r ${BUILD_NAME}.zip .
# tar -czvf ${BUILD_NAME}.tar.gz .
# - name: Build APK with Flutter
# script: |
# VERSION=$(grep 'version:' pubspec.yaml | awk '{print $2}')
# BUILD_NAME=$(echo $VERSION | cut -d+ -f1)
# BUILD_NUMBER=$(echo $VERSION | cut -d+ -f2)
# flutter build apk --release \
# --build-name=$BUILD_NAME \
# --build-number=$BUILD_NUMBER
# - name: Publish to GitHub
# script: |
# #!/usr/bin/env zsh
#
# # Publish only for tag builds
# if [ -z ${CM_TAG} ]; then
# echo "Not a tag build, will not publish GitHub release"
# exit 0
# fi
#
# gh release create "${CM_TAG}" \
# --title "v${CM_TAG}" \
# --notes-file changelog.md \
# build/**/outputs/**/*.aab \
# build/**/outputs/**/*.apk \
# ${CM_TAG}.zip \
# ${CM_TAG}.tar.gz
#
# artifacts:
# - build/**/outputs/**/*.apk
# - build/**/outputs/**/*.aab
# - build/**/outputs/**/mapping.txt
# - flutter_drive.log
# publishing:
# email:
# recipients:
# - maocypher@gmail.com
# notify:
# success: true
# failure: true
#google_play:
# credentials: $GCLOUD_SERVICE_ACCOUNT_CREDENTIALS
# track: $GOOGLE_PLAY_TRACK
# submit_as_draft: true