about summary refs log tree commit diff
path: root/app.config.js
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-11-28 21:49:37 -0600
committerGitHub <noreply@github.com>2023-11-28 21:49:37 -0600
commit6f7032d42b85298b95f9a55d2dd4809450c6fa64 (patch)
treeac3e744c03c7c3d5ae872b7b32908559b45511b0 /app.config.js
parentb778017000eeed028edc5cd8fa89d64d4d90dc32 (diff)
downloadvoidsky-6f7032d42b85298b95f9a55d2dd4809450c6fa64.tar.zst
Full send Sentry (#2018)
* Update build profiles, sentry config

* Enable sentry

* Ok actually enable in dev

* Remove debug

* Add TF build

* Fix typo

* Remove debug

* Remove unecessary config

* Fix typo

* Set env in Expo

* Remove scripts

* Clarify

* Replace invalid character

* Align on release/dist

* Add build version

* Just use package version

* Align dist
Diffstat (limited to 'app.config.js')
-rw-r--r--app.config.js44
1 files changed, 39 insertions, 5 deletions
diff --git a/app.config.js b/app.config.js
index d7a0aa219..bb79260e2 100644
--- a/app.config.js
+++ b/app.config.js
@@ -1,12 +1,41 @@
+const pkg = require('./package.json')
+
 module.exports = function () {
-  const hasSentryToken = !!process.env.SENTRY_AUTH_TOKEN
+  /**
+   * App version number. Should be incremented as part of a release cycle.
+   */
+  const VERSION = pkg.version
+
+  /**
+   * iOS build number. Must be incremented for each TestFlight version.
+   */
+  const IOS_BUILD_NUMBER = '4'
+
+  /**
+   * Android build number. Must be incremented for each release.
+   */
+  const ANDROID_VERSION_CODE = 46
+
+  /**
+   * Uses built-in Expo env vars
+   *
+   * @see https://docs.expo.dev/build-reference/variables/#built-in-environment-variables
+   */
+  const PLATFORM = process.env.EAS_BUILD_PLATFORM
+
+  /**
+   * Additional granularity for the `dist` field
+   */
+  const DIST_BUILD_NUMBER =
+    PLATFORM === 'android' ? ANDROID_VERSION_CODE : IOS_BUILD_NUMBER
+
   return {
     expo: {
+      version: VERSION,
       name: 'Bluesky',
       slug: 'bluesky',
       scheme: 'bluesky',
       owner: 'blueskysocial',
-      version: '1.57.0',
       runtimeVersion: {
         policy: 'appVersion',
       },
@@ -19,7 +48,7 @@ module.exports = function () {
         backgroundColor: '#ffffff',
       },
       ios: {
-        buildNumber: '4',
+        buildNumber: IOS_BUILD_NUMBER,
         supportsTablet: false,
         bundleIdentifier: 'xyz.blueskyweb.app',
         config: {
@@ -43,7 +72,7 @@ module.exports = function () {
         backgroundColor: '#ffffff',
       },
       android: {
-        versionCode: 46,
+        versionCode: ANDROID_VERSION_CODE,
         adaptiveIcon: {
           foregroundImage: './assets/adaptive-icon.png',
           backgroundColor: '#ffffff',
@@ -74,7 +103,7 @@ module.exports = function () {
       },
       plugins: [
         'expo-localization',
-        hasSentryToken && 'sentry-expo',
+        Boolean(process.env.SENTRY_AUTH_TOKEN) && 'sentry-expo',
         [
           'expo-build-properties',
           {
@@ -100,11 +129,16 @@ module.exports = function () {
       },
       hooks: {
         postPublish: [
+          /*
+           * @see https://docs.expo.dev/guides/using-sentry/#app-configuration
+           */
           {
             file: 'sentry-expo/upload-sourcemaps',
             config: {
               organization: 'blueskyweb',
               project: 'react-native',
+              release: VERSION,
+              dist: `${PLATFORM}.${VERSION}.${DIST_BUILD_NUMBER}`,
             },
           },
         ],