mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
ci: add version variable linkage to build command
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user