Better dist strings for Sentry (#3584)
* better version codes for sentry * use a `.` to follow the same intended format as before * ignore dist build numberzio/stable
parent
046e11de31
commit
69d3768006
|
@ -35,11 +35,6 @@ module.exports = function (config) {
|
||||||
*/
|
*/
|
||||||
const PLATFORM = process.env.EAS_BUILD_PLATFORM
|
const PLATFORM = process.env.EAS_BUILD_PLATFORM
|
||||||
|
|
||||||
const DIST_BUILD_NUMBER =
|
|
||||||
PLATFORM === 'android'
|
|
||||||
? process.env.BSKY_ANDROID_VERSION_CODE
|
|
||||||
: process.env.BSKY_IOS_BUILD_NUMBER
|
|
||||||
|
|
||||||
const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
|
const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
|
||||||
const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
|
const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
|
||||||
const IS_PRODUCTION = process.env.EXPO_PUBLIC_ENV === 'production'
|
const IS_PRODUCTION = process.env.EXPO_PUBLIC_ENV === 'production'
|
||||||
|
@ -51,6 +46,10 @@ module.exports = function (config) {
|
||||||
: undefined
|
: undefined
|
||||||
const UPDATES_ENABLED = !!UPDATES_CHANNEL
|
const UPDATES_ENABLED = !!UPDATES_CHANNEL
|
||||||
|
|
||||||
|
const SENTRY_DIST = `${PLATFORM}.${VERSION}.${IS_TESTFLIGHT ? 'tf' : ''}${
|
||||||
|
IS_DEV ? 'dev' : ''
|
||||||
|
}`
|
||||||
|
|
||||||
return {
|
return {
|
||||||
expo: {
|
expo: {
|
||||||
version: VERSION,
|
version: VERSION,
|
||||||
|
@ -217,7 +216,7 @@ module.exports = function (config) {
|
||||||
organization: 'blueskyweb',
|
organization: 'blueskyweb',
|
||||||
project: 'react-native',
|
project: 'react-native',
|
||||||
release: VERSION,
|
release: VERSION,
|
||||||
dist: `${PLATFORM}.${VERSION}.${DIST_BUILD_NUMBER}`,
|
dist: SENTRY_DIST,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
|
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
|
||||||
|
|
||||||
|
export const BUILD_ENV = process.env.EXPO_PUBLIC_ENV
|
||||||
export const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
|
export const IS_DEV = process.env.EXPO_PUBLIC_ENV === 'development'
|
||||||
export const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
|
export const IS_TESTFLIGHT = process.env.EXPO_PUBLIC_ENV === 'testflight'
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,9 @@
|
||||||
|
|
||||||
import {Platform} from 'react-native'
|
import {Platform} from 'react-native'
|
||||||
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
|
import {nativeApplicationVersion, nativeBuildVersion} from 'expo-application'
|
||||||
import * as info from 'expo-updates'
|
|
||||||
import {init} from 'sentry-expo'
|
import {init} from 'sentry-expo'
|
||||||
|
|
||||||
/**
|
import {BUILD_ENV, IS_DEV, IS_TESTFLIGHT} from 'lib/app-info'
|
||||||
* Matches the build profile `channel` props in `eas.json`
|
|
||||||
*/
|
|
||||||
const buildChannel = (info.channel || 'development') as
|
|
||||||
| 'development'
|
|
||||||
| 'preview'
|
|
||||||
| 'production'
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Examples:
|
* Examples:
|
||||||
|
@ -32,16 +25,16 @@ const release = nativeApplicationVersion ?? 'dev'
|
||||||
* - `ios.1.57.0.3`
|
* - `ios.1.57.0.3`
|
||||||
* - `android.1.57.0.46`
|
* - `android.1.57.0.46`
|
||||||
*/
|
*/
|
||||||
const dist = `${Platform.OS}.${release}${
|
const dist = `${Platform.OS}.${nativeBuildVersion}.${
|
||||||
nativeBuildVersion ? `.${nativeBuildVersion}` : ''
|
IS_TESTFLIGHT ? 'tf' : ''
|
||||||
}`
|
}${IS_DEV ? 'dev' : ''}`
|
||||||
|
|
||||||
init({
|
init({
|
||||||
autoSessionTracking: false,
|
autoSessionTracking: false,
|
||||||
dsn: 'https://05bc3789bf994b81bd7ce20c86ccd3ae@o4505071687041024.ingest.sentry.io/4505071690514432',
|
dsn: 'https://05bc3789bf994b81bd7ce20c86ccd3ae@o4505071687041024.ingest.sentry.io/4505071690514432',
|
||||||
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
|
debug: false, // If `true`, Sentry will try to print out useful debugging information if something goes wrong with sending the event. Set it to `false` in production
|
||||||
enableInExpoDevelopment: false, // enable this to test in dev
|
enableInExpoDevelopment: false, // enable this to test in dev
|
||||||
environment: buildChannel,
|
environment: BUILD_ENV ?? 'development',
|
||||||
dist,
|
dist,
|
||||||
release,
|
release,
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue