Skip to content

Commit a12d74b

Browse files
ci: migrate iOS workflows to SSH-based Match, add Firebase and TestFlight publishing support (#31)
1 parent 974108f commit a12d74b

File tree

3 files changed

+303
-162
lines changed

3 files changed

+303
-162
lines changed

.github/workflows/multi-platform-build-and-publish.yaml

Lines changed: 88 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -109,22 +109,53 @@ on:
109109
type: string
110110
required: true
111111

112-
build_ios:
112+
# Toggle for building and uploading iOS app to Firebase App Distribution
113+
distribute_ios_firebase:
113114
type: boolean
114115
default: false
115-
description: Build iOS App
116+
description: Distribute iOS App via Firebase App Distribution
116117

117-
# Toggle for iOS App Store publishing
118-
publish_ios:
118+
# Toggle for uploading iOS app to TestFlight (App Store Connect)
119+
distribute_ios_testflight:
119120
type: boolean
120121
default: false
121-
description: Publish iOS App On App Store
122+
description: Distribute iOS App via TestFlight (App Store Connect)
122123

123124
tester_groups:
124125
type: string
125126
description: 'Firebase Tester Group'
126127
required: true
127128

129+
app_identifier:
130+
type: string
131+
description: 'The unique bundle identifier for the iOS application'
132+
required: true
133+
134+
git_url:
135+
type: string
136+
description: 'Git URL to the private repository containing certificates and provisioning profiles for code signing (used by Fastlane Match)'
137+
required: true
138+
139+
git_branch:
140+
type: string
141+
description: 'Branch name inside the certificates repository that Fastlane Match should use to fetch signing assets'
142+
required: true
143+
144+
match_type:
145+
type: string
146+
description: 'Type of provisioning profile to fetch using Match (e.g., adhoc, appstore, development)'
147+
required: true
148+
149+
provisioning_profile_name:
150+
type: string
151+
description: 'Name of the provisioning profile to use for code signing (e.g., match AdHoc com.example.app or match AppStore com.example.app)'
152+
required: true
153+
154+
firebase_app_id:
155+
type: string
156+
description: 'Firebase App ID'
157+
required: true
158+
128159
secrets:
129160
# Android-related secrets
130161
original_keystore_file:
@@ -177,6 +208,21 @@ on:
177208
notarization_team_id:
178209
description: 'Apple developer team ID'
179210
required: false
211+
appstore_key_id:
212+
description: 'Key ID from App Store Connect API Key'
213+
required: true
214+
appstore_issuer_id:
215+
description: 'Issuer ID from App Store Connect API Key'
216+
required: true
217+
appstore_auth_key:
218+
description: 'Base64-encoded contents of the .p8 auth key file'
219+
required: true
220+
match_password:
221+
description: 'Password used to encrypt/decrypt the certificates repository used by match'
222+
required: true
223+
match_ssh_private_key:
224+
description: 'SSH private key for accessing the certificates repository'
225+
required: true
180226

181227
# Desktop signing secrets
182228
windows_signing_key:
@@ -266,37 +312,64 @@ jobs:
266312
# Firebase Distribution Job for iOS
267313
publish_ios_app_to_firebase:
268314
name: Publish iOS App On Firebase
269-
runs-on: macos-latest
315+
if: inputs.distribute_ios_firebase
316+
runs-on: macos-14
270317
permissions:
271318
contents: write
272319
steps:
320+
- name: Set Xcode version 16.2
321+
uses: maxim-lobanov/setup-xcode@v1
322+
with:
323+
xcode-version: '16.2'
324+
273325
- name: Checkout Repository
274326
uses: actions/checkout@v4
275327
with:
276328
fetch-depth: 0
277329

278330
- name: Deploy iOS App to Firebase
279-
if: inputs.build_ios
280331
uses: openMF/[email protected]
281332
continue-on-error: true
282333
with:
334+
app_identifier: ${{ inputs.app_identifier }}
335+
git_url: ${{ inputs.git_url }}
336+
git_branch: ${{ inputs.git_branch }}
337+
match_type: ${{ inputs.match_type }}
338+
provisioning_profile_name: ${{ inputs.provisioning_profile_name }}
339+
match_password: ${{ secrets.match_password }}
340+
match_ssh_private_key: ${{ secrets.match_ssh_private_key }}
283341
ios_package_name: ${{ inputs.ios_package_name }}
342+
firebase_app_id: ${{ inputs.firebase_app_id }}
284343
firebase_creds: ${{ secrets.firebase_creds }}
285344
tester_groups: ${{ inputs.tester_groups }}
286345

287-
# App Store Publishing Job
288-
publish_ios_app_to_app_center:
346+
# Testflight Publishing Job
347+
publish_ios_app_to_testflight:
289348
name: Publish iOS App On App Center
290-
if: inputs.publish_ios
291-
runs-on: macos-latest
349+
if: inputs.distribute_ios_testflight
350+
runs-on: macos-14
292351
steps:
352+
- name: Set Xcode version 16.2
353+
uses: maxim-lobanov/setup-xcode@v1
354+
with:
355+
xcode-version: '16.2'
356+
293357
- name: Checkout Repository
294358
uses: actions/checkout@v4
295359

296-
- name: Git Status
297-
run: git status
298-
299-
# TODO: Implement App Store publishing
360+
- name: Deploy iOS app to TestFlight
361+
uses: openMF/mifos-x-actionhub-publish-ios-on-appstore-production@main
362+
with:
363+
app_identifier: ${{ inputs.app_identifier }}
364+
git_url: ${{ inputs.git_url }}
365+
git_branch: ${{ inputs.git_branch }}
366+
match_type: ${{ inputs.match_type }}
367+
provisioning_profile_name: ${{ inputs.provisioning_profile_name }}
368+
appstore_key_id: ${{ secrets.appstore_key_id }}
369+
appstore_issuer_id: ${{ secrets.appstore_issuer_id }}
370+
appstore_auth_key: ${{ secrets.appstore_auth_key }}
371+
match_password: ${{ secrets.match_password }}
372+
match_ssh_private_key: ${{ secrets.match_ssh_private_key }}
300373

301374
# Desktop Publishing Job
302375
publish_desktop:

.github/workflows/pr-check.yaml

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,23 @@ on:
115115
required: false
116116
default: true
117117

118-
keychain_name:
119-
description: 'Name of the keychain to use for signing'
118+
git_url:
119+
description: 'Git URL to the private repository containing certificates and provisioning profiles for code signing (used by Fastlane Match)'
120120
type: string
121121
required: false
122-
default: 'ci-signing.keychain'
122+
default: '[email protected]:openMF/ios-provisioning-profile.git'
123123

124-
match_type:
125-
description: 'Specifies the type of provisioning profile to use for code signing (e.g., adhoc, appstore, development)'
124+
git_branch:
125+
description: 'Branch name inside the certificates repository that Fastlane Match should use to fetch signing assets'
126126
type: string
127127
required: false
128-
default: 'adhoc'
128+
default: 'master'
129129

130-
export_method:
131-
description: 'Defines how the app should be packaged for distribution (e.g., ad-hoc, app-store, development)'
130+
match_type:
131+
description: 'Specifies the type of provisioning profile to use for code signing (e.g., adhoc, appstore, development)'
132132
type: string
133133
required: false
134-
default: 'ad-hoc'
134+
default: 'adhoc'
135135

136136
app_identifier:
137137
description: 'The bundle identifier used to uniquely identify your iOS application'
@@ -146,18 +146,14 @@ on:
146146
default: 'match AdHoc org.mifos.kmp.template'
147147

148148
secrets:
149-
MATCH_GIT_BASIC_AUTHORIZATION:
150-
description: 'Base64-encoded GitHub token used by Fastlane Match to authenticate and clone the certificates/profiles repository securely'
149+
match_ssh_private_key:
150+
description: 'SSH private key for accessing the certificates repository'
151151
required: true
152152

153-
MATCH_PASSWORD:
153+
match_password:
154154
description: 'Encryption passphrase used by Fastlane Match to decrypt the signing certificates and provisioning profiles stored in the remote repository'
155155
required: true
156156

157-
KEYCHAIN_PASSWORD:
158-
description: 'Password used to create and unlock a temporary keychain during the CI build, allowing codesigning without user interaction'
159-
required: true
160-
161157
# Concurrency settings to prevent multiple simultaneous workflow runs
162158
concurrency:
163159
group: build-${{ github.ref }}
@@ -229,13 +225,12 @@ jobs:
229225

230226
- name: Build iOS App
231227
if: ${{ inputs.build_ios }}
232-
uses: openMF/mifos-x-actionhub-build-ios-app@v1.0.1
228+
uses: openMF/mifos-x-actionhub-build-ios-app@main
233229
with:
234-
match_git_basic_authorization: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
235-
match_password: ${{ secrets.MATCH_PASSWORD }}
236-
keychain_name: ${{ inputs.keychain_name }}
237-
keychain_password: ${{ secrets.KEYCHAIN_PASSWORD }}
230+
match_ssh_private_key: ${{ secrets.match_ssh_private_key}}
231+
match_password: ${{ secrets.match_password }}
232+
git_url: ${{ inputs.git_url }}
233+
git_branch: ${{ inputs.git_branch }}
238234
match_type: ${{ inputs.match_type }}
239-
export_method: ${{ inputs.export_method }}
240235
app_identifier: ${{ inputs.app_identifier }}
241236
provisioning_profile_name: ${{ inputs.provisioning_profile_name }}

0 commit comments

Comments
 (0)