Skip to content

Commit abe3883

Browse files
authored
Fix goreleaser version (#667)
The release github action is currently broken: We were using the `latest` gorelease-action, which had changed from 1->2 recently. The main breaking change for us was that `--rm-dist` flag was replaced by `--clean` But this change causes some other changes: - Some smaller changes in the goreleaser config - To run the newest goreleaser, we have to upgrade to golang 1.23.0 - When using go 1.23.0, golangci-lint also needs upgrading - golanci-lint on the new version also has some config deprecations/changes But with all these changes, the local build/lint runs without errors or warnings and the dry-run gorelease also runs through (hopefully the same is the case in the github action).
1 parent 2a3754f commit abe3883

File tree

12 files changed

+35
-27
lines changed

12 files changed

+35
-27
lines changed

.github/workflows/branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Set up Go
3232
uses: actions/setup-go@v5
3333
with:
34-
go-version: "1.20"
34+
go-version: "1.23"
3535
id: go
3636

3737
- name: Bump patch version
@@ -60,7 +60,7 @@ jobs:
6060
- name: Set up Go
6161
uses: actions/setup-go@v5
6262
with:
63-
go-version: "1.20"
63+
go-version: "1.23"
6464
id: go
6565

6666
- name: Bump main version

.github/workflows/go.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- name: Set up Go
1111
uses: actions/setup-go@v5
1212
with:
13-
go-version: "1.20"
13+
go-version: "1.23"
1414
id: go
1515

1616
- name: Check out code into the Go module directory

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Go
2020
uses: actions/setup-go@v5
2121
with:
22-
go-version: "1.20"
22+
go-version: "1.23"
2323
id: go
2424

2525
- name: Cache Go Modules
@@ -62,8 +62,8 @@ jobs:
6262
OWNER: elastic
6363
REPO: ecctl
6464
with:
65-
version: latest
66-
args: release --rm-dist
65+
version: '~> v2'
66+
args: release --clean
6767

6868
- name: Run release post actions
6969
run: ./scripts/goreleaser-post-actions.sh $VERSION

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ vendor
33
dist
44
reports
55
.idea/
6-
html_docs/
6+
html_docs/
7+
ecctl.iml

.golangci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,21 @@ linters:
44
- lll
55
- gochecknoglobals
66
- gochecknoinits
7-
- scopelint
87
- funlen
98
- wsl
109
- gomnd
1110

1211
linters-settings:
1312
errcheck:
14-
exclude: build/errcheck-exclusions.txt
13+
exclude-functions:
14+
- (*github.com/spf13/cobra.Command).MarkFlagRequired
15+
- (*github.com/spf13/cobra.Command).MarkFlagFilename
16+
- github.com/spf13/cobra.MarkFlagRequired
17+
- github.com/spf13/cobra.MarkFlagFilename
18+
- github.com/spf13/cobra.MarkFlagFilename
19+
- (*github.com/spf13/cobra.Command).Help
20+
- (*github.com/spf13/viper.Viper).BindPFlags
21+
- (*github.com/spf13/pflag.FlagSet).MarkHidden
1522
govet:
1623
check-shadowing: false
1724

@@ -64,4 +71,6 @@ issues:
6471

6572

6673
output:
67-
format: tab
74+
formats:
75+
- format: tab
76+
path: stderr

.goreleaser.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
version: 2
12
project_name: ecctl
23
before:
34
hooks:
@@ -34,7 +35,7 @@ archives:
3435
- README*
3536
- docs/*
3637
snapshot:
37-
name_template: "{{ .Version }}_SNAPSHOT_{{ .ShortCommit }}"
38+
version_template: "{{ .Version }}_SNAPSHOT_{{ .ShortCommit }}"
3839
nfpms:
3940
- file_name_template: >-
4041
{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_

build/Makefile.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ changelog:
5656

5757
## Generates a snapshot of the potential release
5858
snapshot: deps
59-
@ $(GOBIN)/goreleaser release --rm-dist --snapshot --skip-validate
59+
@ $(GOBIN)/goreleaser release --clean --snapshot --skip-validate

build/Makefile.deps

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ VERSION_DIR:=$(GOBIN)/versions
66

77
VERSION_GOLICENSER:=v0.4.1
88
VERSION_GOLICENCEDETECTOR:=v0.6.0
9-
VERSION_GOLANGCILINT:=v1.54.2
9+
VERSION_GOLANGCILINT:=v1.61.0
1010
VERSION_GOBINDATA:=v0.0.0-20190711162640-ee3c2418e368
11-
VERSION_GORELEASER:=v1.21.2
11+
VERSION_GORELEASER:=v2.3.2
1212
VERSION_VERSIONBUMP:=v1.1.0
1313

14-
deps: $(GOBIN)/go-licenser $(GOBIN)/go-licence-detector $(GOBIN)/golangci-lint $(GOBIN)/go-bindata
14+
deps: $(GOBIN)/go-licenser $(GOBIN)/go-licence-detector $(GOBIN)/golangci-lint $(GOBIN)/go-bindata $(GOBIN)/goreleaser
1515

1616
$(GOBIN):
1717
@ mkdir -p $(GOBIN)
@@ -57,7 +57,7 @@ $(VERSION_DIR)/.version-goreleaser-$(VERSION_GORELEASER): | $(VERSION_DIR)
5757

5858
$(GOBIN)/goreleaser: $(VERSION_DIR)/.version-goreleaser-$(VERSION_GORELEASER) | $(GOBIN)
5959
@ echo "-> Installing goreleaser..."
60-
@ go install github.com/goreleaser/goreleaser@$(VERSION_GORELEASER)
60+
@ go install github.com/goreleaser/goreleaser/v2@$(VERSION_GORELEASER)
6161

6262
$(VERSION_DIR)/.version-versionbump-$(VERSION_VERSIONBUMP): | $(VERSION_DIR)
6363
@ rm -f $(VERSION_DIR)/.version-versionbump-*

build/Makefile.dev

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ _bindata:
4343
format: deps
4444
@ echo "-> Formatting Go files..."
4545
@ $(GOBIN)/go-licenser -license ASL2
46-
@ $(GOBIN)/golangci-lint run --fix --deadline=5m
46+
@ $(GOBIN)/golangci-lint run --fix --timeout 5m
4747
@ echo "-> Done."
4848

4949
## Generates the notice file
@@ -55,7 +55,7 @@ notice: deps
5555
.PHONY: lint
5656
lint: deps
5757
@ echo "-> Running linters..."
58-
@ $(GOBIN)/golangci-lint run --deadline=5m
58+
@ $(GOBIN)/golangci-lint run --timeout 5m
5959
@ $(GOBIN)/go-licenser -d .
6060
@ echo "-> Done."
6161

build/errcheck-exclusions.txt

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)