Skip to content

Commit 2c915aa

Browse files
Add lane for publishing iOS app to App Store and update README (#32)
1 parent a12d74b commit 2c915aa

File tree

2 files changed

+95
-3
lines changed

2 files changed

+95
-3
lines changed

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

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ on:
121121
default: false
122122
description: Distribute iOS App via TestFlight (App Store Connect)
123123

124+
# Toggle for uploading iOS app to Appstore
125+
distribute_ios_appstore:
126+
type: boolean
127+
default: false
128+
description: Distribute iOS App to Appstore
129+
124130
tester_groups:
125131
type: string
126132
description: 'Firebase Tester Group'
@@ -156,6 +162,11 @@ on:
156162
description: 'Firebase App ID'
157163
required: true
158164

165+
metadata_path:
166+
type: string
167+
description: 'Path to the metadata directory containing information about the app (e.g., app name, description, screenshots, etc.)'
168+
required: true
169+
159170
secrets:
160171
# Android-related secrets
161172
original_keystore_file:
@@ -313,7 +324,7 @@ jobs:
313324
publish_ios_app_to_firebase:
314325
name: Publish iOS App On Firebase
315326
if: inputs.distribute_ios_firebase
316-
runs-on: macos-14
327+
runs-on: macos-latest
317328
permissions:
318329
contents: write
319330
steps:
@@ -347,7 +358,7 @@ jobs:
347358
publish_ios_app_to_testflight:
348359
name: Publish iOS App On App Center
349360
if: inputs.distribute_ios_testflight
350-
runs-on: macos-14
361+
runs-on: macos-latest
351362
steps:
352363
- name: Set Xcode version 16.2
353364
uses: maxim-lobanov/setup-xcode@v1
@@ -371,6 +382,35 @@ jobs:
371382
match_password: ${{ secrets.match_password }}
372383
match_ssh_private_key: ${{ secrets.match_ssh_private_key }}
373384

385+
# Appstore Publishing Job
386+
publish_ios_app_to_appstore:
387+
name: Publish iOS App On App Store
388+
if: inputs.distribute_ios_appstore
389+
runs-on: macos-latest
390+
steps:
391+
- name: Set Xcode version 16.2
392+
uses: maxim-lobanov/setup-xcode@v1
393+
with:
394+
xcode-version: '16.2'
395+
396+
- name: Checkout Repository
397+
uses: actions/checkout@v4
398+
399+
- name: Deploy iOS App to App Store
400+
uses: openMF/[email protected]
401+
with:
402+
app_identifier: ${{ inputs.app_identifier }}
403+
git_url: ${{ inputs.git_url }}
404+
git_branch: ${{ inputs.git_branch }}
405+
match_type: ${{ inputs.match_type }}
406+
provisioning_profile_name: ${{ inputs.provisioning_profile_name }}
407+
metadata_path: ${{ inputs.metadata_path }}
408+
appstore_key_id: ${{ secrets.appstore_key_id }}
409+
appstore_issuer_id: ${{ secrets.appstore_issuer_id }}
410+
appstore_auth_key: ${{ secrets.appstore_auth_key }}
411+
match_password: ${{ secrets.match_password }}
412+
match_ssh_private_key: ${{ secrets.match_ssh_private_key }}
413+
374414
# Desktop Publishing Job
375415
publish_desktop:
376416
name: Publish Desktop App

README.md

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,18 @@ platform :ios do
447447
options.merge(match_type: "appstore")
448448
)
449449

450+
increment_version_number(
451+
xcodeproj: "cmp-ios/iosApp.xcodeproj",
452+
version_number: "1.0.0"
453+
)
454+
450455
latest_build_number = latest_testflight_build_number(
451456
app_identifier: options[:app_identifier] || "com.example.9af3c1d2",
452457
api_key: Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
453458
)
454459

455460
increment_build_number(
456-
xcodeproj: ios_config[:project_path],
461+
xcodeproj: "cmp-ios/iosApp.xcodeproj",
457462
build_number: latest_build_number + 1
458463
)
459464

@@ -468,6 +473,46 @@ platform :ios do
468473
skip_waiting_for_build_processing: true
469474
)
470475
end
476+
477+
desc "Upload iOS Application to AppStore"
478+
lane :release do |options|
479+
480+
setup_ci_if_needed
481+
load_api_key(options)
482+
fetch_certificates_with_match(
483+
options.merge(match_type: "appstore")
484+
)
485+
486+
increment_version_number(
487+
xcodeproj: "cmp-ios/iosApp.xcodeproj",
488+
version_number: "1.0.0"
489+
)
490+
491+
latest_build_number = latest_testflight_build_number(
492+
app_identifier: options[:app_identifier] || "com.example.9af3c1d2",
493+
api_key: Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
494+
)
495+
496+
increment_build_number(
497+
xcodeproj: "cmp-ios/iosApp.xcodeproj",
498+
build_number: latest_build_number + 1
499+
)
500+
501+
build_ios_project(
502+
options.merge(
503+
provisioning_profile_name: "match AppStore com.example.9af3c1d2"
504+
)
505+
)
506+
507+
deliver(
508+
metadata_path: options[:metadata_path] || "./fastlane/metadata",
509+
automatic_release: false,
510+
api_key: Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY],
511+
skip_app_version_update: true,
512+
force: true,
513+
precheck_include_in_app_purchases: false
514+
)
515+
end
471516
end
472517
```
473518

@@ -668,6 +713,7 @@ The workflow supports the following configuration inputs:
668713
- `publish_android`: Publish to Play Store (Default: `false`)
669714
- `distribute_ios_firebase`: Distribute iOS App via Firebase App Distribution (Default: `false`)
670715
- `distribute_ios_testflight`: Distribute iOS App via TestFlight (Default: `false`)
716+
- `distribute_ios_appstore`: Distribute iOS App to Appstore (Default: `false`)
671717
- `publish_desktop`: Publish Desktop Apps (Default: `false`)
672718
- `publish_web`: Publish Web App (Default: `true`)
673719

@@ -744,6 +790,11 @@ on:
744790
default: false
745791
description: Distribute iOS App via TestFlight (App Store Connect)
746792

793+
distribute_ios_appstore:
794+
type: boolean
795+
default: false
796+
description: Distribute iOS App to Appstore
797+
747798
permissions:
748799
contents: write
749800
id-token: write
@@ -770,6 +821,7 @@ jobs:
770821
match_type: 'adhoc'
771822
provisioning_profile_name: 'match AdHoc org.mifos.kmp.template'
772823
firebase_app_id: '1:728434912738:ios:1d81f8e53ca7a6f31a1dbb'
824+
metadata_path: './fastlane/metadata'
773825
publish_android: ${{ inputs.publish_android }}
774826
distribute_ios_firebase: ${{ inputs.distribute_ios_firebase }}
775827
distribute_ios_testflight: ${{ inputs.distribute_ios_testflight }}

0 commit comments

Comments
 (0)