Skip to content

Commit

Permalink
mobile: add new preview profile for building apps with separate bundl…
Browse files Browse the repository at this point in the history
…e ID (#3257)

* set up ios preview build

* disable notification prompt

* add android preview app icon

* fix eas cli config

* add applicationId to eas config
  • Loading branch information
alecananian authored Feb 20, 2024
1 parent e1b9bf1 commit 008e91c
Show file tree
Hide file tree
Showing 55 changed files with 812 additions and 115 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
name: Build Tlon Mobile [Production]
name: Build Tlon Mobile
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: Select profile
options:
- preview
- production
platform:
type: choice
description: Select platform
Expand All @@ -15,7 +21,7 @@ env:
jobs:
deploy:
runs-on: ubuntu-latest
name: Create new build
name: Create mobile builds
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -32,7 +38,7 @@ jobs:
run: npm ci
- name: Build for selected platforms
working-directory: ./apps/tlon-mobile
run: eas build --profile production --platform ${{ inputs.platform || 'all' }} --non-interactive --auto-submit
run: eas build --profile ${{ inputs.profile || 'preview' }} --platform ${{ inputs.platform || 'all' }} --non-interactive --auto-submit
env:
EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}
EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: Push Tlon Mobile Update [Production]
name: Push Tlon Mobile Update
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: Select profile
options:
- preview
- production
platform:
type: choice
description: Select platform
options:
- all
- android
- ios
env:
NOTIFY_PROVIDER: rivfur-livmet
NOTIFY_SERVICE: groups-native
jobs:
deploy:
runs-on: ubuntu-latest
name: Push update
name: Push mobile updates
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -22,6 +36,6 @@ jobs:
token: ${{ secrets.EXPO_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Push update for all platforms
- name: Push update for selected platforms
working-directory: ./apps/tlon-mobile
run: eas update --auto --platform all --channel production --non-interactive
run: eas update --auto --profile ${{ inputs.profile || 'preview' }} --platform ${{ inputs.platform || 'all' }} --non-interactive
28 changes: 18 additions & 10 deletions apps/tlon-mobile/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,13 @@ def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion

buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion

namespace "io.tlon.landscape"
defaultConfig {
applicationId "io.tlon.groups.staging"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 44
versionName "3.1.3"
compileSdk rootProject.ext.compileSdkVersion
versionCode 45
versionName "4.0.0"

buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
Expand Down Expand Up @@ -121,6 +118,17 @@ android {
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
}
}
flavorDimensions "profile"
productFlavors {
production {
dimension "profile"
applicationId "io.tlon.groups"
}
preview {
dimension "profile"
applicationId "io.tlon.groups.preview"
}
}
}

// Apply static values from `gradle.properties` to the `android.packagingOptions`
Expand Down Expand Up @@ -173,14 +181,14 @@ dependencies {
implementation jscFlavor
}

implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("androidx.security:security-crypto-ktx:1.1.0-alpha06")
implementation("com.android.volley:volley:1.2.1")

// Branch.io
implementation("io.branch.sdk.android:library:5.+")
implementation("com.google.android.gms:play-services-ads-identifier:17.1.0+")
implementation("androidx.browser:browser:1.0.0")
implementation("io.branch.sdk.android:library:5.9.0")
implementation("com.google.android.gms:play-services-ads-identifier:18.0.1")
implementation("androidx.browser:browser:1.7.0")
}

apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
Expand Down
55 changes: 47 additions & 8 deletions apps/tlon-mobile/android/app/google-services.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,65 @@
{
"project_info": {
"project_number": "157622845881",
"project_id": "tlon-mobile-staging",
"storage_bucket": "tlon-mobile-staging.appspot.com"
"project_number": "543296749236",
"project_id": "tlon-groups-mobile",
"storage_bucket": "tlon-groups-mobile.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:157622845881:android:e03c63bd5a3bc87cf27668",
"mobilesdk_app_id": "1:543296749236:android:3c51b56a1b8d31173e21e1",
"android_client_info": {
"package_name": "io.tlon.groups.staging"
"package_name": "io.tlon.groups"
}
},
"oauth_client": [],
"oauth_client": [
{
"client_id": "543296749236-1l5r4ipguvjdh083t5j7h1eicqi21j0o.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyDm8-5daeW5B8j6i_RIoSvOgnx6Fo0gEOU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "543296749236-1l5r4ipguvjdh083t5j7h1eicqi21j0o.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:543296749236:android:5f8dfa09efc9fbb93e21e1",
"android_client_info": {
"package_name": "io.tlon.groups.preview"
}
},
"oauth_client": [
{
"client_id": "543296749236-1l5r4ipguvjdh083t5j7h1eicqi21j0o.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAPPGSCuJstxYqZnbDCMNzGC6pM8cQHXm0"
"current_key": "AIzaSyDm8-5daeW5B8j6i_RIoSvOgnx6Fo0gEOU"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
"other_platform_oauth_client": [
{
"client_id": "543296749236-1l5r4ipguvjdh083t5j7h1eicqi21j0o.apps.googleusercontent.com",
"client_type": 3
}
]
}
}
}
Expand Down
31 changes: 14 additions & 17 deletions apps/tlon-mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,47 +19,44 @@
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
<meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://u.expo.dev/617bb643-5bf6-4c40-8af6-c6e9dd7e3bd0"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_hubypwhuxR6vkwKfdozyRoamErouusXi"/>
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_cBouaumqwI4DdzNbpcxyUhjatqiFwtG5"/>
<service android:name=".TalkMessagingService" android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:name=".notifications.TalkBroadcastReceiver" android:exported="false">
<intent-filter>
<action android:name="MARK_AS_READ" />
<action android:name="MARK_AS_READ"/>
</intent-filter>
</receiver>
<activity android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true" android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<!-- URI scheme -->
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="io.tlon.groups.staging"/>
<data android:scheme="io.tlon.groups"/>
</intent-filter>
<!-- Branch App Links - Live App -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="join.tlon.io" />
<data android:scheme="https" android:host="sa96e-alternate.app.link" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https" android:host="join.tlon.io"/>
<data android:scheme="https" android:host="sa96e-alternate.app.link"/>
</intent-filter>
<!-- Branch App Links - Test App -->
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" android:host="sa96e.test-app.link" />
<data android:scheme="https" android:host="sa96e-alternate.test-app.link" />
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="https" android:host="sa96e.test-app.link"/>
<data android:scheme="https" android:host="sa96e-alternate.test-app.link"/>
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
<meta-data android:name="io.branch.sdk.BranchKey" android:value="key_live_hubypwhuxR6vkwKfdozyRoamErouusXi" />
<meta-data android:name="io.branch.sdk.BranchKey.test" android:value="key_test_cBouaumqwI4DdzNbpcxyUhjatqiFwtG5" />
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<string name="app_name">Tlon</string>
<string name="expo_splash_screen_resize_mode" translatable="false">contain</string>
<string name="expo_splash_screen_status_bar_translucent" translatable="false">false</string>
<string name="expo_runtime_version">3.1.3</string>
<string name="expo_runtime_version">4.0.0</string>
<string name="landscape_notification_channel_name">Tlon Notifications</string>
<string name="landscape_notification_channel_description">Channel for receiving push notifications from your Tlon app.</string>
<string name="landscape_notification_mark_as_read">Mark as read</string>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#000000</color>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">Tlon - Preview</string>
</resources>
2 changes: 1 addition & 1 deletion apps/tlon-mobile/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.15'
classpath('com.google.gms:google-services:4.4.1')
classpath('com.android.tools.build:gradle')
classpath('com.facebook.react:react-native-gradle-plugin')
classpath('com.google.firebase:firebase-crashlytics-gradle:2.9.9')
Expand Down
12 changes: 6 additions & 6 deletions apps/tlon-mobile/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import 'dotenv/config';
import type { ConfigContext, ExpoConfig } from 'expo/config';

const projectId = '617bb643-5bf6-4c40-8af6-c6e9dd7e3bd0';
const isPreview = process.env.APP_VARIANT === 'preview';

export default ({ config }: ConfigContext): ExpoConfig => ({
...config,
owner: 'tlon',
slug: 'groups',
name: 'Tlon',
name: isPreview ? 'Tlon - Preview' : 'Tlon',
assetBundlePatterns: ['**/*'],
extra: {
eas: {
Expand All @@ -26,16 +27,15 @@ export default ({ config }: ConfigContext): ExpoConfig => ({
recaptchaSiteKeyIOS: process.env.RECAPTCHA_SITE_KEY_IOS,
},
ios: {
bundleIdentifier: 'io.tlon.groups.staging',
runtimeVersion: '3.1.3',
buildNumber: '44',
runtimeVersion: '4.0.0',
buildNumber: '45',
config: {
usesNonExemptEncryption: false,
},
},
android: {
runtimeVersion: '3.1.3',
versionCode: 44,
runtimeVersion: '4.0.0',
versionCode: 45,
},
updates: {
url: `https://u.expo.dev/${projectId}`,
Expand Down
30 changes: 27 additions & 3 deletions apps/tlon-mobile/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,42 @@
"build": {
"preview": {
"channel": "preview",
"distribution": "internal",
"env": {
"APP_VARIANT": "preview"
},
"android": {
"buildType": "apk"
"gradleCommand": ":app:bundlePreviewRelease"
},
"ios": {
"scheme": "Landscape-preview"
}
},
"production": {
"channel": "production"
"channel": "production",
"android": {
"gradleCommand": ":app:bundleProductionRelease"
},
"ios": {
"scheme": "Landscape"
}
}
},
"submit": {
"preview": {
"android": {
"applicationId": "io.tlon.groups.preview",
"releaseStatus": "draft",
"track": "internal",
"changesNotSentForReview": true
},
"ios": {
"ascAppId": "6477973000",
"appleTeamId": "XU9PR2N722"
}
},
"production": {
"android": {
"applicationId": "io.tlon.groups",
"releaseStatus": "draft",
"track": "internal",
"changesNotSentForReview": true
Expand Down
Loading

0 comments on commit 008e91c

Please sign in to comment.