Skip to content

Commit

Permalink
CI enhancements (#253)
Browse files Browse the repository at this point in the history
  • Loading branch information
laysabit authored Jun 11, 2024
1 parent 6f67607 commit 382f030
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# ${{ github.ref }} was not giving v* as tag name, but refs/tags/v* instead, so It had to be abbreviated
- name: Get latest abbreviated tag
id: gettag
run: echo ::set-output name=TAG::$(git describe --tags --abbrev=0)
run: echo ::set-output name=TAG::$(git describe --tags $(git rev-list --tags --max-count=1)) # get the latest tag across all branches and put it in the output TAG

- name: Calculate next version
id: nextversion
Expand All @@ -40,12 +40,15 @@ jobs:
CURRENT_VERSION="${{ steps.gettag.outputs.TAG }}"
CURRENT_VERSION="${CURRENT_VERSION#v}" # Remove the 'v' from the start of the version
IFS='.' read -ra VERSION_PARTS <<< "$CURRENT_VERSION"
if [[ $BRANCH_NAME =~ ^feature/ ]]; then
if [[ $BRANCH_NAME =~ ^release/ ]]; then
VERSION_PARTS[0]=$((VERSION_PARTS[0] + 1))
VERSION_PARTS[1]=0
VERSION_PARTS[2]=0
elif [[ $BRANCH_NAME =~ ^feature/ ]]; then
VERSION_PARTS[1]=$((VERSION_PARTS[1] + 1))
VERSION_PARTS[2]=0
elif [[ $BRANCH_NAME =~ ^patch/ ]]; then
VERSION_PARTS[2]=$((VERSION_PARTS[2] + 1))
elif [[ $BRANCH_NAME =~ ^release/ ]]; then
VERSION_PARTS[0]=$((VERSION_PARTS[0] + 1))
fi
NEXT_VERSION="v${VERSION_PARTS[0]}.${VERSION_PARTS[1]}.${VERSION_PARTS[2]}"
echo ::set-output name=NEXT_VERSION::"$NEXT_VERSION"
Expand Down

0 comments on commit 382f030

Please sign in to comment.