Skip to content

Commit

Permalink
Update .github/workflows/release.yml
Browse files Browse the repository at this point in the history
Co-authored-by: Eyal Delarea <[email protected]>
  • Loading branch information
hazeltonl and EyalDelarea authored Jan 7, 2025
1 parent 1e7bfb4 commit 0dc04e7
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,28 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update tags
- name: Extract Major and Minor Versions from Tag
id: extract-version
run: |
git tag -f v4
git tag -f v4.4
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:
Expand Down

0 comments on commit 0dc04e7

Please sign in to comment.