Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 19 additions & 13 deletions scripts/release
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,28 @@ function run_release() {
check_clean_working_directory

# Step 1: Checkout develop branch and sync with main
echo "Step 1: Checking out develop branch..."
echo "Step 1: Syncing branches..."
echo "Fetching all branches from origin..."
git fetch origin

echo "Checking out develop branch..."
git checkout develop
echo "Pulling latest changes from origin..."
git pull origin develop
git reset --hard origin/develop

echo "Pulling latest changes from main..."
git fetch origin main
echo "Merging main into develop to ensure all changes are included..."
if ! git merge origin/main -m "Merge main into develop for release"; then
echo ""
echo "Merge conflict detected. Please resolve conflicts and run the script again."
error "Failed to merge main into develop"
echo "Checking if main needs to be merged into develop..."
# Check if there are commits on main that are not on develop
if git log develop..origin/main --oneline | grep -q .; then
echo "Found commits on main that need to be merged into develop..."
if ! git merge origin/main -m "Merge main into develop for release"; then
echo ""
echo "Merge conflict detected. Please resolve conflicts and run the script again."
error "Failed to merge main into develop"
fi
echo "Pushing updated develop to origin..."
git push origin develop
else
echo "Develop is already up to date with main."
fi

echo "Pushing updated develop to origin..."
git push origin develop
echo ""

# Step 2: Identify latest release
Expand Down
Loading