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+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+
8+ permissions :
9+ contents : write
10+
11+ jobs :
12+ release :
13+ runs-on : ubuntu-latest
14+
15+ steps :
16+ - name : Checkout repository
17+ uses : actions/checkout@v4
18+ with :
19+ fetch-depth : 0
20+ persist-credentials : false
21+
22+ - name : Setup Go
23+ uses : actions/setup-go@v5
24+ with :
25+ go-version-file : go.mod
26+
27+ - name : Run GoReleaser
28+ uses : goreleaser/goreleaser-action@v6
29+ with :
30+ distribution : goreleaser
31+ version : " ~> v2"
32+ args : release --clean
33+ env :
34+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1+ version : 2
2+
3+ project_name : devlocal
4+
5+ before :
6+ hooks :
7+ - go mod tidy
8+
9+ builds :
10+ - id : devlocal
11+ binary : devlocal
12+ main : .
13+ env :
14+ - CGO_ENABLED=0
15+
16+ goos :
17+ - windows
18+ - linux
19+ - darwin
20+
21+ goarch :
22+ - amd64
23+ - arm64
24+
25+ ldflags :
26+ - >-
27+ -s -w
28+ -X github.com/RohitRavindra-dev/devlocal/internal/config.Version={{ .Version }}
29+ -X github.com/RohitRavindra-dev/devlocal/internal/config.Commit={{ .Commit }}
30+ -X github.com/RohitRavindra-dev/devlocal/internal/config.Date={{ .Date }}
31+
32+ archives :
33+ - formats : [zip]
34+ name_template : >-
35+ {{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}
36+
37+ checksum :
38+ name_template : checksums.txt
39+
40+ release :
41+ draft : false
42+ prerelease : auto
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ var versionCmd = &cobra.Command{
1111 Use : "version" ,
1212 Short : "Print version information" ,
1313 Run : func (cmd * cobra.Command , args []string ) {
14- fmt .Println ("devlocal" , config .Version )
14+ fmt .Println ("[ devlocal] " , config .Version , config . Commit )
1515 },
1616}
1717
Original file line number Diff line number Diff line change 99
1010var (
1111 Version = "dev"
12+ Commit = "none"
13+ Date = "unknown"
1214)
You can’t perform that action at this time.
0 commit comments