Skip to content

Commit

Permalink
feat(release.sh): make change in mrc push func
Browse files Browse the repository at this point in the history
Signed-off-by: Hazem Belkhiria <[email protected]>
  • Loading branch information
hbelkhir committed Jan 10, 2025
1 parent 4fb6629 commit 214c485
Showing 1 changed file with 26 additions and 19 deletions.
45 changes: 26 additions & 19 deletions scripts/release/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ push_and_release() {
fi
}

push_and_release_mrc() {
printf "%s\n" "Commit mrc changes"
git add packages/manager-react-components/package.json packages/manager-react-components/CHANGELOG.md
git commit -s --amend --no-edit
}

update_sonar_version() {
printf "%s\n" "Updating sonar"
sed -i "s/sonar\.projectVersion=.*/sonar\.projectVersion=$1/" ".sonarcloud.properties"
Expand Down Expand Up @@ -132,7 +138,7 @@ main() {
done

changed_packages=$(get_changed_packages)

if [ -z "$changed_packages" ]; then
printf "%s\n" "Nothing to release"
exit 0
Expand All @@ -158,24 +164,7 @@ main() {
fi
done <<< "$changed_packages"

# Handle `manager-react-components` separately
if [ "$mrc_changed" == true ]; then
next_tag=$(get_release_name "$SEED")
printf "%s\n" "New tag for manager-react-components: $next_tag"

RELEASE_NOTE+="# Release $next_tag\n\n"

update_sonar_version "$next_tag"
version_mrc "$next_tag"

# Create release note for manager-react-components
RELEASE_NOTE+="$(create_release_note "$path_mrc" "$name_mrc")\n\n"

# Commit and release manager-react-components
clean_tags
push_and_release "$next_tag"
fi

# Handle the rest of the packages
next_tag=$(get_release_name "$SEED")
printf "%s\n" "New tag for other packages: $next_tag"
Expand All @@ -196,6 +185,24 @@ main() {
# Push and release for other packages
push_and_release "$next_tag"

# Handle `manager-react-components` separately
if [ "$mrc_changed" == true ]; then
next_tag=$(get_release_name "$SEED")
printf "%s\n" "New tag for manager-react-components: $next_tag"

RELEASE_NOTE+="# Release $next_tag\n\n"

update_sonar_version "$next_tag"
version_mrc "$next_tag"

# Create release note for manager-react-components
RELEASE_NOTE+="$(create_release_note "$path_mrc" "$name_mrc")\n\n"

# Commit and release manager-react-components
clean_tags
push_and_release_mrc "$next_tag"
fi

}

main "${@}"
main "${@}"

0 comments on commit 214c485

Please sign in to comment.