Skip to content

Commit 278e1aa

Browse files
committed
Merge branch 'refs/heads/dev' into MW-260-add-basic-upi-payment-support
2 parents b1d9104 + 4d200dc commit 278e1aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+483
-45
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
match_type: 'adhoc'
117117
provisioning_profile_name: 'match AdHoc org.mifospay'
118118
firebase_app_id: '1:728434912738:ios:86a7badfaed88b841a1dbb'
119-
metadata_path: './fastlane/metadata'
119+
metadata_path: './fastlane/metadata/ios'
120120
use_cocoapods: true # <-- Set to true if using CocoaPods integration for KMP
121121
shared_module: ':cmp-shared' # <-- Gradle path to your shared KMP module (e.g., :shared)
122122
distribute_ios_firebase: ${{ inputs.distribute_ios_firebase }}

.github/workflows/sync-dirs.yaml

Lines changed: 271 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,271 @@
1+
name: Sync CMP Directories
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
upstream:
6+
description: 'Upstream repository to sync directories from'
7+
default: 'https://github.com/openMF/kmp-project-template.git'
8+
required: true
9+
type: string
10+
schedule:
11+
- cron: '0 0 * * 1'
12+
13+
jobs:
14+
sync-directories:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
ref: dev
26+
27+
- name: Setup Git config
28+
run: |
29+
git config --global user.name "github-actions[bot]"
30+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+
32+
- name: Add upstream remote and fetch
33+
run: |
34+
git remote add upstream ${{ inputs.upstream }} || true
35+
git fetch upstream || exit 1
36+
37+
- name: Check upstream/dev exists
38+
run: |
39+
if ! git rev-parse --verify upstream/dev >/dev/null 2>&1; then
40+
echo "Error: upstream/dev branch does not exist"
41+
exit 1
42+
fi
43+
44+
- name: Create and checkout temporary branch
45+
run: |
46+
TEMP_BRANCH="temp-sync-branch-${{ github.run_number }}"
47+
git checkout -b "$TEMP_BRANCH" upstream/dev || exit 1
48+
echo "TEMP_BRANCH=$TEMP_BRANCH" >> $GITHUB_ENV
49+
50+
- name: Sync directories and files
51+
run: |
52+
# Declare directories and files to sync
53+
DIRS=(
54+
"cmp-android"
55+
"cmp-desktop"
56+
"cmp-ios"
57+
"cmp-web"
58+
"cmp-shared"
59+
"core-base"
60+
"build-logic"
61+
"fastlane"
62+
"scripts"
63+
"config"
64+
".github"
65+
".run"
66+
)
67+
68+
FILES=(
69+
"Gemfile"
70+
"Gemfile.lock"
71+
"ci-prepush.bat"
72+
"ci-prepush.sh"
73+
)
74+
75+
# Define exclusions
76+
declare -A EXCLUSIONS=(
77+
["cmp-android"]="src/main/res dependencies src/main/ic_launcher-playstore.png google-services.json"
78+
["cmp-web"]="src/jsMain/resources src/wasmJsMain/resources"
79+
["cmp-desktop"]="icons"
80+
["cmp-ios"]="iosApp/Assets.xcassets"
81+
["root"]="secrets.env"
82+
)
83+
84+
# Function to check if path should be excluded
85+
should_exclude() {
86+
local dir=$1
87+
local path=$2
88+
89+
# Check for root exclusions
90+
if [[ "$dir" == "." && -n "${EXCLUSIONS["root"]}" ]]; then
91+
local root_excluded_paths=(${EXCLUSIONS["root"]})
92+
for excluded in "${root_excluded_paths[@]}"; do
93+
if [[ "$path" == *"$excluded"* ]]; then
94+
return 0
95+
fi
96+
done
97+
fi
98+
99+
# Check directory-specific exclusions
100+
if [[ -n "${EXCLUSIONS[$dir]}" ]]; then
101+
local excluded_paths=(${EXCLUSIONS[$dir]})
102+
for excluded in "${excluded_paths[@]}"; do
103+
if [[ "$path" == *"$excluded"* ]]; then
104+
return 0
105+
fi
106+
done
107+
fi
108+
return 1
109+
}
110+
111+
# Function to preserve excluded paths
112+
preserve_excluded() {
113+
local dir=$1
114+
if [[ -n "${EXCLUSIONS[$dir]}" ]]; then
115+
local excluded_paths=(${EXCLUSIONS[$dir]})
116+
for excluded in "${excluded_paths[@]}"; do
117+
local full_path="$dir/$excluded"
118+
if [[ -e "$full_path" ]]; then
119+
echo "Preserving excluded path: $full_path"
120+
local temp_path="temp_excluded/$full_path"
121+
mkdir -p "$(dirname "$temp_path")"
122+
cp -r "$full_path" "$(dirname "$temp_path")"
123+
fi
124+
done
125+
fi
126+
}
127+
128+
# Function to restore excluded paths
129+
restore_excluded() {
130+
local dir=$1
131+
if [[ -n "${EXCLUSIONS[$dir]}" ]]; then
132+
local excluded_paths=(${EXCLUSIONS[$dir]})
133+
for excluded in "${excluded_paths[@]}"; do
134+
local full_path="$dir/$excluded"
135+
local temp_path="temp_excluded/$full_path"
136+
if [[ -e "$temp_path" ]]; then
137+
echo "Restoring excluded path: $full_path"
138+
mkdir -p "$(dirname "$full_path")"
139+
rm -rf "$full_path"
140+
cp -r "$temp_path" "$(dirname "$full_path")"
141+
fi
142+
done
143+
fi
144+
}
145+
146+
# Function to preserve root-level excluded files
147+
preserve_root_files() {
148+
if [[ -n "${EXCLUSIONS["root"]}" ]]; then
149+
local excluded_paths=(${EXCLUSIONS["root"]})
150+
for excluded in "${excluded_paths[@]}"; do
151+
if [[ -e "$excluded" ]]; then
152+
echo "Preserving root-level excluded file: $excluded"
153+
mkdir -p "temp_excluded/root"
154+
cp -r "$excluded" "temp_excluded/root/"
155+
fi
156+
done
157+
fi
158+
}
159+
160+
# Function to restore root-level excluded files
161+
restore_root_files() {
162+
if [[ -n "${EXCLUSIONS["root"]}" ]]; then
163+
local excluded_paths=(${EXCLUSIONS["root"]})
164+
for excluded in "${excluded_paths[@]}"; do
165+
if [[ -e "temp_excluded/root/$excluded" ]]; then
166+
echo "Restoring root-level excluded file: $excluded"
167+
cp -r "temp_excluded/root/$excluded" "./"
168+
fi
169+
done
170+
fi
171+
}
172+
173+
# Create temp directory for exclusions
174+
mkdir -p temp_excluded
175+
176+
# Preserve root-level exclusions before sync
177+
preserve_root_files
178+
179+
# Switch to dev branch
180+
git checkout dev
181+
182+
# Sync directories
183+
for dir in "${DIRS[@]}"; do
184+
if [ ! -d "$dir" ]; then
185+
echo "Creating $dir..."
186+
mkdir -p "$dir"
187+
fi
188+
189+
# Preserve excluded paths before sync
190+
if [[ -d "$dir" ]]; then
191+
preserve_excluded "$dir"
192+
fi
193+
194+
echo "Syncing $dir..."
195+
git checkout "${{ env.TEMP_BRANCH }}" -- "$dir" || exit 1
196+
197+
# Restore excluded paths after sync
198+
restore_excluded "$dir"
199+
done
200+
201+
# Sync files
202+
for file in "${FILES[@]}"; do
203+
dir=$(dirname "$file")
204+
if ! should_exclude "$dir" "$file"; then
205+
echo "Syncing $file..."
206+
git checkout "${{ env.TEMP_BRANCH }}" -- "$file" || true
207+
else
208+
echo "Skipping excluded file: $file"
209+
fi
210+
done
211+
212+
# Restore root-level excluded files
213+
restore_root_files
214+
215+
# Cleanup temp directory
216+
rm -rf temp_excluded
217+
218+
- name: Clean up temporary branch
219+
if: always()
220+
run: git branch -D "${{ env.TEMP_BRANCH }}" || true
221+
222+
- name: Check for changes
223+
id: check_changes
224+
run: |
225+
if [[ -n "$(git status --porcelain)" ]]; then
226+
echo "has_changes=true" >> $GITHUB_OUTPUT
227+
else
228+
echo "has_changes=false" >> $GITHUB_OUTPUT
229+
fi
230+
231+
- name: Create Pull Request
232+
if: steps.check_changes.outputs.has_changes == 'true'
233+
uses: peter-evans/create-pull-request@v7
234+
with:
235+
token: ${{ secrets.PAT_TOKEN }}
236+
commit-message: "chore: Sync directories and files from upstream"
237+
title: "chore: Sync directories and files from upstream"
238+
body: |
239+
Automated sync of directories and files from upstream repository.
240+
241+
Changes included in this sync:
242+
243+
Directories:
244+
- cmp-android (excluding src/main/res, dependencies, ic_launcher-playstore.png, google-services.json)
245+
- cmp-desktop (excluding icons)
246+
- cmp-ios (excluding iosApp/Assets.xcassets)
247+
- cmp-web (excluding src/jsMain/resources, src/wasmJsMain/resources)
248+
- cmp-shared
249+
- build-logic
250+
- fastlane
251+
- scripts
252+
- config
253+
- .github
254+
- .run
255+
256+
Files:
257+
- Gemfile
258+
- Gemfile.lock
259+
- ci-prepush.bat
260+
- ci-prepush.sh
261+
262+
Root-level exclusions:
263+
- secrets.env
264+
265+
Workflow run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
266+
branch: sync-dirs-${{ github.run_number }}
267+
delete-branch: true
268+
labels: |
269+
sync
270+
automated pr
271+
base: dev

