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 f7c10e5
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/autotag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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
# skip if no version found
- name: Check version
run: echo "Version: $VERSION"
- name: Skip if no version
if: $VERSION == ''
run: echo "No version found, skipping..."
# create & push tag
- name: Create & push tag
if: $VERSION != ''
run: |
git tag v$VERSION
git push origin v$VERSION

0 comments on commit f7c10e5

Please sign in to comment.