-
Notifications
You must be signed in to change notification settings - Fork 11
163 lines (140 loc) · 5.23 KB
/
deploy-ios.yaml
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
name: Deploy iOS
on:
workflow_dispatch:
push:
branches:
- develop
- fix/ios-deploy
jobs:
build:
runs-on: macos-14
timeout-minutes: 60
env:
TZ: Asia/Tokyo
FLUTTER_VERSION:
FLUTTER_CHANNEL:
FLUTTER_HOME:
steps:
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch all history for all tags and branches
fetch-depth: 0
- name: Set up ssh
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_ID_ED25519 }}" | base64 -d > ~/.ssh/id_ed25519
chmod 700 ~/.ssh/id_ed25519
eval $(ssh-agent -s)
echo "Host github.com \n\tIdentityFile ~/.ssh/id_ed25519\n\tUser git\n\tIdentityiesOnly yes" >> ~/.ssh/config
ssh-keyscan -H github.com >> ~/.ssh/known_hosts
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- name: Show Xcode version
run: xcodebuild -version
- name: Fetch flutter config
id: fvm-config-action
uses: kuhnroyal/flutter-fvm-config-action@v2
# https://github.com/subosito/flutter-action
- name: Setup flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
cache: true
- name: Install Gems
working-directory: app/ios
run: |
gem install bundler
bundle install
- name: Install Brewfile dependencies
working-directory: app/ios
run: brew bundle
- name: Cache pubspec dependencies
uses: actions/cache@v2
with:
path: |
${{ env.FLUTTER_HOME }}/.pub-cache
**/.packages
**/.flutter-plugins
**/.flutter-plugin-dependencies
**/.dart_tool/package_config.json
key: build-pubspec-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
build-pubspec-
- name: Setup melos
run: |
ln -s $FLUTTER_ROOT .fvm/flutter_sdk
dart pub global activate melos
- name: Resolve dependencies
run: melos bootstrap
- name: Run build_runner
run: |
echo '${{ secrets.ENV }}' | base64 -d > app/.env
ln -s $FLUTTER_ROOT .fvm/flutter_sdk
melos generate
- name: Cache Pods
uses: actions/cache@v2
with:
path: app/ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Install dependencies
working-directory: app/ios
run: pod install
- name: Set Firebase Configuration
run: echo '${{ secrets.FIREBASE_IOS }}' | base64 -d > app/ios/Runner/GoogleService-Info.plist
- name: Set App Store Connect Configuration
working-directory: app
run: |
echo '${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}' | base64 -d > AuthKey_NGL2W4BQP6.p8
cp *.p8 ios/
- name: Increment build number
working-directory: app/ios
env:
PRODUCE_USERNAME: ${{ secrets.PRODUCE_USERNAME }}
SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA: false
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}
FASTLANE_USER: [email protected]
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
LANG: ja_JP.UTF-8
run: fastlane setup_build_number
- name: Prebuild
working-directory: app
run: flutter build ios --release --no-codesign
- name: Build IPA
working-directory: app
env:
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
APP_STORE_CONNECT_API_KEY_BASE64: ${{secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}
run: |
xcodebuild \
-workspace ios/Runner.xcworkspace \
-scheme Runner \
-sdk iphoneos \
-configuration Release archive \
-archivePath build/ios/Runner.xcarchive \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO | xcbeautify
xcodebuild -exportArchive \
-archivePath build/ios/Runner.xcarchive \
-exportOptionsPlist ios/ExportOptions.plist \
-exportPath . -allowProvisioningUpdates \
-authenticationKeyIssuerID ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }} \
-authenticationKeyID ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }} \
-authenticationKeyPath `pwd`/AuthKey_NGL2W4BQP6.p8 | xcbeautify
mv eqmonitor.ipa ios/Runner.ipa
- name: Upload to App Store Connect
working-directory: app/ios
env:
PRODUCE_USERNAME: ${{ secrets.PRODUCE_USERNAME }}
SPACESHIP_ONLY_ALLOW_INTERACTIVE_2FA: false
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_BASE64 }}
FASTLANE_USER: [email protected]
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
LANG: ja_JP.UTF-8
run: fastlane upload