cmp-ios/iosApp.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -353,8 +353,8 @@
353353
baseConfigurationReference = E5D357E5C5AAADD27F979C77 /* Pods-iosApp.debug.xcconfig */;
354354
buildSettings = {
355355
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
356-
CODE_SIGN_IDENTITY = "Apple Distribution";
357-
CODE_SIGN_STYLE = Manual;
356+
CODE_SIGN_IDENTITY = "Apple Development";
357+
CODE_SIGN_STYLE = Automatic;
358358
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
359359
DEVELOPMENT_TEAM = L432S2FZP5;
360360
ENABLE_PREVIEWS = YES;
@@ -373,7 +373,7 @@
373373
MARKETING_VERSION = 1.0.0;
374374
PRODUCT_BUNDLE_IDENTIFIER = org.mifospay;
375375
PRODUCT_NAME = "${APP_NAME}";
376-
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc org.mifospay";
376+
PROVISIONING_PROFILE_SPECIFIER = "";
377377
SWIFT_VERSION = 5.0;
378378
TARGETED_DEVICE_FAMILY = "1,2";
379379
};
@@ -384,8 +384,8 @@
384384
baseConfigurationReference = 471D4B8AF5995E32718DCCCD /* Pods-iosApp.release.xcconfig */;
385385
buildSettings = {
386386
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
387-
CODE_SIGN_IDENTITY = "Apple Distribution";
388-
CODE_SIGN_STYLE = Manual;
387+
CODE_SIGN_IDENTITY = "Apple Development";
388+
CODE_SIGN_STYLE = Automatic;
389389
DEVELOPMENT_ASSET_PATHS = "\"iosApp/Preview Content\"";
390390
DEVELOPMENT_TEAM = L432S2FZP5;
391391
ENABLE_PREVIEWS = YES;
@@ -404,7 +404,7 @@
404404
MARKETING_VERSION = 1.0.0;
405405
PRODUCT_BUNDLE_IDENTIFIER = org.mifospay;
406406
PRODUCT_NAME = "${APP_NAME}";
407-
PROVISIONING_PROFILE_SPECIFIER = "match AdHoc org.mifospay";
407+
PROVISIONING_PROFILE_SPECIFIER = "";
408408
SWIFT_VERSION = 5.0;
409409
TARGETED_DEVICE_FAMILY = "1,2";
410410
};

