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 e93b32b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Auto Tag
on: [push]

permissions:
contents: write

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

0 comments on commit e93b32b

Please sign in to comment.