Skip to content

Commit

Permalink
ci: auto tag
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-Lord committed Jul 8, 2024
1 parent f63441e commit c26b334
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Auto Tag
on: [push]

permissions:
contents: write

jobs:
tag:
name: Auto Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# parse version from git log like `release: 0.0.35`
- name: Get version
run: |
version=$(git log --pretty=oneline -1 | grep -oP 'release: \K[0-9.]+')
if [ -n "$version" ]; then echo VERSION=$version >> $GITHUB_ENV ; fi
# create & push tag
- name: Create & push tag
if: ${{ env.VERSION }} != ''
run: |
git tag v$VERSION
git push origin v$VERSION

0 comments on commit c26b334

Please sign in to comment.