Skip to content

Commit

Permalink
fix: RC build issue
Browse files Browse the repository at this point in the history
  • Loading branch information
seeratawan01 committed Oct 21, 2024
1 parent e521aa9 commit fed6e28
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/release-candidate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,30 @@ jobs:
- name: Determine RC version
id: rc_version
run: |
# Get the latest non-RC tag
BASE_VERSION=$(git describe --tags --abbrev=0 --match "[0-9]*.[0-9]*.[0-9]*" 2>/dev/null || echo "0.0.0")
# Count the number of RCs for this version
RC_COUNT=$(git tag -l "${BASE_VERSION}-rc.*" | wc -l)
RC_NUMBER=$((RC_COUNT + 1))
RC_VERSION="${BASE_VERSION}-rc.${RC_NUMBER}"
echo "RC_VERSION=${RC_VERSION}" >> $GITHUB_OUTPUT
# Get the latest version tag
LATEST_TAG=$(git describe --tags --abbrev=0 --match "[0-9]*.[0-9]*.[0-9]*" 2>/dev/null || echo "0.0.0")
# Extract version components
IFS='.' read -r -a version_parts <<< "$LATEST_TAG"
MAJOR="${version_parts[0]}"
MINOR="${version_parts[1]}"
PATCH="${version_parts[2]}"
# Increment patch version
NEW_PATCH=$((PATCH + 1))
NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH"
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_OUTPUT
- id: release
uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: none
tag_name: ${{ steps.rc_version.outputs.RC_VERSION }}
tag_prefix: ""
release_name: "Release Candidate ${{ steps.rc_version.outputs.RC_VERSION }}"
bump_version_scheme: patch
tag_prefix: "rc-"
release_name: "Release Candidate ${{ steps.rc_version.outputs.NEW_VERSION }}"
release_body: |
This is a release candidate for version ${{ steps.rc_version.outputs.NEW_VERSION }}.
Changes in this release candidate:
${{ github.event.pull_request.title }}
For full changes, please see the pull request: ${{ github.event.pull_request.html_url }}
outputs:
version: ${{ steps.release.outputs.version }}

0 comments on commit fed6e28

Please sign in to comment.