Skip to content

Commit 4d529ca

Browse files
authored
goreleaser: Migrate config to v2 (#288)
* goreleaser: Migrate config to v2 - Remove changelog - Remove publish to Homebrew Tap * ci: Update GoReleaser action config * ci: Add write permission to `GITHUB_TOKEN` with GoReleaser
1 parent cf641bb commit 4d529ca

File tree

2 files changed

+15
-37
lines changed

2 files changed

+15
-37
lines changed

.github/workflows/release.yaml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,24 @@ on:
77
jobs:
88
goreleaser:
99
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: write
13+
1014
steps:
1115
- name: Checkout
1216
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
1318
- name: Setup Go
1419
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
1520
with:
16-
go-version: 1.19
21+
cache: true
22+
go-version-file: "go.mod"
23+
1724
- name: Run GoReleaser
1825
uses: goreleaser/goreleaser-action@9c156ee8a17a598857849441385a2041ef570552 # v6.3.0
1926
with:
20-
version: latest
21-
args: release --rm-dist
27+
version: "~> v2"
28+
args: release --clean
2229
env:
23-
# To upload Homebrew recipe to dtan4/homebrew-tools, we need a personal token
24-
# instead of Action's temporary token
25-
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# This is an example goreleaser.yaml file with some sane defaults.
22
# Make sure to check the documentation at http://goreleaser.com
3-
before:
4-
hooks:
5-
- make clean
6-
- go mod tidy
3+
version: 2
74
builds:
85
- ldflags:
96
- "-s -w -X github.com/dtan4/k8sec/version.version={{.Version}} -X github.com/dtan4/k8sec/version.commit={{.Commit}} -X github.com/dtan4/k8sec/version.date={{.Date}} -X github.com/dtan4/k8sec/version.builtBy=goreleaser"
@@ -14,42 +11,18 @@ builds:
1411
- linux
1512
- windows
1613
goarch:
17-
- 386
1814
- amd64
1915
- arm
2016
- arm64
2117
archives:
2218
- name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}'
23-
replacements:
24-
darwin: Darwin
25-
linux: Linux
26-
windows: Windows
27-
386: i386
28-
amd64: x86_64
2919
format_overrides:
3020
- goos: windows
31-
format: zip
21+
formats:
22+
- zip
3223
release:
3324
prerelease: auto
34-
brews:
35-
- tap:
36-
owner: dtan4
37-
name: homebrew-tools
38-
folder: Formula
39-
homepage: https://github.com/dtan4/k8sec
40-
description: CLI tool to manage Kubernetes Secrets easily
41-
skip_upload: auto # skip if the version is rc (e.g. v1.0.0-rc1)
42-
test: |
43-
system "#{bin}/k8sec", "version"
4425
checksum:
4526
name_template: 'checksums.txt'
4627
snapshot:
47-
name_template: "{{ .Tag }}-next"
48-
changelog:
49-
sort: asc
50-
filters:
51-
exclude:
52-
- '^docs:'
53-
- '^test:'
54-
- Merge pull request
55-
- Merge branch
28+
version_template: "{{ .Tag }}-next"

0 commit comments

Comments
 (0)