We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9875a5b commit f76b394Copy full SHA for f76b394
1 file changed
.github/workflows/release.yml
@@ -2,10 +2,10 @@ name: Release
2
3
on:
4
push:
5
- tags:
6
- - "v*"
+ branches:
+ - main
7
workflow_dispatch:
8
-
+
9
permissions:
10
contents: write
11
@@ -23,6 +23,23 @@ jobs:
23
with:
24
go-version: "1.21"
25
26
+ - name: Auto-tag
27
+ run: |
28
+ latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
29
+ version=${latest_tag#v}
30
+ IFS='.' read -r major minor patch <<< "$version"
31
+ feat_count=$(git log "$latest_tag"..HEAD --oneline --grep='^feat[(:]' | wc -l)
32
+ if [ "$feat_count" -gt 0 ]; then
33
+ minor=$((minor + 1))
34
+ patch=0
35
+ else
36
+ patch=$((patch + 1))
37
+ fi
38
+ new_tag="v$major.$minor.$patch"
39
+ echo "Creating tag $new_tag"
40
+ git tag "$new_tag"
41
+ git push origin "$new_tag"
42
43
- name: Run GoReleaser
44
uses: goreleaser/goreleaser-action@v6
45
0 commit comments