Skip to content

Commit a23f3f9

Browse files
committed
Fix goreleaser config
1 parent 4499892 commit a23f3f9

File tree

3 files changed

+11
-20
lines changed

3 files changed

+11
-20
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: goreleaser
22

33
on:
4-
pull_request:
4+
workflow_dispatch:
55
push:
66
# run only against tags
77
tags:

.goreleaser.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ version: 2
33
before:
44
hooks:
55
- go mod tidy
6+
- go test
67

78
builds:
8-
- main: ./cmd/retro-sort.go
9+
- main: ./cmd/retro-sort/main.go
910
binary: retro-sort
1011
env:
1112
- CGO_ENABLED=0
@@ -15,30 +16,22 @@ builds:
1516
- darwin
1617

1718
archives:
18-
- format: tar.gz
19-
# this name template makes the OS and Arch compatible with the results of `uname`.
19+
- format: zip
2020
name_template: >-
2121
{{ .ProjectName }}_
22-
{{- title .Os }}_
22+
{{- if eq .Os "darwin" }}MacOS
23+
{{- else}}{{- title .Os }}{{ end }}_
2324
{{- if eq .Arch "amd64" }}x86_64
2425
{{- else if eq .Arch "386" }}i386
2526
{{- else }}{{ .Arch }}{{ end }}
2627
{{- if .Arm }}v{{ .Arm }}{{ end }}
27-
# use zip for windows archives
28-
format_overrides:
29-
- goos: windows
30-
format: zip
28+
files:
29+
- LICENSE
30+
- README.md
3131

3232
changelog:
3333
sort: asc
3434
filters:
3535
exclude:
3636
- "^docs:"
3737
- "^test:"
38-
39-
release:
40-
footer: >-
41-
42-
---
43-
44-
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).

cmd/retro-sort/main.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"maps"
66
"os"
7-
"runtime/debug"
87
"slices"
98

109
"github.com/spf13/cobra"
@@ -18,6 +17,7 @@ var upperCase bool
1817
var printOnly bool
1918
var quiet bool
2019
var tosec bool
20+
var version = "git"
2121

2222
func init() {
2323
rootCmd.Flags().IntVarP(&size, "size", "s", 100, "Maximum number of directory entries")
@@ -27,9 +27,7 @@ func init() {
2727
rootCmd.Flags().BoolVarP(&quiet, "quiet", "q", false, "Don't print anything, just do it")
2828
rootCmd.Flags().BoolVar(&tosec, "tosec", false, "Experimental: Detect TOSEC filenames and group related files")
2929

30-
if b, ok := debug.ReadBuildInfo(); ok {
31-
rootCmd.Version = b.Main.Version
32-
}
30+
rootCmd.Version = version
3331
}
3432

3533
var rootCmd = &cobra.Command{

0 commit comments

Comments
 (0)