1
1
# This GitHub action can publish assets for release when a tag is created.
2
2
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
3
3
#
4
- # This uses an action (hashicorp /ghaction-import-gpg) that assumes you set your
4
+ # This uses an action (paultyng /ghaction-import-gpg) that assumes you set your
5
5
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
6
6
# secret. If you would rather own your own GPG handling, please fork this action
7
7
# or use an alternative one for key handling.
@@ -13,22 +13,25 @@ name: release
13
13
on :
14
14
push :
15
15
tags :
16
- - ' v* '
16
+ - v*
17
17
jobs :
18
18
goreleaser :
19
19
runs-on : ubuntu-latest
20
+ if : |
21
+ (startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/master')
22
+ || (startsWith(github.ref, 'refs/tags/') && github.event.base_ref == 'refs/heads/v6')
20
23
steps :
21
24
-
22
25
name : Checkout
23
- uses : actions/checkout@v2.4.0
26
+ uses : actions/checkout@v3
24
27
-
25
28
name : Unshallow
26
29
run : git fetch --prune --unshallow
27
30
-
28
31
name : Set up Go
29
- uses : actions/setup-go@v2
32
+ uses : actions/setup-go@v3
30
33
with :
31
- go-version : 1.18
34
+ go-version : 1.21
32
35
-
33
36
name : Import GPG key
34
37
id : import_gpg
@@ -38,11 +41,10 @@ jobs:
38
41
passphrase : ${{ secrets.PASSPHRASE }}
39
42
-
40
43
name : Run GoReleaser
41
- uses : goreleaser/goreleaser-action@v2.8.0
44
+ uses : goreleaser/goreleaser-action@v4
42
45
with :
43
- version : latest
44
- args : release --rm-dist
46
+ version : ${{ github.event.inputs.tag }}
47
+ args : release --clean
45
48
env :
46
49
GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
47
- # GitHub sets this automatically
48
50
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments