Skip to content

Release next RC from '5.2.4' #3

Release next RC from '5.2.4'

Release next RC from '5.2.4' #3

name: "Automated Release: Release next RC from release branch"
on:
push:
branches:
- '[0-9]+.[0-9]+.[0-9]+'
run-name: Release next RC from '${{ github.ref_name }}'
jobs:
get_tag_name:
name: Calculate next RC number
env:
CURRENT_BRANCH: ${{ github.ref_name }}
runs-on: ubuntu-latest
outputs:
next_version: ${{ steps.calculate-next-version.outputs.next_version }}
steps:
- name: Get latest RC tag.
id: latest_rc_tag
uses: oprypin/find-latest-tag@v1
with:
repository: ${{ github.repository }}
prefix: v${{ env.CURRENT_BRANCH }}rc
- name: Calculate next_version
id: calculate-next-version
run: |
CURRENT_BRANCH="${{ github.ref_name }}"
LATEST_TAG="${{ steps.latest_rc_tag.outputs.tag }}"
LATEST_TAG="${LATEST_TAG#v}"
# Split version by 'rc' and increment the last number
base="${LATEST_TAG%rc*}"
rc_number="${LATEST_TAG##*rc}"
next_rc_number=$((rc_number + 1))
next_version="${base}rc${next_rc_number}"
echo "next_version=$next_version" >> $GITHUB_OUTPUT
tag_and_release:
name: Tag and release version ${{ needs.get_tag_name.outputs.next_version }} from branch ${{ github.ref_name }}
uses: ./.github/workflows/tag.yml
permissions:
checks: read
contents: write
needs: get_tag_name
with:
version: ${{ needs.get_tag_name.outputs.next_version }}
from_branch: ${{ github.ref_name }}