File tree Expand file tree Collapse file tree 4 files changed +36
-0
lines changed
Expand file tree Collapse file tree 4 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -21,3 +21,7 @@ KEYCHAIN_PASSWORD=
2121# Optional overrides (defaults are configured in fastlane)
2222APP_IDENTIFIER = ch.michaelschoenbaechler.parlwatch
2323APPLE_TEAM_ID = 65DUBW68Z2
24+ # Optional: overrides CFBundleShortVersionString (e.g. 2026.3.3)
25+ IOS_MARKETING_VERSION =
26+ # Optional: overrides CFBundleVersion
27+ IOS_BUILD_NUMBER =
Original file line number Diff line number Diff line change 1111 - testflight
1212 - appstore
1313 default : testflight
14+ marketing_version :
15+ description : Optional marketing version (CFBundleShortVersionString), e.g. 2026.3.3
16+ required : false
17+ type : string
1418
1519jobs :
1620 deploy-ios :
1721 runs-on : macos-latest
1822 env :
23+ TZ : Europe/Zurich
1924 APP_IDENTIFIER : ch.michaelschoenbaechler.parlwatch
2025 APPLE_TEAM_ID : 65DUBW68Z2
26+ IOS_MARKETING_VERSION : ${{ github.event.inputs.marketing_version }}
2127 APP_STORE_CONNECT_KEY_ID : ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
2228 APP_STORE_CONNECT_ISSUER_ID : ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
2329 APP_STORE_CONNECT_API_KEY : ${{ secrets.APP_STORE_CONNECT_API_KEY }}
Original file line number Diff line number Diff line change @@ -41,11 +41,18 @@ Optional:
4141
4242- ` APP_IDENTIFIER ` (default: ` ch.michaelschoenbaechler.parlwatch ` )
4343- ` APPLE_TEAM_ID ` (default: ` 65DUBW68Z2 ` )
44+ - ` IOS_MARKETING_VERSION ` (overrides ` CFBundleShortVersionString ` )
45+ - ` IOS_BUILD_NUMBER ` (overrides ` CFBundleVersion ` )
4446
4547Local note:
4648
4749- Local deploy expects signing certificate/profile to already be available in your login keychain.
4850
51+ Versioning note:
52+
53+ - In CI, if ` IOS_MARKETING_VERSION ` is not provided, Fastlane auto-sets ` CFBundleShortVersionString ` to a date format ` YYYY.M.D ` (for example ` 2026.3.3 ` ).
54+ - This avoids App Store Connect rejections when the approved version is already higher than your checked-in version string.
55+
4956## GitHub Actions deployment
5057
5158Use the ` iOS Deploy ` workflow (` .github/workflows/ios-deploy.yml ` ) and choose:
@@ -124,3 +131,4 @@ Add these repository secrets before running the workflow:
124131 - ` KEYCHAIN_PASSWORD `
1251323 . Trigger workflow: ` Actions ` > ` iOS Deploy ` > ` Run workflow ` .
1261334 . Select target: ` testflight ` or ` appstore ` .
134+ 5 . Optional: set ` marketing_version ` if you want a manual short version for that run.
Original file line number Diff line number Diff line change @@ -19,6 +19,22 @@ def app_store_connect_api_key_from_env
1919end
2020
2121platform :ios do
22+ private_lane :set_ci_marketing_version do
23+ marketing_version = ENV [ "IOS_MARKETING_VERSION" ] . to_s . strip
24+
25+ if marketing_version . empty? && ENV [ "CI" ] == "true"
26+ now = Time . now
27+ marketing_version = now . strftime ( "%Y.%-m.%-d" )
28+ end
29+
30+ return if marketing_version . empty?
31+
32+ increment_version_number (
33+ xcodeproj : "App.xcodeproj" ,
34+ version_number : marketing_version
35+ )
36+ end
37+
2238 private_lane :set_ci_build_number do
2339 build_number = ENV [ "IOS_BUILD_NUMBER" ] . to_s . strip
2440 build_number = ENV [ "GITHUB_RUN_ID" ] . to_s . strip if build_number . empty?
@@ -60,6 +76,7 @@ platform :ios do
6076 desc "Build and upload an iOS build to TestFlight"
6177 lane :deploy_testflight do
6278 api_key = app_store_connect_api_key_from_env
79+ set_ci_marketing_version
6380 set_ci_build_number
6481 build_release
6582
@@ -73,6 +90,7 @@ platform :ios do
7390 desc "Build and upload an iOS build to App Store Connect"
7491 lane :deploy_appstore do
7592 api_key = app_store_connect_api_key_from_env
93+ set_ci_marketing_version
7694 set_ci_build_number
7795 build_release
7896
You can’t perform that action at this time.
0 commit comments