Skip to content

Commit 369aedf

Browse files
committed
Try to create tag on push
1 parent 67648e9 commit 369aedf

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/create-tag.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Create Tag
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: "${{ github.ref }}"
10+
cancel-in-progress: true
11+
12+
jobs:
13+
create-tag:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
permissions: write-all
17+
env:
18+
GIT_STRATEGY: clone
19+
steps:
20+
- name: Checkout repo
21+
uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 20
24+
lfs: true
25+
- name: Get new version
26+
run: |
27+
git fetch --tags
28+
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1))
29+
IFS='.' read -r. -a parts <<< "${latest_tag}"
30+
((parts[1]++))
31+
new_tag="${parts[0]}.${parts[1]}"
32+
echo "${new_tag}" : $VERSION
33+
- name: Create release
34+
uses: actions/create-release@v1
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37+
with:
38+
tag_name: ${{ vars.VERSION }}

0 commit comments

Comments
 (0)