mirror of
https://github.com/Cheviiot/Vintner.git
synced 2026-08-03 15:57:24 +00:00
Add version flag and CI release workflow
version is now settable via -ldflags -X for tagged builds instead of a hardcoded "dev" string. .github/workflows/release.yml cross-compiles linux/amd64 and linux/arm64 binaries on tag push (or manual dispatch), and publishes them to a GitHub Release with checksums - the artifact packaging (Nivora's Staplerfile, `go install`) is expected to consume from there.
This commit is contained in:
@@ -15,6 +15,10 @@ import (
|
||||
"github.com/Cheviiot/msvc-go-wine/internal/wrapper"
|
||||
)
|
||||
|
||||
// version is set at build time via -ldflags "-X main.version=X.Y.Z";
|
||||
// left as "dev" for plain `go build`/`go run`.
|
||||
var version = "dev"
|
||||
|
||||
func main() {
|
||||
base := filepath.Base(os.Args[0])
|
||||
name := strings.TrimSuffix(strings.ToLower(base), ".exe")
|
||||
@@ -43,7 +47,7 @@ func runCLI(args []string) int {
|
||||
case "env":
|
||||
return runEnv(args[1:])
|
||||
case "version":
|
||||
fmt.Println("msvc-go-wine dev")
|
||||
fmt.Println("msvc-go-wine " + version)
|
||||
return 0
|
||||
case "-h", "--help", "help":
|
||||
printUsage()
|
||||
|
||||
Reference in New Issue
Block a user