Skip to content

Commit 8350259

Browse files
committed
Build iOS
1 parent 33b146e commit 8350259

File tree

4 files changed

+38
-227
lines changed

4 files changed

+38
-227
lines changed

.github/actions/build-ios/action.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@ runs:
1818
uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e #v4
1919
with:
2020
node-version-file: .nvmrc
21+
22+
- name: Install CocoaPods dependencies
23+
run: pod install --project-directory=ios
24+
shell: bash
2125

22-
- name: Run Fastlane
26+
- name: Build iOS Debug App
2327
run: cd ios && fastlane ios debug_internal
24-
shell: bash
28+
shell: bash
29+

.github/workflows/MiNe2e.yaml

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -106,26 +106,18 @@ jobs:
106106
# with:
107107
# google_services_json: ${{ secrets.GOOGLE_SERVICES_JSON }}
108108

109-
# ios-app:
110-
# runs-on: macOS-13
111-
# steps:
112-
# - name: "Check out code"
113-
# uses: actions/checkout@v4
114-
# - name: Build ios app
115-
# uses: ./.github/actions/build-ios
116-
# env:
117-
# MATCH_GIT_BASIC_AUTHORIZATION: ${{ secrets.MATCH_GIT_BASIC_AUTHORIZATION }}
118-
# MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
119-
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
120-
# GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }}
121-
# APP_STORE_CONNECT_KEY_ID: ${{ secrets.APP_STORE_CONNECT_KEY_ID }}
122-
# APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
123-
# APP_STORE_CONNECT_KEY_CONTENT: ${{ secrets.APP_STORE_CONNECT_KEY_CONTENT }}
124-
# - name: "Upload iOS App"
125-
# uses: actions/upload-artifact@v4
126-
# with:
127-
# name: ios-app
128-
# path: ios/build/Release-iphoneos/*.ipa
109+
ios-app:
110+
runs-on: macOS-15
111+
steps:
112+
- name: "Check out code"
113+
uses: actions/checkout@v4
114+
- name: Build ios app
115+
uses: ./.github/actions/build-ios
116+
- name: "Upload iOS App"
117+
uses: actions/upload-artifact@v4
118+
with:
119+
name: ios-app
120+
path: ios/build/DeveloperApp-Debug.ipa
129121

130122
android-test:
131123
needs: [mendix-version, project]
@@ -219,18 +211,21 @@ jobs:
219211
bash maestro/run_maestro_tests.sh android
220212
221213
- name: "Debug screenshot generation"
214+
if: always()
222215
continue-on-error: true
223216
run: |
224217
echo "Checking contents of maestro/tests/images/actual/android/ after test execution:"
225218
ls -R ${{ github.workspace }}/maestro/tests/images/actual/android/
226219
227220
- name: "Debug root folder"
221+
if: always()
228222
continue-on-error: true
229223
run: |
230224
echo "Checking contents of the root folder:"
231225
ls -R ${{ github.workspace }}
232226
233227
- name: "Debug screenshot directory"
228+
if: always()
234229
continue-on-error: true
235230
run: |
236231
echo "Checking contents of maestro/tests/images/actual/android/"

ios/fastlane/Fastfile

