flamenco/magefiles/version.go
Sybren A. Stüvel 4b0cdfb735 Take release cycle from makefile instead of parsing the version
Take the release cycle from the `RELEASE_CYCLE` variable in the Makefile,
instead of parsing `VERSION`.

For alpha/beta/rc/release this doesn't matter, it was parsed correctly.
But other suffixes were all marked as "release", which wasn't correct.
2025-07-29 17:11:56 +02:00

34 lines
653 B
Go

//go:build mage
package main
import (
"fmt"
"github.com/magefile/mage/sh"
)
// To update the version number in all the relevant places, update the VERSION
// variable below and run `make update-version`.
const (
version = "3.8-alpha1"
releaseCycle = "alpha"
)
func gitHash() (string, error) {
return sh.Output("git", "rev-parse", "--short", "HEAD")
}
// Show which version information would be embedded in executables
func Version() error {
fmt.Printf("Package : %s\n", goPkg)
fmt.Printf("Version : %s\n", version)
hash, err := gitHash()
if err != nil {
return err
}
fmt.Printf("Git Hash : %s\n", hash)
return nil
}