Skip to content

Commit

Permalink
Merge pull request #1729 from skalenetwork/hotfix-rc
Browse files Browse the repository at this point in the history
Add rc branch and update calculate_version.sh
  • Loading branch information
yavrsky authored Nov 20, 2024
2 parents b9cdb50 + bcf9595 commit 86c207a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- 'v*.*.*'
- develop
- beta
- release-candidate
- stable
push:
tags:
Expand Down
30 changes: 20 additions & 10 deletions scripts/calculate_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,30 @@ if [ -z "$VERSION" ]; then
exit 1
fi

LABEL="develop"
for known in "beta" "stable"
do
if [ "$BRANCH" = "$known" ]
then
LABEL="$BRANCH"
fi
done

git fetch --tags > /dev/null

KNOWN_BRANCHES=('stable' 'release-candidate' 'beta')
# Everything else will be marked as 'develop'

declare -A SUFFIXES=(
['release-candidate']='rc'
)

if [[ ! "${KNOWN_BRANCHES[@]}" =~ "$BRANCH" ]]
then
BRANCH='develop'
fi

SUFFIX=$BRANCH
if [[ -n "${SUFFIXES[$BRANCH]}" ]]
then
SUFFIX="${SUFFIXES[$BRANCH]}"
fi


for (( NUMBER=0; ; NUMBER++ ))
do
FULL_VERSION="$VERSION-$LABEL.$NUMBER"
FULL_VERSION="$VERSION-$SUFFIX.$NUMBER"
TAG="$FULL_VERSION"
if ! [[ $(git tag -l | grep "$TAG") ]]; then
echo "$FULL_VERSION" | tr / -
Expand Down

0 comments on commit 86c207a

Please sign in to comment.