Skip to content

Commit 6bae8d8

Browse files
authored
Support Minor Version Tagging (#228)
1 parent 812206b commit 6bae8d8

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,28 @@ jobs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v4
12-
- name: Update v4 tag
13-
run: git tag -f v4
12+
- name: Extract Major and Minor Versions from Tag
13+
id: extract-version
14+
run: |
15+
TAG_NAME="${{ github.event.release.tag_name }}"
16+
# Ensure the tag follows semantic versioning (e.g., v1.2.3)
17+
if [[ "$TAG_NAME" =~ ^v([0-9]+)\.([0-9]+) ]]; then
18+
MAJOR="${BASH_REMATCH[1]}"
19+
MINOR="${BASH_REMATCH[2]}"
20+
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
21+
echo "MINOR=$MINOR" >> $GITHUB_ENV
22+
echo "Extracted Major: $MAJOR, Minor: $MINOR"
23+
else
24+
echo "Invalid tag format: $TAG_NAME"
25+
exit 1
26+
fi
27+
28+
- name: Update Major and Minor Tags
29+
run: |
30+
# Create or update major version tag
31+
git tag -f v$MAJOR
32+
# Create or update minor version tag
33+
git tag -f v$MAJOR.$MINOR
1434
- name: Push changes
1535
uses: ad-m/github-push-action@master
1636
with:

0 commit comments

Comments
 (0)