ci: build changes
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
abs3nt 2023-03-04 23:42:01 -08:00
parent c0e975e139
commit 6f79719919
5 changed files with 10 additions and 7 deletions

View File

@ -17,6 +17,10 @@ builds:
ignore:
- goos: windows
goarch: "386"
# Custom ldflags templates.
# Default is `-s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser`.
ldflags:
- -s -w -X github.com/abs3ntdev/haunt/cmd.Version={{.Version}}
archives:
- format: tar.gz

View File

@ -4,10 +4,9 @@ pipeline:
commands:
- go mod tidy
- go build -o bin/haunt
- mkdir completions
- ./bin/haunt completion zsh > completions/haunt_zsh
- ./bin/haunt completion bash > completions/haunt_bash
- ./bin/haunt completion fish > completions/haunt_fish
when:
event: push
publish:
image: goreleaser/goreleaser
commands:

View File

@ -7,6 +7,8 @@ import (
"github.com/spf13/cobra"
)
var Version = "dev"
// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
@ -37,5 +39,5 @@ func init() {
// Version print current version
func version(cmd *cobra.Command, args []string) {
r := haunt.NewHaunt()
log.Println(r.Prefix(haunt.Green.Bold(haunt.RVersion)))
log.Println(r.Prefix(haunt.Green.Bold(Version)))
}

BIN
haunt Executable file

Binary file not shown.

View File

@ -18,8 +18,6 @@ import (
var (
// RPrefix tool name
RPrefix = "haunt"
// RVersion current version
RVersion = "v0.1.3"
// RExt file extension
RExt = ".yaml"
// RFile config file name