File tree Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Expand file tree Collapse file tree 5 files changed +68
-0
lines changed Original file line number Diff line number Diff line change 1+ name : goreleaser
2+
3+ on :
4+ push :
5+ tags :
6+ - " *"
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ goreleaser :
13+ runs-on : ubuntu-latest
14+ steps :
15+ - name : Checkout
16+ uses : actions/checkout@v4
17+ with :
18+ fetch-depth : 0
19+ - name : Set up Go
20+ uses : actions/setup-go@v5
21+ - name : Run GoReleaser
22+ uses : goreleaser/goreleaser-action@v6
23+ with :
24+ distribution : goreleaser
25+ version : " ~> v2"
26+ args : release --clean
27+ env :
28+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ dist /
Original file line number Diff line number Diff line change 1+ version : 2
2+
3+ project_name : my-cli
4+
5+ builds :
6+ - binary : my-cli
7+ ldflags :
8+ # I put a fixed value to check if the problem was in the {{.Version}} variable or not
9+ # Even using a fixed value the version is not setted in main.Version variable
10+ - -s -w -X main.Version={{.Version}}
11+ env :
12+ - CGO_ENABLED=0
13+ goos :
14+ - linux
15+ - darwin
16+ goarch :
17+ - amd64
18+ - arm64
19+
20+ archives :
21+ - formats : [tar.gz]
22+ name_template : >-
23+ {{ .ProjectName }}_
24+ {{- title .Os }}_
25+ {{- if eq .Arch "amd64" }}x86_64
26+ {{- else if eq .Arch "386" }}i386
27+ {{- else }}{{ .Arch }}{{ end }}
Original file line number Diff line number Diff line change 1+ module issue396
2+
3+ go 1.22.12
Original file line number Diff line number Diff line change 1+ package main
2+
3+ import "fmt"
4+
5+ var Version = "dev"
6+
7+ func main () {
8+ fmt .Printf ("version: %s 👍\n " , Version )
9+ }
You can’t perform that action at this time.
0 commit comments