Skip to content

Commit 5eecbaa

Browse files
committed
Merge branch 'dev' into MW-260-add-basic-upi-payment-support
1 parent da2c95b commit 5eecbaa

File tree

40 files changed

+611
-150
lines changed

40 files changed

+611
-150
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: macOS Build & Distribute (TestFlight / App Store)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
distribution:
7+
description: Where to distribute this build
8+
type: choice
9+
required: true
10+
options: [testflight, appstore]
11+
default: testflight
12+
13+
jobs:
14+
build_and_ship:
15+
name: Build & Ship to → ${{ inputs.distribution }}
16+
runs-on: macos-latest
17+
18+
env:
19+
KEYCHAIN_NAME: signing-${{ github.run_id }}.keychain-db
20+
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
21+
APP_IDENTIFIER: org.mifospay
22+
APPSTORE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
23+
APPSTORE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@v4
28+
29+
- name: ☕ Set up Java 21 (Temurin)
30+
uses: actions/setup-java@v4
31+
with:
32+
distribution: temurin
33+
java-version: "21"
34+
35+
- name: Set up Ruby & bundle
36+
uses: ruby/setup-ruby@v1
37+
with:
38+
bundler-cache: true
39+
40+
- name: Install Fastlane dependencies
41+
shell: bash
42+
run: |
43+
gem install bundler
44+
bundler install --jobs 4 --retry 3
45+
46+
- name: Create & unlock temporary keychain
47+
run: |
48+
security create-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
49+
security set-keychain-settings -lut 21600 "${KEYCHAIN_NAME}"
50+
security unlock-keychain -p "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
51+
security list-keychains -d user -s "${KEYCHAIN_NAME}" $(security list-keychains -d user | sed 's/[ "]//g')
52+
53+
- name: Import Mac App Distribution certificate
54+
env:
55+
MAC_APP_DISTRIBUTION_CERTIFICATE_B64: ${{ secrets.MAC_APP_DISTRIBUTION_CERTIFICATE_B64 }}
56+
CERTIFICATES_PASSWORD: ${{ secrets.CERTIFICATES_PASSWORD }}
57+
run: |
58+
CERT="${RUNNER_TEMP}/mac_app_distribution.p12"
59+
printf '%s' "$MAC_APP_DISTRIBUTION_CERTIFICATE_B64" | base64 -D > "$CERT"
60+
security import "$CERT" -P "$CERTIFICATES_PASSWORD" -A -t cert -f pkcs12 -k "${KEYCHAIN_NAME}"
61+
security set-key-partition-list -S apple-tool:,apple: -k "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
62+
echo "APP_CERTIFICATE_PATH=$CERT" >> "$GITHUB_ENV"
63+
64+
- name: Import Mac Installer Distribution certificate
65+
env:
66+
MAC_INSTALLER_DISTRIBUTION_CERTIFICATE_B64: ${{ secrets.MAC_INSTALLER_DISTRIBUTION_CERTIFICATE_B64 }}
67+
CERTIFICATES_PASSWORD: ${{ secrets.CERTIFICATES_PASSWORD }}
68+
run: |
69+
CERT="${RUNNER_TEMP}/mac_installer_distribution.p12"
70+
printf '%s' "$MAC_INSTALLER_DISTRIBUTION_CERTIFICATE_B64" | base64 -D > "$CERT"
71+
security import "$CERT" -P "$CERTIFICATES_PASSWORD" -A -t cert -f pkcs12 -k "${KEYCHAIN_NAME}"
72+
security set-key-partition-list -S apple-tool:,apple: -k "${KEYCHAIN_PASSWORD}" "${KEYCHAIN_NAME}"
73+
echo "INSTALLER_CERTIFICATE_PATH=$CERT" >> "$GITHUB_ENV"
74+
75+
- name: Write Embedded provisioning profile
76+
env:
77+
MAC_EMBEDDED_PROVISION_B64: ${{ secrets.MAC_EMBEDDED_PROVISION_B64 }}
78+
run: |
79+
mkdir -p cmp-desktop
80+
echo "$MAC_EMBEDDED_PROVISION_B64" > cmp-desktop/embedded.provisionprofile.b64
81+
base64 -d -i cmp-desktop/embedded.provisionprofile.b64 > cmp-desktop/embedded.provisionprofile
82+
83+
- name: Write Runtime provisioning profile
84+
env:
85+
MAC_RUNTIME_PROVISION_B64: ${{ secrets.MAC_RUNTIME_PROVISION_B64 }}
86+
run: |
87+
echo "$MAC_RUNTIME_PROVISION_B64" > cmp-desktop/runtime.provisionprofile.b64
88+
base64 -d -i cmp-desktop/runtime.provisionprofile.b64 > cmp-desktop/runtime.provisionprofile
89+
90+
- name: Write App Store Connect API key (.p8)
91+
env:
92+
APPSTORE_CONNECT_API_KEY_B64: ${{ secrets.APPSTORE_AUTH_KEY }}
93+
run: |
94+
mkdir -p secrets
95+
echo "$APPSTORE_CONNECT_API_KEY_B64" | base64 --decode > secrets/Auth_key.p8
96+
97+
- name: Upload to TestFlight
98+
if: ${{ inputs.distribution == 'testflight' }}
99+
run: |
100+
bundle exec fastlane mac desktop_testflight \
101+
app_identifier:"$APP_IDENTIFIER" \
102+
appstore_key_id:"$APPSTORE_KEY_ID" \
103+
appstore_issuer_id:"$APPSTORE_ISSUER_ID" \
104+
key_file_path:secrets/Auth_key.p8
105+
106+
- name: Submit to App Store (Production)
107+
if: ${{ inputs.distribution == 'appstore' }}
108+
run: |
109+
bundle exec fastlane mac desktop_release \
110+
app_identifier:"$APP_IDENTIFIER" \
111+
appstore_key_id:"$APPSTORE_KEY_ID" \
112+
appstore_issuer_id:"$APPSTORE_ISSUER_ID" \
113+
key_file_path:secrets/Auth_key.p8

