Skip to content

Commit cf78a93

Browse files
committed
add a create tag action
1 parent c0f3366 commit cf78a93

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
* text=auto
22

33
.aagh export-ignore
4+
.github export-ignore
45
.editorconfig export-ignore
56
.gitattributes export-ignore
67
.gitignore export-ignore

.github/workflows/create-tag.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Create Tag
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
13+
WANTED_MESSAGE: 'bump version to '
14+
15+
jobs:
16+
create:
17+
if: ${{ startsWith( github.event.head_commit.message, 'bump version to ' ) }}
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Get new version
25+
shell: bash
26+
run: |
27+
COMMIT_MESSAGE="${{ env.COMMIT_MESSAGE }}"
28+
WANTED_MESSAGE="${{ env.WANTED_MESSAGE }}"
29+
30+
VERSION="${COMMIT_MESSAGE/$WANTED_MESSAGE}"
31+
VERSION="${VERSION#v}"
32+
VERSION="${VERSION#V}"
33+
34+
echo "NEW_VERSION=$VERSION" >> $GITHUB_ENV
35+
36+
- name: Git tag version
37+
run: |
38+
echo "Tagging version $NEW_VERSION"
39+
40+
git tag "v$NEW_VERSION"
41+
git push --tags

0 commit comments

Comments
 (0)