Lines changed: 12 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -1,212 +1,21 @@
1-
# If you want to automatically update fastlane if a new version is available:
2-
#update_fastlane
3-
4-
# This is the minimum version number required.
5-
# Update this, if you use features of a newer version
6-
fastlane_version "2.213.0"
7-
8-
default_platform :ios
9-
10-
# Constants
11-
APPLE_STORE_VERSION = sh("node -p -e \"require('../../package.json')['store-versions']['apple-store']\"").chomp
12-
BUILD_NUMBER = 1
13-
ORIGINAL_CHANGELOG_PATH = "../../CHANGELOG.ios.txt"
14-
FASTLANE_CHANGELOG_PATH = "./metadata/default/release_notes.txt"
15-
161
platform :ios do
17-
lane :install_dev_certificate do
18-
# Improve DX. We cannot use an empty password, so we use the public password.
19-
ENV["MATCH_PASSWORD"] = "AppleDeveloper1!"
20-
match(
21-
type: "development",
22-
git_branch: "appdev",
23-
profile_name: "Make It Native 9 Dev (Match)",
24-
readonly: true,
25-
)
26-
end
27-
28-
desc "Build an internal version for automation"
29-
desc "It always uses v.0.0.0 and build number 0 by design"
30-
lane :internal do
31-
sh("npm", "ci", "--legacy-peer-deps")
32-
cocoapods
33-
increment_version_number(
34-
version_number: "0.0.0",
35-
)
36-
gym(scheme: "DeveloperApp", configuration: "ReleaseDevToolsEnabled", export_method: "development", build_path: "./builds/internal/intermediate", output_directory: "./builds/internal/output")
37-
end
38-
39-
desc "Builds and installs DeveloperApp into the simulator for debugging"
40-
lane :debug_internal do
2+
before_all do
413
UI.message("Installing dependencies")
424
sh("npm", "ci", "--legacy-peer-deps") # Install npm dependencies
435
cocoapods # Install CocoaPods dependencies
44-
45-
UI.message("Building DeveloperApp for Debug")
46-
gym(
47-
scheme: "DeveloperApp", # Replace with your app's scheme name
48-
configuration: "Debug", # Use Debug configuration
49-
skip_package_ipa: true, # Skip creating an .ipa file
50-
skip_package_pkg: true, # Skip creating a .pkg file
51-
sdk: "iphonesimulator", # Build for the iOS Simulator
52-
destination: "platform=iOS Simulator,name=iPhone 13 Pro,OS=15.5", # Target simulator
53-
xcargs: "ONLY_ACTIVE_ARCH=NO", # Ensure compatibility with all architectures
54-
)
55-
end
56-
57-
desc "Submit a new Beta Build to Apple TestFlight"
58-
desc "This will also make sure the profile is up to date"
59-
lane :beta do |options|
60-
keychain_name = "min_10_ios"
61-
sh("npm", "ci", "--legacy-peer-deps")
62-
cocoapods
63-
64-
UI.message("Connect API key")
65-
app_store_connect_api_key(
66-
is_key_content_base64: true,
67-
)
68-
69-
create_keychain(
70-
name: keychain_name,
71-
unlock: true,
72-
timeout: 0,
73-
default_keychain: true,
74-
)
75-
76-
UI.message("Retrieve iOS certificate and profile")
77-
match(
78-
type: "appstore",
79-
keychain_name: keychain_name,
80-
keychain_password: ENV["KEYCHAIN_PASSWORD"],
81-
profile_name: "match AppStore com.mendix.developerapp.native.mx10",
82-
readonly: true,
83-
)
84-
85-
UI.message("Set version number")
86-
increment_version_number(
87-
version_number: APPLE_STORE_VERSION,
88-
)
89-
90-
UI.message("Set build number")
91-
increment_build_number(
92-
build_number: app_store_build_number(live: false, version: APPLE_STORE_VERSION, initial_build_number: 0) + 1,
93-
)
94-
95-
unlock_keychain( # Unlock an existing keychain and add it to the keychain search list
96-
path: keychain_name,
97-
password: ENV["KEYCHAIN_PASSWORD"],
98-
)
99-
100-
update_project_provisioning(
101-
xcodeproj: "developerapp.xcodeproj",
102-
code_signing_identity: "Apple Distribution",
103-
profile: ENV["sigh_com.mendix.developerapp.native.mx10_appstore_profile-path"],
104-
build_configuration: "Release",
105-
target_filter: "DeveloperApp",
106-
)
107-
108-
UI.message("Replacing Google Maps API key from environment variables")
109-
Dir.chdir("../DeveloperApp/Config") do
110-
googleMapsApiKey = ENV["GOOGLE_MAPS_API_KEY"] || "GOOGLE_MAPS_API_KEY"
111-
sh("sed -i '' 's/{{google-maps-api-key}}/#{googleMapsApiKey}/g' ApiKeys.xcconfig")
112-
end
113-
114-
UI.message("Build iOS app")
115-
gym(
116-
scheme: "DeveloperApp",
117-
export_method: "app-store",
118-
configuration: "Release",
119-
output_directory: "./build/beta/output",
120-
)
121-
122-
if options[:submit] == true
123-
UI.message("Send iOS app to TestFlight")
124-
pilot(
125-
groups: ["Internal Testers"],
126-
skip_submission: true,
127-
skip_waiting_for_build_processing: true,
128-
distribute_external: false
129-
)
130-
end
131-
132-
UI.message("Copy artifacts")
133-
copy_artifacts(
134-
target_path: "../artifacts",
135-
artifacts: ["./build/beta/output/DeveloperApp.ipa",
136-
"./build/beta/output/DeveloperApp.app.dSYM.zip"],
137-
)
1386
end
1397

