Skip to content

Commit 1c95358

Browse files
authored
[NO TICKET] iOS fastlane setup (#44)
* [NO TICKETS] update app name and bundle identifier * [NO TICKETS] resize app icon to build properly * [NO TICKETS] update min supported version for ios to 15.0 * [NO TICKETS] update bundle id in ios project * [NO TICKETS] Set - app uses non-exempt encryption to false * [NO TICKETS] Add build workflow and fastfile to build and upload to testflight * [NO TICKETS] Update .gitignore file to not ignore swift files * [NO-TICKET] Add iOS fastlane support - bundle id update in Appfile * [NO-TICKET] Add iOS fastlane support - cleanup * [NO-TICKET] Add iOS fastlane support - cleanup * [NO-TICKET] Add iOS fastlane support - cleanup * [NO-TICKET] Add iOS fastlane support - cleanup * [NO-TICKET] Add iOS fastlane support - cleanup * [NO-TICKET] Add iOS fastlane support * [NO-TICKET] Add iOS fastlane support - fix AppIcon issue * [NO-TICKET] Add iOS fastlane support - increment build number * [NO-TICKET] Add iOS fastlane support
1 parent 4a0f442 commit 1c95358

File tree

15 files changed

+262
-15
lines changed

15 files changed

+262
-15
lines changed

.github/workflows/build-ios.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: iOS Build and upload to testflight
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: macos-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version-file: "frontend/package.json"
21+
22+
- name: Setup Xcode
23+
uses: maxim-lobanov/setup-xcode@v1
24+
with:
25+
xcode-version: '16.2'
26+
27+
- name: Install Bundler
28+
run: gem install bundler
29+
30+
- name: Create .env file
31+
working-directory: frontend
32+
run: |
33+
echo "VITE_BUILD_DATE=1970-01-01
34+
VITE_BUILD_TIME=00:00:00
35+
VITE_BUILD_TS=1970-01-01T00:00:00+0000
36+
VITE_BUILD_COMMIT_SHA=test
37+
VITE_BUILD_ENV_CODE=test
38+
VITE_BUILD_WORKFLOW_RUNNER=test
39+
VITE_BUILD_WORKFLOW_NAME=test
40+
VITE_BUILD_WORKFLOW_RUN_NUMBER=1
41+
VITE_BUILD_WORKFLOW_RUN_ATTEMPT=1
42+
VITE_BASE_URL_API=https://jsonplaceholder.typicode.com
43+
VITE_TOAST_AUTO_DISMISS_MILLIS=1500" > .env
44+
45+
- name: Install dependencies
46+
working-directory: frontend
47+
run: npm ci
48+
49+
- name: Build Ionic
50+
working-directory: frontend
51+
run: npm run build
52+
53+
- name: Prepare Capacitor for iOS
54+
working-directory: frontend
55+
run: |
56+
npx cap sync ios
57+
npx cap copy ios
58+
59+
- name: Install CocoaPods
60+
working-directory: frontend/ios/App
61+
run: pod install --verbose
62+
63+
- name: Install Fastlane
64+
working-directory: frontend/ios/App
65+
run: gem install fastlane
66+
67+
- name: Setup SSH for Fastlane Match Repo Access
68+
run: |
69+
mkdir -p ~/.ssh
70+
echo "${{ secrets.IOS_SIGNING_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
71+
chmod 600 ~/.ssh/id_rsa
72+
ssh-keyscan github.com >> ~/.ssh/known_hosts
73+
74+
- name: Decode App Store API Key
75+
working-directory: frontend/ios/App
76+
env:
77+
IOS_API_KEY_JSON: ${{ secrets.IOS_API_KEY_JSON }}
78+
run: echo "$IOS_API_KEY_JSON" > /tmp/api-key.json
79+
80+
- name: Set up Fastlane Match Password
81+
run: echo "MATCH_PASSWORD=${{ secrets.FASTLANE_MATCH_PASSWORD }}" >> $GITHUB_ENV
82+
83+
- name: Build iOS App for Simulator
84+
working-directory: frontend/ios/App
85+
env:
86+
NSUnbufferedIO: "YES"
87+
FASTLANE_VERBOSE: "1"
88+
run: |
89+
bundle install
90+
bundle exec fastlane ios build_for_simulator --verbose
91+
92+
- name: Upload App.app (iOS Simulator File)
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: build_for_simulator
96+
path: frontend/ios/App/build/simulator/App.xcarchive/Products/Applications/
97+
retention-days: 7
98+
99+
- name: Build iOS App for testflight.
100+
working-directory: frontend/ios/App
101+
env:
102+
NSUnbufferedIO: "YES"
103+
FASTLANE_VERBOSE: "1"
104+
FASTLANE_MATCH_PASSWORD: ${{ secrets.FASTLANE_MATCH_PASSWORD }}
105+
run: |
106+
bundle install
107+
bundle exec fastlane ios build_and_send_to_testflight --verbose
108+
109+
- name: Upload App.ipa (iOS device installation)
110+
uses: actions/upload-artifact@v4
111+
with:
112+
name: build_for_device
113+
path: frontend/ios/App/build/device/App.ipa
114+
retention-days: 7

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ node_modules
1717
*.ntvs*
1818
*.njsproj
1919
*.sln
20-
*.sw*
2120

2221
# Use either yarn.lock or package-lock.json
2322
# Uncomment one of them to maintain a single lockfile

frontend/capacitor.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type { CapacitorConfig } from '@capacitor/cli';
22

33
const config: CapacitorConfig = {
4-
appId: 'com.moduscreate.medreportai',
5-
appName: 'MedReportAI',
4+
appId: 'com.moduscreate.appmedaigen',
5+
appName: 'MedReport AI GEN',
66
webDir: 'dist',
77
plugins: {
88
StatusBar: {

frontend/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="utf-8" />
5-
<title>MEDReport AI</title>
5+
<title>MedReport AI GEN</title>
66

77
<base href="/" />
88

@@ -20,7 +20,7 @@
2020

2121
<!-- add to homescreen for ios -->
2222
<meta name="apple-mobile-web-app-capable" content="yes" />
23-
<meta name="apple-mobile-web-app-title" content="MEDReport AI" />
23+
<meta name="apple-mobile-web-app-title" content="MedReport AI GEN" />
2424
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
2525

2626
<meta name="mobile-web-app-capable" content="yes" />

frontend/ionic.config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "MEDReport AI",
2+
"name": "MedReport AI GEN",
33
"integrations": {
44
"capacitor": {}
55
},

frontend/ios/App/App.xcodeproj/project.pbxproj

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,15 +347,18 @@
347347
baseConfigurationReference = FC68EB0AF532CFC21C3344DD /* Pods-App.debug.xcconfig */;
348348
buildSettings = {
349349
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
350+
CODE_SIGN_IDENTITY = "Apple Development";
350351
CODE_SIGN_STYLE = Automatic;
351352
CURRENT_PROJECT_VERSION = 1;
353+
DEVELOPMENT_TEAM = 287TS9B2H2;
352354
INFOPLIST_FILE = App/Info.plist;
353355
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
354356
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
355357
MARKETING_VERSION = 1.0;
356358
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
357-
PRODUCT_BUNDLE_IDENTIFIER = net.leanstacks.ionic8;
359+
PRODUCT_BUNDLE_IDENTIFIER = com.moduscreate.appmedaigen;
358360
PRODUCT_NAME = "$(TARGET_NAME)";
361+
PROVISIONING_PROFILE_SPECIFIER = "";
359362
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
360363
SWIFT_VERSION = 5.0;
361364
TARGETED_DEVICE_FAMILY = "1,2";
@@ -367,14 +370,17 @@
367370
baseConfigurationReference = AF51FD2D460BCFE21FA515B2 /* Pods-App.release.xcconfig */;
368371
buildSettings = {
369372
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
373+
CODE_SIGN_IDENTITY = "Apple Development";
370374
CODE_SIGN_STYLE = Automatic;
371375
CURRENT_PROJECT_VERSION = 1;
376+
DEVELOPMENT_TEAM = 287TS9B2H2;
372377
INFOPLIST_FILE = App/Info.plist;
373378
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
374379
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
375380
MARKETING_VERSION = 1.0;
376-
PRODUCT_BUNDLE_IDENTIFIER = net.leanstacks.ionic8;
381+
PRODUCT_BUNDLE_IDENTIFIER = com.moduscreate.appmedaigen;
377382
PRODUCT_NAME = "$(TARGET_NAME)";
383+
PROVISIONING_PROFILE_SPECIFIER = "";
378384
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
379385
SWIFT_VERSION = 5.0;
380386
TARGETED_DEVICE_FAMILY = "1,2";
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import UIKit
2+
import Capacitor
3+
4+
@UIApplicationMain
5+
class AppDelegate: UIResponder, UIApplicationDelegate {
6+
7+
var window: UIWindow?
8+
9+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
10+
// Override point for customization after application launch.
11+
return true
12+
}
13+
14+
func applicationWillResignActive(_ application: UIApplication) {
15+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
16+
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
17+
}
18+
19+
func applicationDidEnterBackground(_ application: UIApplication) {
20+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
21+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
22+
}
23+
24+
func applicationWillEnterForeground(_ application: UIApplication) {
25+
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
26+
}
27+
28+
func applicationDidBecomeActive(_ application: UIApplication) {
29+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
30+
}
31+
32+
func applicationWillTerminate(_ application: UIApplication) {
33+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
34+
}
35+
36+
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
37+
// Called when the app was launched with a url. Feel free to add additional processing here,
38+
// but if you want the App API to support tracking app url opens, make sure to keep this call
39+
return ApplicationDelegateProxy.shared.application(app, open: url, options: options)
40+
}
41+
42+
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
43+
// Called when the app was launched with an activity, including Universal Links.
44+
// Feel free to add additional processing here, but if you want the App API to support
45+
// tracking app url opens, make sure to keep this call
46+
return ApplicationDelegateProxy.shared.application(application, continue: userActivity, restorationHandler: restorationHandler)
47+
}
48+
49+
}
Loading
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"info" : {
3-
"version" : 1,
4-
"author" : "xcode"
3+
"author" : "xcode",
4+
"version" : 1
55
}
6-
}
6+
}

frontend/ios/App/App/Info.plist

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>CFBundleDevelopmentRegion</key>
66
<string>en</string>
77
<key>CFBundleDisplayName</key>
8-
<string>Ionic Playground 8</string>
8+
<string>MedReport AI GEN</string>
99
<key>CFBundleExecutable</key>
1010
<string>$(EXECUTABLE_NAME)</string>
1111
<key>CFBundleIdentifier</key>
@@ -20,6 +20,8 @@
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
2222
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>ITSAppUsesNonExemptEncryption</key>
24+
<false/>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
2527
<key>UILaunchStoryboardName</key>

frontend/ios/App/Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gem "fastlane"

frontend/ios/App/Podfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require_relative '../../node_modules/@capacitor/ios/scripts/pods_helpers'
22

3-
platform :ios, '13.0'
3+
platform :ios, '15.0'
44
use_frameworks!
55

66
# workaround to avoid Xcode caching of Pods that requires
@@ -12,6 +12,7 @@ def capacitor_pods
1212
pod 'Capacitor', :path => '../../node_modules/@capacitor/ios'
1313
pod 'CapacitorCordova', :path => '../../node_modules/@capacitor/ios'
1414
pod 'CapacitorApp', :path => '../../node_modules/@capacitor/app'
15+
pod 'CapacitorFilesystem', :path => '../../node_modules/@capacitor/filesystem'
1516
pod 'CapacitorHaptics', :path => '../../node_modules/@capacitor/haptics'
1617
pod 'CapacitorKeyboard', :path => '../../node_modules/@capacitor/keyboard'
1718
pod 'CapacitorStatusBar', :path => '../../node_modules/@capacitor/status-bar'

frontend/ios/App/Podfile.lock

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ PODS:
44
- CapacitorApp (6.0.2):
55
- Capacitor
66
- CapacitorCordova (6.2.0)
7+
- CapacitorFilesystem (6.0.2):
8+
- Capacitor
79
- CapacitorHaptics (6.0.2):
810
- Capacitor
911
- CapacitorKeyboard (6.0.3):
@@ -15,6 +17,7 @@ DEPENDENCIES:
1517
- "Capacitor (from `../../node_modules/@capacitor/ios`)"
1618
- "CapacitorApp (from `../../node_modules/@capacitor/app`)"
1719
- "CapacitorCordova (from `../../node_modules/@capacitor/ios`)"
20+
- "CapacitorFilesystem (from `../../node_modules/@capacitor/filesystem`)"
1821
- "CapacitorHaptics (from `../../node_modules/@capacitor/haptics`)"
1922
- "CapacitorKeyboard (from `../../node_modules/@capacitor/keyboard`)"
2023
- "CapacitorStatusBar (from `../../node_modules/@capacitor/status-bar`)"
@@ -26,6 +29,8 @@ EXTERNAL SOURCES:
2629
:path: "../../node_modules/@capacitor/app"
2730
CapacitorCordova:
2831
:path: "../../node_modules/@capacitor/ios"
32+
CapacitorFilesystem:
33+
:path: "../../node_modules/@capacitor/filesystem"
2934
CapacitorHaptics:
3035
:path: "../../node_modules/@capacitor/haptics"
3136
CapacitorKeyboard:
@@ -37,10 +42,11 @@ SPEC CHECKSUMS:
3742
Capacitor: 1f3c7b9802d958cd8c4eb63895fff85dff2e1eea
3843
CapacitorApp: 2a8c3a0b0814322e5e6e15fe595f02c3808f0f8b
3944
CapacitorCordova: b33e7f4aa4ed105dd43283acdd940964374a87d9
45+
CapacitorFilesystem: c832a3f6d4870c3872688e782ae8e33665e6ecbf
4046
CapacitorHaptics: b53409aaca1203f79c6d0eb3ed5de40556339518
4147
CapacitorKeyboard: 460c6f9ec5e52c84f2742d5ce2e67bbc7ab0ebb0
4248
CapacitorStatusBar: 3b9ac7d0684770522c532d1158a1434512ab1477
4349

44-
PODFILE CHECKSUM: 481b90c01cf7ba51cc0b3b166926c5af446138fd
50+
PODFILE CHECKSUM: 869cd103f385a70cbeb8df696af596588385ac91
4551

46-
COCOAPODS: 1.15.2
52+
COCOAPODS: 1.12.1

frontend/ios/App/fastlane/Appfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
app_identifier("com.moduscreate.appmedaigen")
2+
apple_id("[email protected]")
3+
team_id("287TS9B2H2")

0 commit comments

Comments
 (0)