File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ name : Format
3+
4+ on :
5+ pull_request :
6+ branches : [main]
7+ paths :
8+ - " **/*.go"
9+ - " .github/workflows/format.yml"
10+
11+ permissions :
12+ contents : read
13+
14+ jobs :
15+ format-check :
16+ name : Format Check
17+ runs-on : ubuntu-latest
18+ steps :
19+ - name : Checkout
20+ uses : actions/checkout@v4
21+
22+ - name : Setup Go
23+ uses : actions/setup-go@v5
24+ with :
25+ go-version-file : go.mod
26+ cache : true
27+
28+ - name : Check formatting
29+ run : |
30+ if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
31+ echo "The following files are not properly formatted:";
32+ gofmt -s -l .;
33+ echo "";
34+ echo "Please run 'go fmt ./...' to fix formatting issues.";
35+ exit 1;
36+ fi
Original file line number Diff line number Diff line change 1+ ---
2+ name : Lint
3+
4+ on :
5+ pull_request :
6+ branches : [main]
7+ paths :
8+ - " **/*.go"
9+ - " .golangci.yml"
10+ - " go.mod"
11+ - " go.sum"
12+ - " .github/workflows/lint.yml"
13+
14+ permissions :
15+ contents : read
16+
17+ jobs :
18+ golangci :
19+ name : golangci-lint
20+ runs-on : ubuntu-latest
21+ steps :
22+ - name : Checkout
23+ uses : actions/checkout@v4
24+
25+ - name : Setup Go
26+ uses : actions/setup-go@v5
27+ with :
28+ go-version-file : go.mod
29+ cache : true
30+
31+ - name : Run golangci-lint
32+ uses : golangci/golangci-lint-action@v6
33+ with :
34+ version : latest
35+ args : --timeout=5m
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - ' v*.*.*'
7+
8+ permissions :
9+ contents : write
10+
11+ concurrency :
12+ group : release-${{ github.ref }}
13+ cancel-in-progress : true
14+
15+ jobs :
16+ goreleaser :
17+ name : Release with GoReleaser
18+ runs-on : ubuntu-latest
19+ steps :
20+ - name : Checkout
21+ uses : actions/checkout@v4
22+ with :
23+ # GoReleaser needs full history for changelog generation
24+ fetch-depth : 0
25+
26+ - name : Setup Go
27+ uses : actions/setup-go@v5
28+ with :
29+ go-version-file : go.mod
30+ cache : true
31+
32+ - name : Run GoReleaser
33+ uses : goreleaser/goreleaser-action@v6
34+ with :
35+ distribution : goreleaser
36+ version : latest
37+ args : release --clean
38+ env :
39+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ ---
2+ name : Tests
3+
4+ on :
5+ pull_request :
6+ branches : [ main ]
7+ paths :
8+ - ' **/*.go'
9+ - ' go.mod'
10+ - ' go.sum'
11+ - ' .github/workflows/tests.yml'
12+
13+ permissions :
14+ contents : read
15+
16+ jobs :
17+ unit-tests :
18+ name : Unit Tests
19+ runs-on : ubuntu-latest
20+ steps :
21+ - name : Checkout
22+ uses : actions/checkout@v4
23+
24+ - name : Setup Go
25+ uses : actions/setup-go@v5
26+ with :
27+ go-version-file : go.mod
28+ cache : true
29+
30+ - name : Download deps
31+ run : go mod download
32+
33+ - name : Run tests
34+ run : go test -v -race
Original file line number Diff line number Diff line change 1+ # GoReleaser config for brokli
2+ # See https://goreleaser.com for reference
3+
4+ project_name : brokli
5+
6+ before :
7+ hooks :
8+ - go mod tidy
9+
10+ builds :
11+ - id : brokli
12+ main : .
13+ binary : brokli
14+ env :
15+ - CGO_ENABLED=0
16+ flags :
17+ - -trimpath
18+ ldflags :
19+ - -s -w
20+ goos : [linux, darwin, windows]
21+ goarch : [amd64, arm64]
22+ goarm : ["7"]
23+
24+ archives :
25+ - id : release-archives
26+ builds : [brokli]
27+ name_template : ' {{ .ProjectName }}_{{ .Os }}_{{ .Arch }}'
28+ format_overrides :
29+ - goos : windows
30+ format : zip
31+
32+ checksum :
33+ name_template : ' SHA256SUMS.txt'
34+
35+ changelog :
36+ use : github
37+ filters :
38+ exclude :
39+ - ' ^docs:'
40+ - ' ^chore:'
41+
42+ release :
43+ # Mark pre-releases if the tag contains a hyphen (e.g., v1.0.0-rc1)
44+ prerelease : auto
Original file line number Diff line number Diff line change @@ -84,6 +84,31 @@ tasks:
8484 generates :
8585 - " {{.BINARY_NAME}}"
8686
87+ # Release (GoReleaser)
88+ goreleaser-install :
89+ desc : " Install GoReleaser CLI"
90+ cmd : go install github.com/goreleaser/goreleaser/v2@latest
91+
92+ release-check :
93+ desc : " Validate GoReleaser configuration"
94+ cmds :
95+ - |
96+ if ! command -v goreleaser >/dev/null 2>&1; then
97+ echo "GoReleaser not found. Install it with: task goreleaser-install";
98+ exit 1;
99+ fi
100+ - goreleaser check
101+
102+ release-snapshot :
103+ desc : " Build a local snapshot release (no publish)"
104+ cmds :
105+ - |
106+ if ! command -v goreleaser >/dev/null 2>&1; then
107+ echo "GoReleaser not found. Install it with: task goreleaser-install";
108+ exit 1;
109+ fi
110+ - goreleaser release --snapshot --clean
111+
87112 # Maintenance
88113 clean :
89114 desc : " Clean build artifacts and temporary files"
Original file line number Diff line number Diff line change @@ -3,12 +3,12 @@ module github.com/endlesstrax/brokli
33go 1.24.0
44
55require (
6+ github.com/fatih/color v1.18.0
67 github.com/spf13/cobra v1.10.1
78 golang.org/x/net v0.44.0
89)
910
1011require (
11- github.com/fatih/color v1.18.0 // indirect
1212 github.com/inconshreveable/mousetrap v1.1.0 // indirect
1313 github.com/mattn/go-colorable v0.1.13 // indirect
1414 github.com/mattn/go-isatty v0.0.20 // indirect
You can’t perform that action at this time.
0 commit comments