Skip to content

Commit

Permalink
feat: update tags script
Browse files Browse the repository at this point in the history
  • Loading branch information
vdbe committed Jul 25, 2024
1 parent 408c02c commit b03ecbf
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/update-tags.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
release:
types: [published]

jobs:
github-example-tags:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Configure Git
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Create major/major.minor tags
run: |
echo "Tag name from GITHUB_REF_NAME: $GITHUB_REF_NAME"
MAJOR_VERSION=$(echo $GITHUB_REF_NAME | cut -d'.' -f1 | tr -d 'v')
MINOR_VERSION=$(echo $GITHUB_REF_NAME | cut -d'.' -f2)
PATCH_VERSION=$(echo $GITHUB_REF_NAME | cut -d'.' -f3)
git checkout "$GITHUB_REF_NAME"
git tag -af "v$MAJOR_VERSION" -m "$GITHUB_REF_NAME"
git checkout "$GITHUB_REF_NAME"
git tag -af "v$MAJOR_VERSION.$MINOR_VERSION" -m "$GITHUB_REF_NAME"
- name: Push tags
run: |
git push origin HEAD:main --follow-tags

0 comments on commit b03ecbf

Please sign in to comment.