-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
250 lines (247 loc) · 11.9 KB
/
azure-pipelines.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
trigger:
- main
- develop
- feature/*
pool:
vmImage: macos-latest
demands: xcode
variables:
- group: Secrets
stages:
- stage: qa_stage
displayName: 動作検証ステージ
condition: always()
jobs:
- job: analysis_job
displayName: 静的解析
steps:
- task: DownloadSecureFile@1
displayName: 'Download configs'
name: Configs
inputs:
secureFile: configs.tar.gz
- script: |
echo '>> tar -zxvf $(Configs.secureFilePath) --strip-components=1'
tar -zxvf $(Configs.secureFilePath) --strip-components=1
displayName: 'Inflate configs'
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: FlutterInstall@0
inputs:
mode: 'auto'
channel: 'stable'
version: 'latest'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter gen-l10n'
$FLUTTERTOOLPATH/flutter gen-l10n
displayName: 'Build l10n (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub get'
$FLUTTERTOOLPATH/flutter pub get
displayName: 'Install Build Tools (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run build_runner build'
$FLUTTERTOOLPATH/flutter pub run build_runner build
displayName: 'Build Dto (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter analyze'
$FLUTTERTOOLPATH/flutter analyze
displayName: 'Flutter Analyze (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main'
$FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main
displayName: 'Build Icon (scratch)'
- task: FlutterTest@0
inputs:
projectDirectory: '.'
- stage: beta_app_deploy_stage
displayName: β版アプリ配布ステージ
condition: in(variables['Build.SourceBranch'], 'refs/heads/develop', 'refs/heads/main')
dependsOn: qa_stage
jobs:
- job: firebase_deploy_job
displayName: Firebaseへベータ版アプリ配布
steps:
- task: DownloadSecureFile@1
displayName: 'Download configs'
name: Configs
inputs:
secureFile: configs.tar.gz
- script: |
echo '>> tar -zxvf $(Configs.secureFilePath) --strip-components=1'
tar -zxvf $(Configs.secureFilePath) --strip-components=1
displayName: 'Inflate configs'
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: FlutterInstall@0
inputs:
mode: 'auto'
channel: 'stable'
version: 'latest'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter gen-l10n'
$FLUTTERTOOLPATH/flutter gen-l10n
displayName: 'Build l10n (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub get'
$FLUTTERTOOLPATH/flutter pub get
displayName: 'Install Build Tools (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run build_runner build'
$FLUTTERTOOLPATH/flutter pub run build_runner build
displayName: 'Build Dto (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main'
$FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main
displayName: 'Build Icon (scratch)'
- script: |
echo '>> gem install bundler:1.17.2'
gem install bundler:1.17.2
displayName: 'Install bundler'
- script: |
echo '>> bundle install'
bundle install
displayName: 'Install iOS gem dependency'
- script: |
echo '>> echo $(GITHUB_ACCESS_TOKEN)@github.com | xargs -I {} sed -i '' s/github.com/{}/ fastlane/Matchfile'
echo $(GITHUB_ACCESS_TOKEN)@github.com | xargs -I {} sed -i '' s/github.com/{}/ fastlane/Matchfile
echo '>> export MATCH_PASSWORD=$(MATCH_PASSWORD)'
export MATCH_PASSWORD='$(MATCH_PASSWORD)'
echo '>> bundle exec fastlane load_certs'
bundle exec fastlane load_certs
displayName: 'Fastlane match'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build ipa --flavor dev -t lib/main_dev.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppDistribution_dev.plist'
$FLUTTERTOOLPATH/flutter build ipa --flavor dev -t lib/main_dev.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppDistribution_dev.plist
displayName: 'Flutter build dev ipa (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build ipa --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppDistribution_prd.plist'
$FLUTTERTOOLPATH/flutter build ipa --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppDistribution_prd.plist
displayName: 'Flutter build prd ipa (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build apk --flavor dev -t lib/main_dev.dart --build-number=$(Build.BuildId)'
$FLUTTERTOOLPATH/flutter build apk --flavor dev -t lib/main_dev.dart --build-number=$(Build.BuildId)
displayName: 'Flutter build dev apk (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build apk --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildId)'
$FLUTTERTOOLPATH/flutter build apk --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildId)
displayName: 'Flutter build prd apk (scratch)'
- script: |
echo '>> which which npm'
which npm
echo '>> npm install'
npm install
echo '>> npx firebase --version'
npx firebase --version
displayName: 'Install Firebase tools'
- script: |
echo '>> ls -latr build/ios/ipa/'
ls -latr build/ios/ipa/
echo '>> ls -latr build/app/outputs/flutter-apk'
ls -latr build/app/outputs/flutter-apk
echo '>> npx firebase appdistribution:distribute build/ios/ipa/T-RelDev.ipa --app $(FIREBASE_APP_ID_IOS_DEV) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_DEV) --token $(FIREBASE_TOKEN)'
npx firebase appdistribution:distribute build/ios/ipa/T-RelDev.ipa --app $(FIREBASE_APP_ID_IOS_DEV) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_DEV) --token $(FIREBASE_TOKEN)
echo '>> npx firebase appdistribution:distribute build/ios/ipa/tatetsu.ipa --app $(FIREBASE_APP_ID_IOS_PRD) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_PRD --token $(FIREBASE_TOKEN)'
npx firebase appdistribution:distribute build/ios/ipa/tatetsu.ipa --app $(FIREBASE_APP_ID_IOS_PRD) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_PRD) --token $(FIREBASE_TOKEN)
echo '>> npx firebase appdistribution:distribute build/app/outputs/flutter-apk/app-dev-release.apk --app $(FIREBASE_APP_ID_ANDROID_DEV) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_DEV) --token $(FIREBASE_TOKEN)'
npx firebase appdistribution:distribute build/app/outputs/flutter-apk/app-dev-release.apk --app $(FIREBASE_APP_ID_ANDROID_DEV) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_DEV) --token $(FIREBASE_TOKEN)
echo '>> npx firebase appdistribution:distribute build/app/outputs/flutter-apk/app-prd-release.apk --app $(FIREBASE_APP_ID_ANDROID_PRD) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_PRD --token $(FIREBASE_TOKEN)'
npx firebase appdistribution:distribute build/app/outputs/flutter-apk/app-prd-release.apk --app $(FIREBASE_APP_ID_ANDROID_PRD) --groups $(FIREBASE_BETA_TESTER_GROUP_NAME_PRD) --token $(FIREBASE_TOKEN)
displayName: 'Deploy to Firebase App Distribution'
- stage: store_app_deploy_stage
displayName: ストアアプリ配布ステージ
condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
dependsOn: qa_stage
jobs:
- job: store_deploy_job
displayName: ストアへアプリ配布
steps:
- task: DownloadSecureFile@1
displayName: 'Download configs'
name: Configs
inputs:
secureFile: configs.tar.gz
- script: |
echo '>> tar -zxvf $(Configs.secureFilePath) --strip-components=1'
tar -zxvf $(Configs.secureFilePath) --strip-components=1
displayName: 'Inflate configs'
- task: JavaToolInstaller@0
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: FlutterInstall@0
inputs:
mode: 'auto'
channel: 'stable'
version: 'latest'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter gen-l10n'
$FLUTTERTOOLPATH/flutter gen-l10n
displayName: 'Build l10n (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub get'
$FLUTTERTOOLPATH/flutter pub get
displayName: 'Install Build Tools (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run build_runner build'
$FLUTTERTOOLPATH/flutter pub run build_runner build
displayName: 'Build Dto (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main'
$FLUTTERTOOLPATH/flutter pub run flutter_launcher_icons:main
displayName: 'Build Icon (scratch)'
- script: |
echo '>> gem install bundler:1.17.2'
gem install bundler:1.17.2
displayName: 'Install bundler'
- script: |
echo '>> bundle install'
bundle install
displayName: 'Install iOS gem dependency'
- script: |
echo '>> echo $(GITHUB_ACCESS_TOKEN)@github.com | xargs -I {} sed -i '' s/github.com/{}/ fastlane/Matchfile'
echo $(GITHUB_ACCESS_TOKEN)@github.com | xargs -I {} sed -i '' s/github.com/{}/ fastlane/Matchfile
echo '>> export MATCH_PASSWORD=$(MATCH_PASSWORD)'
export MATCH_PASSWORD='$(MATCH_PASSWORD)'
echo '>> bundle exec fastlane load_certs'
bundle exec fastlane load_certs
displayName: 'Fastlane match'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build web -t lib/main_prd.dart --base-href "/app/" --output public/app --release --build-number=$(Build.BuildId)'
$FLUTTERTOOLPATH/flutter build web -t lib/main_prd.dart --base-href "/app/" --output public/app --release --build-number=$(Build.BuildNumber)
displayName: 'Flutter build web (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build ipa --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppStore.plist'
$FLUTTERTOOLPATH/flutter build ipa --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildNumber) --export-options-plist=ios/ExportOptions_AppStore.plist
displayName: 'Flutter build store ipa (scratch)'
- script: |
echo '>> $FLUTTERTOOLPATH/flutter build appbundle --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildId)'
$FLUTTERTOOLPATH/flutter build appbundle --flavor prd -t lib/main_prd.dart --build-number=$(Build.BuildId)
displayName: 'Flutter build aab (scratch)'
- script: |
echo '>> which which npm'
which npm
echo '>> npm install'
npm install
echo '>> npx firebase --version'
npx firebase --version
displayName: 'Install Firebase tools'
- script: |
echo '>> npx firebase deploy --token $(FIREBASE_TOKEN)'
npx firebase deploy --token $(FIREBASE_TOKEN)
displayName: 'Deploy to ntetz.com'
- script: |
echo '>> bundle exec fastlane upload_ipa_to_store'
bundle exec fastlane upload_ipa_to_store
displayName: 'Deploy to AppStore'
- script: |
echo '>> bundle exec fastlane upload_aab_to_store'
bundle exec fastlane upload_aab_to_store
displayName: 'Deploy to PlayStore'