cmp-ios/iosApp/Info.plist

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@
1717
<key>CFBundlePackageType</key>
1818
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>1.0</string>
20+
<string>1.0.0</string>
2121
<key>CFBundleVersion</key>
22-
<string>6</string>
22+
<string>8</string>
23+
<key>ITSAppUsesNonExemptEncryption</key>
24+
<false/>
2325
<key>LSRequiresIPhoneOS</key>
2426
<true/>
27+
<key>NSCameraUsageDescription</key>
28+
<string>We use the camera to scan QR codes to send and receive payments.</string>
2529
<key>NSPhotoLibraryAddUsageDescription</key>
2630
<string>Allow access to add photos to your library so you can save artworks directly to your device and view them offline.</string>
2731
<key>UIApplicationSceneManifest</key>

fastlane-config/ios_config.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@ module IosConfig
77
}
88

99
BUILD_CONFIG = {
10-
project_path: "cmp-ios/iosApp.xcodeproj",
11-
workspace_path: "cmp-ios/iosApp.xcworkspace",
12-
configuration: "Release",
13-
podfile_path: "cmp-ios/Podfile",
14-
plist_path: "cmp-ios/iosApp/Info.plist",
15-
scheme: "cmp-ios",
16-
output_name: "iosApp.ipa",
17-
output_directory: "cmp-ios/build",
18-
match_git_private_key: "./secrets/match_ci_key",
19-
target: "iosApp",
20-
team_id: "L432S2FZP5",
21-
code_sign_identity: "Apple Distribution",
22-
configuration: "Release",
23-
match_type: "adhoc",
24-
app_identifier: "org.mifospay",
25-
provisioning_profile_name: "match AdHoc org.mifospay",
26-
git_url: "[email protected]:openMF/ios-provisioning-profile.git",
27-
git_branch: "mifospay",
28-
key_id: "7V3ABCDEFG",
29-
issuer_id: "7ab9e231-9603-4c3e-a147-be3b0f123456",
30-
key_filepath: "./secrets/Auth_key.p8",
31-
version_number: "1.0",
32-
metadata_path: "./fastlane/metadata",
33-
app_rating_config_path: "./fastlane/age_rating.json"
34-
}
10+
project_path: "cmp-ios/iosApp.xcodeproj",
11+
workspace_path: "cmp-ios/iosApp.xcworkspace",
12+
configuration: "Release",
13+
podfile_path: "cmp-ios/Podfile",
14+
plist_path: "cmp-ios/iosApp/Info.plist",
15+
scheme: "cmp-ios",
16+
output_name: "iosApp.ipa",
17+
output_directory: "cmp-ios/build",
18+
match_git_private_key: "./secrets/match_ci_key",
19+
target: "iosApp",
20+
team_id: "L432S2FZP5",
21+
code_sign_identity: "Apple Distribution",
22+
configuration: "Release",
23+
match_type: "adhoc",
24+
app_identifier: "org.mifospay",
25+
provisioning_profile_name: "match AdHoc org.mifospay",
26+
git_url: "[email protected]:openMF/ios-provisioning-profile.git",
27+
git_branch: "mifospay",
28+
key_id: "7V3ABCDEFG",
29+
issuer_id: "7ab9e231-9603-4c3e-a147-be3b0f123456",
30+
key_filepath: "./secrets/Auth_key.p8",
31+
version_number: "1.0.0",
32+
metadata_path: "./fastlane/metadata/ios",
33+
app_rating_config_path: "./fastlane/age_rating.json"
34+
}
3535
end
3636
end

0 commit comments

Comments
 (0)