Skip to content

Commit

Permalink
Add release-candidate branch
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaStebaev committed Aug 22, 2024
1 parent 9dc6f64 commit a8a2555
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
pull_request:
types: [closed]
branches:
- 'v*.*.*'
- develop
- beta
- release-candidate
- stable
- 'v*.*.*'
push:
tags:
- 'custom-release-*'
Expand Down
31 changes: 20 additions & 11 deletions scripts/calculate_version.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

set -e

Expand All @@ -18,20 +18,29 @@ 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 a8a2555

Please sign in to comment.