-
Notifications
You must be signed in to change notification settings - Fork 4
156 lines (126 loc) · 5.35 KB
/
flutter_release_ios.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
name: Flutter release ios
on:
release:
types: [published]
jobs:
DeployIosBetaAdhoc:
name: Build and release beta adhoc
if: ${{ !contains ( github.event.release.tag_name, '_' ) || endsWith( github.event.release.tag_name, '_ios' ) || endsWith( github.event.release.tag_name, '_ios_betaonly' ) }}
# NB: ${{ syntax }} is required despite GitHub docs to the contrary. Appears that ! operator can't be used otherwise.
runs-on: macos-14
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load Flutter config
uses: kuhnroyal/flutter-fvm-config-action@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Flutter version
run: flutter --version
- name: Cache pub dependencies
uses: actions/cache@v4
with:
path: ${{ env.PUB_CACHE }}
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-
- name: Download pub dependencies
run: flutter pub get
- name: Run analyzer
run: flutter analyze
- name: Run tests
run: flutter test
- name: Choose xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Build iOS Flutter App
run: flutter build ios --config-only --release --no-codesign --dart-define KEEVAULT_STAGE=beta --dart-define KEEVAULT_NAME_SUFFIX='(b)' --dart-define KEEVAULT_ID_SUFFIX=.beta
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler: 2.5.17
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Release beta stage app to beta delivery platform
env:
MATCH_GIT_BASIC_AUTHORIZATION: '${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}'
MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
TESTFAIRY_API_KEY: '${{ secrets.TESTFAIRY_API_KEY }}'
TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
run: |
cd ios
bundle exec fastlane beta_stage
- name: Store symbols on GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
run: |
mv ios/Runner.app.dSYM.zip ios/fairy.Runner.app.dSYM.zip
gh release upload $GH_RELEASE_TAG_NAME ios/fairy.Runner.app.dSYM.zip
DeployIosProdTestflight:
name: Build and release prod testflight
if: ${{ !contains ( github.event.release.tag_name, '_' ) || endsWith( github.event.release.tag_name, '_ios' ) }}
runs-on: macos-14
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Load Flutter config
uses: kuhnroyal/flutter-fvm-config-action@v2
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: ${{ env.FLUTTER_CHANNEL }}
cache: true
- name: Flutter version
run: flutter --version
- name: Cache pub dependencies
uses: actions/cache@v4
with:
path: ${{ env.PUB_CACHE }}
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: ${{ runner.os }}-pub-
- name: Download pub dependencies
run: flutter pub get
- name: Run analyzer
run: flutter analyze
- name: Run tests
run: flutter test
- name: Choose xcode version
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15.4'
- name: Build iOS Flutter App
run: flutter build ios --config-only --release --no-codesign --dart-define KEEVAULT_STAGE=prod --dart-define KEEVAULT_NAME_SUFFIX= --dart-define KEEVAULT_ID_SUFFIX= --dart-define IAP_APPLE_APP_STORE=yes
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
bundler: 2.5.17
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Release prod stage app to appstore testflight
env:
MATCH_GIT_BASIC_AUTHORIZATION: '${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}'
MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
APP_STORE_CONNECT_API_KEY_ISSUER_ID: '${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}'
APP_STORE_CONNECT_API_KEY_KEY: '${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}'
APP_STORE_CONNECT_API_KEY_KEY_ID: '${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}'
run: |
cd ios
bundle exec fastlane prod_stage_testflight
- name: Store symbols on GitHub Release
env:
GH_TOKEN: ${{ github.token }}
GH_RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
run: |
mv ios/Runner.app.dSYM.zip ios/production.Runner.app.dSYM.zip
gh release upload $GH_RELEASE_TAG_NAME ios/production.Runner.app.dSYM.zip