diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81591dfb..25fa122b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -170,7 +170,7 @@ jobs: echo "Building for ${GOOS}/${GOARCH} with GOOS=$GOOS, GOARCH=$GOARCH" echo "Excluding CUDA. Use the 'cuda' build tag to include it." - go build -o "build/lilypad-${GOOS}-${GOARCH}-cpu" -v -ldflags="-X 'github.com/lilypad-tech/lilypad/cmd/lilypad.VERSION=${{ needs.release.outputs.tag_name }}' -X 'github.com/lilypad-tech/lilypad/cmd/lilypad.COMMIT_SHA=${{ needs.release.outputs.sha }}'" + go build -o "build/lilypad-${GOOS}-${GOARCH}-cpu" -v -ldflags="-X 'github.com/lilypad-tech/lilypad/cmd/lilypad.version=${{ needs.release.outputs.tag_name }}' -X 'github.com/lilypad-tech/lilypad/cmd/lilypad.commitSHA=${{ needs.release.outputs.sha }}'" echo "-------------- OS: ${GOOS} : Arch: ${GOARCH} ---------- done" @@ -206,7 +206,7 @@ jobs: echo "CUDA_HOME: $CUDA_HOME" echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH" - go build -o "build/lilypad-${GOOS}-${GOARCH}-gpu" -v -tags cuda -ldflags="-X 'github.com/lilypad-tech/lilypad/cmd/lilypad.VERSION=${{ needs.release.outputs.tag_name }}' -X 'github.com/lilypad-tech/lilypad/cmd/lilypad.COMMIT_SHA=${{ needs.release.outputs.sha }}'" + go build -o "build/lilypad-${GOOS}-${GOARCH}-gpu" -v -tags cuda -ldflags="-X 'github.com/lilypad-tech/lilypad/cmd/lilypad.version=${{ needs.release.outputs.tag_name }}' -X 'github.com/lilypad-tech/lilypad/cmd/lilypad.commitSHA=${{ needs.release.outputs.sha }}'" echo "-------------- OS: ${GOOS} : Arch: ${GOARCH} ---------- done" diff --git a/cmd/lilypad/root.go b/cmd/lilypad/root.go index 0605cee6..48038777 100644 --- a/cmd/lilypad/root.go +++ b/cmd/lilypad/root.go @@ -19,7 +19,7 @@ func NewRootCmd() *cobra.Command { RootCmd := &cobra.Command{ Use: getCommandLineExecutable(), Short: "Lilypad", - Long: fmt.Sprintf("Lilypad: %s \nCommit: %s \n", VERSION, COMMIT_SHA), + Long: fmt.Sprintf("Lilypad: %s \nCommit: %s \n", version, commitSHA), } var network string diff --git a/cmd/lilypad/run.go b/cmd/lilypad/run.go index c796b270..37a34b97 100644 --- a/cmd/lilypad/run.go +++ b/cmd/lilypad/run.go @@ -57,8 +57,8 @@ func runJob(cmd *cobra.Command, options jobcreator.JobCreatorOptions) error { ⠀⠀⠀⠀⠀⠈⠙⠛⠛⠘⠛⠋⠁⠀ ⠀⠀⠀ Decentralized Compute Network https://lilypad.tech ` - if VERSION != "" { - header = strings.Replace(header, "v2", VERSION, 1) + if version != "" { + header = strings.Replace(header, "v2", version, 1) } c.Print(header) diff --git a/cmd/lilypad/version.go b/cmd/lilypad/version.go index fc7bc596..1d4ceaab 100644 --- a/cmd/lilypad/version.go +++ b/cmd/lilypad/version.go @@ -9,11 +9,10 @@ import ( "github.com/lilypad-tech/lilypad/pkg/system" ) -var VERSION string +var version string +var commitSHA string -var COMMIT_SHA string - -const GO_BINARY_URL = "https://github.com/lilypad-tech/lilypad/releases/" +const goBinaryURL = "https://github.com/lilypad-tech/lilypad/releases/" func newVersionCmd() *cobra.Command { options := optionsfactory.NewSolverOptions() @@ -37,14 +36,14 @@ func runVersion(cmd *cobra.Command) error { commandCtx := system.NewCommandContext(cmd) defer commandCtx.Cleanup() - if VERSION == "" { - fmt.Printf("version not found: download the latest binary from %s", GO_BINARY_URL) + if version == "" { + fmt.Printf("version not found: download the latest binary from %s", goBinaryURL) // unnecessary help shows up when returned as error, so shortciruting here return nil } - fmt.Printf("Lilypad: %s\n", VERSION) - fmt.Printf("Commit: %s\n", COMMIT_SHA) + fmt.Printf("Lilypad: %s\n", version) + fmt.Printf("Commit: %s\n", commitSHA) // TODO: suggest updating to the latest version if the current version is not the latest version