Merge pull request 'Update versioning and logging in SteamCache2' (#7) from fix/goreleaser-config into main
Some checks failed
Release Tag / release (push) Failing after 22s

Reviewed-on: s1d3sw1ped/SteamCache2#7
This commit is contained in:
2025-07-19 07:59:02 +00:00
4 changed files with 32 additions and 18 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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)
},
}

View File

@@ -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")
}
}