Release next RC from '9.9.8' #8
Workflow file for this run
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
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 | |
secrets: inherit | |
permissions: | |
checks: read | |
contents: write | |
needs: get_tag_name | |
with: | |
version: ${{ needs.get_tag_name.outputs.next_version }} | |
from_branch: ${{ github.ref_name }} |