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+
}
102 KB
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>

0 commit comments

Comments
 (0)