diff --git a/ci/build_test_release.go b/ci/build_test_release.go index 23194aa..6bf7408 100644 --- a/ci/build_test_release.go +++ b/ci/build_test_release.go @@ -42,6 +42,9 @@ func main() { buildDir := test.Directory("/src_d/src/") + Coco_var := os.Getenv("Coco_Version") + + for _, goos := range geese { path := fmt.Sprintf("/dist/") filename := fmt.Sprintf("/dist/cocommit-%s", goos) @@ -50,7 +53,7 @@ func main() { build := test. WithEnvVariable("GOOS", goos). WithEnvVariable("GOARCH", goarch). - WithExec([]string{"go", "build", "-o", filename}).WithEnvVariable("CI", "true") + WithExec([]string{"go", "build", "-o", filename, "-ldflags", "-X github.com/Slug-Boi/cocommit/src/cmd.Coco_Version="+Coco_var}).WithEnvVariable("CI", "true") buildDir = buildDir.WithDirectory(path, build.Directory(path)) @@ -63,7 +66,7 @@ func main() { build := test. WithEnvVariable("GOOS", "darwin"). WithEnvVariable("GOARCH", "arm64"). - WithExec([]string{"go", "build", "-o", filename}).WithEnvVariable("CI", "true") + WithExec([]string{"go", "build", "-o", filename, "-ldflags", "-X github.com/Slug-Boi/cocommit/src/cmd.Coco_Version="+Coco_var}).WithEnvVariable("CI", "true") buildDir = buildDir.WithDirectory(path, build.Directory(path))