.github/workflows/pr-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,4 @@ jobs:
9191
build_ios: true
9292
use_cocoapods: true
9393
shared_module: ':cmp-shared'
94+
java-version: '21'

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ secrets/
7676

7777
# Sync Log File
7878
*.log
79+
80+
*.provisionprofile

build-logic/convention/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ group = "org.mifospay.buildlogic"
99
// Configure the build-logic plugins to target JDK 19
1010
// This matches the JDK used to build the project, and is not related to what is running on device.
1111
java {
12-
sourceCompatibility = JavaVersion.VERSION_17
13-
targetCompatibility = JavaVersion.VERSION_17
12+
sourceCompatibility = JavaVersion.VERSION_21
13+
targetCompatibility = JavaVersion.VERSION_21
1414
}
1515

1616
kotlin {

build-logic/convention/src/main/kotlin/org/mifospay/KotlinAndroid.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ internal fun Project.configureKotlinAndroid(
2828
compileOptions {
2929
// Up to Java 11 APIs are available through desugaring
3030
// https://developer.android.com/studio/write/java11-minimal-support-table
31-
sourceCompatibility = JavaVersion.VERSION_17
32-
targetCompatibility = JavaVersion.VERSION_17
31+
sourceCompatibility = JavaVersion.VERSION_21
32+
targetCompatibility = JavaVersion.VERSION_21
3333
isCoreLibraryDesugaringEnabled = true
3434
}
3535
}
@@ -48,8 +48,8 @@ internal fun Project.configureKotlinJvm() {
4848
extensions.configure<JavaPluginExtension> {
4949
// Up to Java 11 APIs are available through desugaring
5050
// https://developer.android.com/studio/write/java11-minimal-support-table
51-
sourceCompatibility = JavaVersion.VERSION_17
52-
targetCompatibility = JavaVersion.VERSION_17
51+
sourceCompatibility = JavaVersion.VERSION_21
52+
targetCompatibility = JavaVersion.VERSION_21
5353
}
5454

5555
configureKotlin()
@@ -63,7 +63,7 @@ private fun Project.configureKotlin() {
6363
tasks.withType<KotlinCompile>().configureEach {
6464
compilerOptions {
6565
// Set JVM target to 17
66-
jvmTarget = JvmTarget.JVM_17
66+
jvmTarget = JvmTarget.JVM_21
6767
// Treat all Kotlin warnings as errors (disabled by default)
6868
// Override by setting warningsAsErrors=true in your ~/.gradle/gradle.properties
6969
val warningsAsErrors: String? by project

0 commit comments

Comments
 (0)