Skip to content
Merged
Show file tree
Hide file tree
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
27 changes: 3 additions & 24 deletions .github/scripts/create-platform-release-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,15 @@ get_expected_changed_files() {
# For all platforms: release/{version}
# If TEST_ONLY=true: release-testing/{version}
get_release_branch_name() {
local platform="$1"
local new_version="$2"

# Validate platform
if [[ "$platform" != "mobile" && "$platform" != "extension" ]]; then
echo "Error: Unknown platform '$platform'. Must be 'mobile' or 'extension'."
exit 1
fi
local new_version="$1"

# Use test branch if TEST_ONLY is true
if [ "$TEST_ONLY" == "true" ]; then
echo "release-testing/${new_version}"
return 0
fi

# Different release branch naming for different platforms
if [[ "$platform" == "mobile" ]]; then
echo "release/${new_version}"
elif [[ "$platform" == "extension" ]]; then
local candidate_primary="Version-v${new_version}"
local candidate_alt="release/${new_version}"
# Prefer Version-v... if it exists on origin; otherwise use release/... if present; else default to Version-v...
if git ls-remote --heads origin "${candidate_primary}" | grep -q "."; then
echo "${candidate_primary}"
elif git ls-remote --heads origin "${candidate_alt}" | grep -q "."; then
echo "${candidate_alt}"
else
echo "${candidate_primary}"
fi
fi
echo "release/${new_version}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

}

# Calculate next version for main branch bump
Expand Down Expand Up @@ -512,7 +491,7 @@ main() {

# Initialize branch names
local release_branch_name changelog_branch_name version_bump_branch_name
release_branch_name=$(get_release_branch_name "$PLATFORM" "$NEW_VERSION")
release_branch_name=$(get_release_branch_name "$NEW_VERSION")
changelog_branch_name="chore/${NEW_VERSION}-Changelog"
version_bump_branch_name=$(get_version_bump_branch_name "$next_version") # Execute main workflow
configure_git
Expand Down
8 changes: 3 additions & 5 deletions .github/scripts/tests/test-create-platform-release-pr-full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ fi
echo ""
echo "Testing branch naming (test mode):"
export TEST_ONLY="true"
echo " Mobile release: $(get_release_branch_name "mobile" "1.5.3")"
echo " Extension release: $(get_release_branch_name "extension" "1.5.3")"
echo " Release: $(get_release_branch_name "1.5.3")"
echo " Version bump: $(get_version_bump_branch_name "1.6.0")"

echo ""
Expand Down Expand Up @@ -164,9 +163,8 @@ echo "4️⃣ TESTING DIFFERENT SCENARIOS"
echo "================================"

echo ""
echo "Testing with different platforms:"
echo "Mobile release branch: $(get_release_branch_name "mobile" "2.0.0")"
echo "Extension release branch: $(get_release_branch_name "extension" "2.0.0")"
echo "Testing release branch:"
echo "Release branch: $(get_release_branch_name "2.0.0")"

echo ""
echo "Testing production vs test mode:"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,10 @@ echo ""
# Test get_release_branch_name function (safe - no external calls)
echo "Testing get_release_branch_name (SAFE):"
export TEST_ONLY="false"
echo " Mobile (prod): $(get_release_branch_name "mobile" "1.5.3")"
echo " Extension (prod): $(get_release_branch_name "extension" "1.5.3")"
echo " Input (prod): 1.5.3 -> Output: $(get_release_branch_name "1.5.3")"

export TEST_ONLY="true"
echo " Mobile (test): $(get_release_branch_name "mobile" "1.5.3")"
echo " Extension (test): $(get_release_branch_name "extension" "1.5.3")"
echo " Input (test): 1.5.3 -> Output: $(get_release_branch_name "1.5.3")"

echo ""

Expand Down
Loading