From 6bae8d8ec81daaf25eff19dec04c2ca70c1419c1 Mon Sep 17 00:00:00 2001 From: Luke Hazelton <108833341+hazeltonl@users.noreply.github.com> Date: Tue, 7 Jan 2025 10:45:24 -0500 Subject: [PATCH] Support Minor Version Tagging (#228) --- .github/workflows/release.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5d64102c..bfd371a87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,8 +9,28 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Update v4 tag - run: git tag -f v4 + - name: Extract Major and Minor Versions from Tag + id: extract-version + run: | + TAG_NAME="${{ github.event.release.tag_name }}" + # Ensure the tag follows semantic versioning (e.g., v1.2.3) + if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+) ]]; then + MAJOR="${BASH_REMATCH[1]}" + MINOR="${BASH_REMATCH[2]}" + echo "MAJOR=$MAJOR" >> $GITHUB_ENV + echo "MINOR=$MINOR" >> $GITHUB_ENV + echo "Extracted Major: $MAJOR, Minor: $MINOR" + else + echo "Invalid tag format: $TAG_NAME" + exit 1 + fi + + - name: Update Major and Minor Tags + run: | + # Create or update major version tag + git tag -f v$MAJOR + # Create or update minor version tag + git tag -f v$MAJOR.$MINOR - name: Push changes uses: ad-m/github-push-action@master with: