Finally got versions baked into the builds
continuous-integration/drone/push Build is failing Details

main
Nick Dumas 2 years ago
parent 7c38d9ae71
commit 04919ea208

@ -82,11 +82,12 @@ BENCHCPUS ?= 1,2,4
# Commands
GOCMD = go
ARCHES ?= 386 amd64
ARCHES ?= amd64 386
OSES ?= windows linux darwin
OUTTPL = $(DISTDIR)/$(NAME)-$(VERSION)-{{.OS}}_{{.Arch}}/{{.Dir}}
LDFLAGS = -X $(PKG).Version=$(VERSION) -X $(PKG).Build=$(COMMIT_ID)
GOBUILD = gox -rebuild -gocmd="$(GOCMD)" -arch="$(ARCHES)" -os="$(OSES)" -output="$(OUTTPL)" -tags "$(BUILD_TAGS)" -ldflags "$(LDFLAGS)"
GOBUILD_SIMPLE = go build -tags "$(BUILD_TAGS)" -ldflags "$(LDFLAGS)"
GOCLEAN = $(GOCMD) clean
GOINSTALL = $(GOCMD) install -a -tags "$(BUILD_TAGS)" -ldflags "$(LDFLAGS)"
GOTEST = $(GOCMD) test -v -tags "$(BUILD_TAGS)"

@ -7,10 +7,8 @@ import (
"fmt"
"github.com/spf13/cobra"
)
var (
Version, Tag string
"code.ndumas.com/ndumas/obsidian-pipeline"
)
// rootCmd represents the base command when called without any subcommands
@ -20,7 +18,7 @@ var versionCmd = &cobra.Command{
Long: `displays git tag and sha
`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("%s %s\n", Version, Tag)
fmt.Printf("Version: %s Build: %s\n", obp.Version, obp.Build)
},
}

@ -3,14 +3,10 @@ Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
package main
import "code.ndumas.com/ndumas/obsidian-pipeline/cmd/obp/cmd"
var (
Version, Tag string
import (
"code.ndumas.com/ndumas/obsidian-pipeline/cmd/obp/cmd"
)
func main() {
cmd.Version = Version
cmd.Tag = Tag
cmd.Execute()
}

@ -0,0 +1,5 @@
package obp
var (
Version, Build string
)
Loading…
Cancel
Save