Skip to content

Commit

Permalink
chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
jackstar12 committed Feb 5, 2024
1 parent bd0a1ad commit 0caec61
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKG := github.com/BoltzExchange/boltz-client
VERSION := 1.3.0-beta
VERSION := 2.0.0-beta

PKG_BOLTZD := github.com/BoltzExchange/boltz-client/cmd/boltzd
PKG_BOLTZ_CLI := github.com/BoltzExchange/boltz-client/cmd/boltzcli
Expand All @@ -12,7 +12,7 @@ GORUN := CGO_ENABLED=1 GO111MODULE=on go run -v
GOINSTALL := CGO_ENABLED=1 GO111MODULE=on go install -v

COMMIT := $(shell git log --pretty=format:'%h' -n 1)
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT) -w -s"
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT) -X $(PKG)/build.Version=$(VERSION) -w -s"

XARGS := xargs -L 1

Expand Down
8 changes: 5 additions & 3 deletions build/version.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package build

var Commit string

const version = "1.3.0-rc1"
var Version string

func GetVersion() string {
basicVersion := "v" + version
if Version == "" {
return Commit
}
basicVersion := "v" + Version

if Commit == "" {
return basicVersion
Expand Down
5 changes: 3 additions & 2 deletions build/version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
)

func TestGetVersion(t *testing.T) {
assert.Equal(t, "v"+version, GetVersion())
Version = "1.0.0"
assert.Equal(t, "v"+Version, GetVersion())

Commit = "123"
assert.Equal(t, "v"+version+"-"+Commit, GetVersion())
assert.Equal(t, "v"+Version+"-"+Commit, GetVersion())
}

0 comments on commit 0caec61

Please sign in to comment.