Skip to content

Commit

Permalink
fix: magefile release build
Browse files Browse the repository at this point in the history
  • Loading branch information
c-seeger committed Dec 18, 2023
1 parent 51c6a0f commit 6dba2eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ func CreateRelease() error {
return err
}

err = sh.RunV("go", "build", "-a", "-tags", "netgo", "-o", path+binName, "-ldflags", "-w -extldflags \"-static\"")
tag, _ := exec.Command("bash", "-c", "git tag --sort=-version:refname | head -n 1").Output()

err = sh.RunV("go", "build", "-a", "-tags", "netgo", "-o", path+binName, "-ldflags", "-w -extldflags \"-static\" -X 'main.Version="+string(tag)+"'")
if err != nil {
return err
}
Expand Down

0 comments on commit 6dba2eb

Please sign in to comment.