-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): minor fixes to promote and release actions (#1343)
* fix(ci): minor fixes to promote and release actions * sync delivery release and promote * sync delivery release and promote * remove unused input in workflows
- Loading branch information
Showing
5 changed files
with
67 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,14 +38,17 @@ runs: | |
declare -a PREVIOUS_STABLE_TAGS=() | ||
SCOPE_VERSION="COLLECT" | ||
MINOR_VERSION_FILE_PATH=".version" | ||
RELEASE_CLOUD=0 | ||
# Get current stable branch name | ||
# If MASTER, use root .version | ||
# Else use branch name | ||
if [[ "${{ inputs.github_ref_name }}" == "master" ]]; then | ||
CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2) | ||
RELEASE_CLOUD=1 | ||
else | ||
CURRENT_STABLE_BRANCH_MAJOR_VERSION=$(echo ${{ inputs.github_ref_name }} | cut -d '.' -f1,2) | ||
RELEASE_CLOUD=0 | ||
fi | ||
echo "Current stable branch major version: $CURRENT_STABLE_BRANCH_MAJOR_VERSION" | ||
|
@@ -54,10 +57,15 @@ runs: | |
MAJOR_VERSION=$(grep -E "MAJOR" .version | cut -d '=' -f2) | ||
MINOR_VERSION=$(grep -E "MINOR" .version | cut -d '=' -f2) | ||
# Previous stable tags array | ||
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION*" | head -n 1)) | ||
if [[ $RELEASE_CLOUD -eq 1 ]]; then | ||
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.*-*" | head -n 1)) | ||
else | ||
PREVIOUS_STABLE_TAGS+=($(git tag -l --sort=-version:refname "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.*" | grep -E "$component-$CURRENT_STABLE_BRANCH_MAJOR_VERSION.[0-9]+$" | head -n 1)) | ||
fi | ||
# New stable tags array | ||
TMP_STABLE_TAGS+=("$component-$MAJOR_VERSION.$MINOR_VERSION") | ||
done | ||
echo "Previous releases were: ${PREVIOUS_STABLE_TAGS[*]}" | ||
echo "Temporary new releases are: ${TMP_STABLE_TAGS[*]}" | ||
# Building final NEW_STABLE_TAGS with the new version tags only | ||
|
@@ -96,11 +104,6 @@ runs: | |
git config --global user.email "[email protected]" | ||
git config --global user.name "Centreon" | ||
# Rebuild NEW_STABLE_TAGS as an array | ||
for i in ${NEW_RELEASE_TAGS[@]}; do | ||
NEW_RELEASE_TAGS+=("$i") | ||
done | ||
# Create release tags on git for each release components | ||
# Abort if no tags or existing tag | ||
echo "Creating release tags." | ||
|
@@ -149,6 +152,7 @@ runs: | |
else | ||
echo "::error::Release tag $TAG was empty, exiting." | ||
exit 1 | ||
fi | ||
done | ||
shell: bash | ||
env: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters