diff --git a/app.config.js b/app.config.js index 13b73bef14..d66b9d119c 100644 --- a/app.config.js +++ b/app.config.js @@ -11,7 +11,7 @@ const DARK_SPLASH_CONFIG = { resizeMode: 'cover', } -module.exports = function (config) { +module.exports = function () { /** * App version number. Should be incremented as part of a release cycle. */ @@ -24,6 +24,11 @@ module.exports = function (config) { */ 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 + return { expo: { version: VERSION, @@ -149,7 +154,7 @@ module.exports = function (config) { organization: 'blueskyweb', project: 'react-native', release: VERSION, - dist: `${PLATFORM}.${VERSION}.${new Date().toISOString()}`, + dist: `${PLATFORM}.${VERSION}.${DIST_BUILD_NUMBER}`, }, }, ], diff --git a/scripts/setBuildNumberEnv.sh b/scripts/setBuildNumberEnv.sh new file mode 100755 index 0000000000..276ffeaa70 --- /dev/null +++ b/scripts/setBuildNumberEnv.sh @@ -0,0 +1,11 @@ +#!/bin/bash +echo "$@" +outputIos=$(eas build:version:get -p ios) +outputAndroid=$(eas build:version:get -p android) +currentIosVersion=${outputIos#*buildNumber - } +currentAndroidVersion=${outputAndroid#*versionCode - } + +BSKY_IOS_BUILD_NUMBER=$((currentIosVersion+1)) +BSKY_ANDROID_VERSION_CODE=$((currentAndroidVersion+1)) + +bash -c "BSKY_IOS_BUILD_NUMBER=$BSKY_IOS_BUILD_NUMBER BSKY_ANDROID_VERSION_CODE=$BSKY_ANDROID_VERSION_CODE eas build -p ios --profile production"