Skip to content

Commit 6529c0f

Browse files
author
Alex Hung
authored
Update release.yml
Use go 1.21. Update actions' versions
1 parent 3b47132 commit 6529c0f

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This GitHub action can publish assets for release when a tag is created.
22
# Currently its setup to run on any tag that matches the pattern "v*" (ie. v0.1.0).
33
#
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
55
# private key in the `GPG_PRIVATE_KEY` secret and passphrase in the `PASSPHRASE`
66
# secret. If you would rather own your own GPG handling, please fork this action
77
# or use an alternative one for key handling.
@@ -13,22 +13,25 @@ name: release
1313
on:
1414
push:
1515
tags:
16-
- 'v*'
16+
- v*
1717
jobs:
1818
goreleaser:
1919
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')
2023
steps:
2124
-
2225
name: Checkout
23-
uses: actions/checkout@v2.4.0
26+
uses: actions/checkout@v3
2427
-
2528
name: Unshallow
2629
run: git fetch --prune --unshallow
2730
-
2831
name: Set up Go
29-
uses: actions/setup-go@v2
32+
uses: actions/setup-go@v3
3033
with:
31-
go-version: 1.18
34+
go-version: 1.21
3235
-
3336
name: Import GPG key
3437
id: import_gpg
@@ -38,11 +41,10 @@ jobs:
3841
passphrase: ${{ secrets.PASSPHRASE }}
3942
-
4043
name: Run GoReleaser
41-
uses: goreleaser/goreleaser-action@v2.8.0
44+
uses: goreleaser/goreleaser-action@v4
4245
with:
43-
version: latest
44-
args: release --rm-dist
46+
version: ${{ github.event.inputs.tag }}
47+
args: release --clean
4548
env:
4649
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
47-
# GitHub sets this automatically
4850
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)