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:
Cheviiot
2026-07-25 01:13:56 +10:00
parent 6464da7847
commit 699aa2f06e
2 changed files with 99 additions and 1 deletions
+5 -1
View File
@@ -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()