From d4670df678806e1534f0940ff02d5d9e8ce6c084 Mon Sep 17 00:00:00 2001 From: ostiwe Date: Wed, 20 Aug 2025 01:37:44 +0300 Subject: [PATCH] refactor(ci): Set application version by ci on build --- .goreleaser.yaml | 3 +++ version/version.go | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 673e0a8..881a8ce 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -11,6 +11,9 @@ builds: - linux - windows - darwin + ldflags: + - -s -w + - -X 'git.ostiwe.com/ostiwe-com/status/version/version.ApplicationVersion={{.Tag}}' archives: - formats: [tar.gz] diff --git a/version/version.go b/version/version.go index b442223..1a08266 100644 --- a/version/version.go +++ b/version/version.go @@ -1,5 +1,7 @@ package version +var ApplicationVersion string = "dev" // These value will be injected at build time, DO NOT EDIT. + func AppVersion() string { - return "1.0.1" + return ApplicationVersion }