build: streamline gathering of facts, checkouts (#10158)

This commit is contained in:
Jakob Borg
2025-06-07 13:11:52 +02:00
committed by GitHub
parent e7f4f8306c
commit 5381178c46
2 changed files with 122 additions and 118 deletions
+4 -1
View File
@@ -922,6 +922,9 @@ func rmr(paths ...string) {
}
func getReleaseVersion() (string, error) {
if ver := os.Getenv("VERSION"); ver != "" {
return strings.TrimSpace(ver), nil
}
bs, err := os.ReadFile("RELEASE")
if err != nil {
return "", err
@@ -966,7 +969,7 @@ func getGitVersion() (string, error) {
}
func getVersion() string {
// First try for a RELEASE file,
// First try for a RELEASE file or $VERSION env var,
if ver, err := getReleaseVersion(); err == nil {
return ver
}