diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 117b6eb..3b8cc3f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -2,11 +2,17 @@ version: 2 before: hooks: - - go mod tidy + - go mod tidy -v builds: - - ldflags: + - id: default + binary: steamcache2 + ldflags: + - -s + - -w + - -extldflags "-static" - -X s1d3sw1ped/SteamCache2/version.Version={{.Version}} + - -X s1d3sw1ped/SteamCache2/version.Date={{.Date}} env: - CGO_ENABLED=0 goos: @@ -14,19 +20,25 @@ builds: - windows goarch: - amd64 + - arm64 + ignore: + - goos: windows + goarch: arm64 + +checksum: + name_template: "checksums.txt" archives: - - formats: tar.gz - name_template: >- - {{ .ProjectName }}_ - {{- title .Os }}_ - {{- if eq .Arch "amd64" }}x86_64 - {{- else if eq .Arch "386" }}i386 - {{- else }}{{ .Arch }}{{ end }} - {{- if .Arm }}v{{ .Arm }}{{ end }} + - id: default + name_template: "{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}" + formats: tar.gz format_overrides: - goos: windows formats: zip + files: + - README.md + - LICENSE + - steamcache2 changelog: sort: asc @@ -36,12 +48,8 @@ changelog: - "^test:" release: - name_template: '{{.ProjectName}}-{{.Version}}' - footer: >- - - --- - - Released by [GoReleaser](https://github.com/goreleaser/goreleaser). + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + footer: "Copyright (c) 2025 s1d3sw1ped" gitea_urls: api: https://git.s1d3sw1ped.com/api/v1 diff --git a/cmd/root.go b/cmd/root.go index f5dabce..df831e8 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -56,7 +56,7 @@ var rootCmd = &cobra.Command{ logger.Logger = zerolog.New(writer).With().Timestamp().Logger() logger.Logger.Info(). - Msg("SteamCache2 " + version.Version + " starting...") + Msg("SteamCache2 " + version.Version + " " + version.Date + " starting...") address := ":80" diff --git a/cmd/version.go b/cmd/version.go index 4c58998..020146b 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -15,7 +15,7 @@ var versionCmd = &cobra.Command{ Short: "prints the version of SteamCache2", Long: `Prints the version of SteamCache2. This command is useful for checking the version of the application.`, Run: func(cmd *cobra.Command, args []string) { - fmt.Fprintln(os.Stderr, "SteamCache2", version.Version) + fmt.Fprintln(os.Stderr, "SteamCache2", version.Version, version.Date) }, } diff --git a/version/version.go b/version/version.go index 5d29353..99c307c 100644 --- a/version/version.go +++ b/version/version.go @@ -1,10 +1,16 @@ // version/version.go package version +import "time" + var Version string +var Date string func init() { if Version == "" { Version = "0.0.0-dev" } + if Date == "" { + Date = time.Now().Format("2006-01-02 15:04:05") + } }