Skip to content

Commit

Permalink
try to add version to goreleaseR
Browse files Browse the repository at this point in the history
Signed-off-by: Chmouel Boudjnah <[email protected]>
  • Loading branch information
chmouel committed Apr 20, 2022
1 parent da7061d commit e2c696a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
before:
hooks:
- /bin/sh -c "echo {{.Tag}} > misc/version"

builds:
- env:
- CGO_ENABLED=0
Expand Down Expand Up @@ -40,7 +44,6 @@ brews:
(zsh_completion/"_gosmee").write output
prefix.install_metafiles
checksum:
name_template: "checksums.txt"

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ TARGET_URL ?= http://localhost:8080
SMEE_URL ?= https://smee.io/new
MD_FILES := $(shell find . -type f -regex ".*md" -not -regex '^./vendor/.*' -not -regex '^./.vale/.*' -not -regex "^./.git/.*" -print)

LDFLAGS := -s -w
FLAGS += -ldflags "$(LDFLAGS)"

all: test lint build

Expand All @@ -14,7 +16,7 @@ clean:
build: clean
@echo "building."
@mkdir -p bin/
@go build -v -ldflags="-s -w" -o bin/gosmee gosmee.go
@go build -v $(FLAGS) -o bin/gosmee gosmee.go

lint: lint-go lint-md

Expand Down
4 changes: 4 additions & 0 deletions gosmee.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ var shellScriptTmpl []byte
//go:embed misc/zsh_completion.zsh
var zshCompletion []byte

//go:embed misc/version
var Version []byte

//go:embed misc/bash_completion.bash
var bashCompletion []byte

Expand Down Expand Up @@ -272,6 +275,7 @@ func main() {
Name: "gosmee",
Usage: "forward smee url to local",
EnableBashCompletion: true,
Version: string(Version),
Commands: []*cli.Command{
{
Name: "completion",
Expand Down

0 comments on commit e2c696a

Please sign in to comment.