OTA Version Check (#374)

Update Version Check on startup to dictate OTA functionality

Co-authored-by: Ritesh Shukla <ritesh.shukla2@M-LD4JMWLW26.local>
This commit is contained in:
Ritesh Shukla
2025-05-18 21:49:45 +05:30
committed by GitHub
parent cdb75fad51
commit 9a0582f622
3 changed files with 27 additions and 5 deletions
+10 -2
View File
@@ -1,13 +1,21 @@
version=$(jq -r '.version' "$(dirname "$0")/../package.json")
target_branch="${version}/android"
cd android
git clone https://github.com/Jellify-Music/App-Bundles.git
cd App-Bundles
git checkout android
if git ls-remote --exit-code --heads origin "$target_branch" >/dev/null 2>&1; then
echo "Branch '$target_branch' already exists on remote."
git checkout "$target_branch"
else
echo "Branch '$target_branch' does not exist on remote. Attempting to create it..."
git checkout -b "$target_branch"
fi
cd ../..
yarn createBundle:android
cd android/App-Bundles
git add .
git commit -m "OTA-Update - $(date +'%b %d %H:%M')"
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git android
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git "$target_branch"
cd ..
rm -rf App-Bundles
cd ..
+11 -2
View File
@@ -1,15 +1,24 @@
version=$(jq -r '.version' "$(dirname "$0")/../package.json")
target_branch="${version}/ios"
cd ios
rm -rf App-Bundles
git clone https://github.com/Jellify-Music/App-Bundles.git
cd App-Bundles
git checkout iOS
if git ls-remote --exit-code --heads origin "$target_branch" >/dev/null 2>&1; then
echo "Branch '$target_branch' already exists on remote."
git checkout "$target_branch"
else
echo "Branch '$target_branch' does not exist on remote. Attempting to create it..."
git checkout -b "$target_branch"
fi
rm -rf Readme.md
cd ../..
yarn createBundle:ios
cd ios/App-Bundles
git add .
git commit -m "OTA-Update - $(date +'%b %d %H:%M')"
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git iOS
git push https://x-access-token:$SIGNING_REPO_PAT@github.com/Jellify-Music/App-Bundles.git "$target_branch"
cd ..
rm -rf App-Bundles
cd ..
+6 -1
View File
@@ -11,6 +11,11 @@ import {
} from 'react-native'
import Animated, { useSharedValue, useAnimatedStyle, withTiming } from 'react-native-reanimated'
import hotUpdate from 'react-native-ota-hot-update'
import DeviceInfo from 'react-native-device-info'
const version = DeviceInfo.getVersion()
const gitBranch = `${version}/${Platform.OS}`
const GitUpdateModal = () => {
const progress = useSharedValue(0)
@@ -31,7 +36,7 @@ const GitUpdateModal = () => {
setLoading(true)
hotUpdate.git.checkForGitUpdate({
branch: Platform.OS === 'ios' ? 'iOS' : 'android',
branch: gitBranch,
bundlePath: Platform.OS === 'ios' ? 'main.jsbundle' : 'index.android.bundle',
url: 'https://github.com/Jellify-Music/App-Bundles',