140-
lane :beta_manually do
141-
sh("npm", "ci", "--legacy-peer-deps")
142-
cocoapods
143-
144-
UI.message("Retrieve iOS certificate and profile")
145-
match(
146-
type: "appstore",
147-
profile_name: "match AppStore com.mendix.developerapp.native.mx10",
148-
readonly: true,
149-
)
150-
151-
UI.message("Set version number")
152-
increment_version_number(
153-
version_number: APPLE_STORE_VERSION,
154-
)
155-
156-
UI.message("Set build number")
157-
increment_build_number(
158-
build_number: app_store_build_number(live: false, version: APPLE_STORE_VERSION, initial_build_number: 0) + 1,
159-
)
160-
161-
UI.message("Build iOS app")
8+
desc "Builds DeveloperApp for Debug and generates an .ipa file"
9+
lane :debug_internal do
10+
UI.message("Building DeveloperApp for Debug and generating .ipa")
16211
gym(
163-
scheme: "DeveloperApp",
164-
export_method: "app-store",
165-
configuration: "Release",
166-
output_directory: "./build/beta/output",
167-
)
168-
169-
UI.message("Send iOS app to TestFlight")
170-
pilot(
171-
skip_submission: true,
172-
skip_waiting_for_build_processing: true,
173-
)
174-
175-
UI.message("Copy artifacts")
176-
copy_artifacts(
177-
target_path: "../artifacts",
178-
artifacts: ["./build/beta/output/DeveloperApp.ipa",
179-
"./build/beta/output/DeveloperApp.app.dSYM.zip"],
180-
)
181-
end
182-
183-
desc "Send appstore version to review"
184-
lane :promote_to_production do |options|
185-
if !options[:build_number]
186-
UI.user_error!("build_number is required to release app")
187-
end
188-
189-
FileUtils.copy(ORIGINAL_CHANGELOG_PATH, FASTLANE_CHANGELOG_PATH)
190-
191-
UI.message("Connect API key")
192-
app_store_connect_api_key(
193-
is_key_content_base64: true,
194-
)
195-
196-
deliver(
197-
app_version: APPLE_STORE_VERSION,
198-
build_number: options[:build_number],
199-
submit_for_review: true,
200-
automatic_release: true,
201-
force: true,
202-
skip_metadata: false,
203-
skip_screenshots: true,
204-
skip_binary_upload: true,
205-
precheck_include_in_app_purchases: false,
206-
submission_information: {
207-
add_id_info_uses_idfa: false,
208-
export_compliance_uses_encryption: false,
209-
},
12+
scheme: "DeveloperApp", # Replace with your app's scheme name
13+
configuration: "Debug", # Use Debug configuration
14+
output_directory: "./build", # Directory where the .ipa will be saved
15+
output_name: "DeveloperApp-Debug.ipa", # Name of the .ipa file
16+
export_method: "development", # Use development export method for debug builds
17+
include_bitcode: false, # Optional: Exclude bitcode for faster builds
18+
include_symbols: true, # Include debug symbols for debugging
21019
)
21120
end
212-
end
21+
end

maestro/tests/AppStartup.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@ appId: "${APP_ID}"
1616
- tapOn: "Start"
1717
- assertVisible: "Clear cache"
1818
- takeScreenshot:
19-
path: "tests/images/actual/${PLATFORM}/MiN_page"
19+
path: "maestro/tests/images/actual/${PLATFORM}/MiN_page"
2020
- tapOn: "http://runtime-url:8080"
2121
- inputText: "http://localhost:8080"
2222
- pressKey: Enter
2323
- tapOn: "Launch app"
24+
- takeScreenshot:
25+
path: "maestro/tests/images/actual/${PLATFORM}/app-loading"
2426
- extendedWaitUntil:
2527
visible: "Widgets menu"
2628
timeout: 300000
2729
- takeScreenshot:
28-
path: "tests/images/actual/${PLATFORM}/app-loaded"
30+
path: "maestro/tests/images/actual/${PLATFORM}/app-loaded"

0 commit comments

Comments
 (0)