Skip to content

Commit

Permalink
Use automatic version numbers in release builds (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofalvai authored Aug 2, 2023
1 parent 6b164ed commit 1300c57
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
11 changes: 6 additions & 5 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@ builds:
- goos: linux
goarch: arm64
ldflags:
- -X github.com/bitrise-io/envman/version.Version={{ .Version }}
- -X github.com/bitrise-io/envman/version.Commit={{ .FullCommit }}
- -X github.com/bitrise-io/envman/version.BuildNumber={{ index .Env "BITRISE_BUILD_NUMBER" }}

archives:
# GitHub release should contain the raw binaries (no zip or tar.gz)
- format: binary
# Name format should match the curl install script
name_template: "{{ .ProjectName }}-{{ .Os }}-{{ .Arch }}"
replacements:
darwin: Darwin
linux: Linux
amd64: x86_64
name_template: >-
{{ .ProjectName }}-
{{- title .Os }}-
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
release:
github:
Expand Down
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func Run() {
app := cli.NewApp()
app.Name = path.Base(os.Args[0])
app.Usage = "Environment variable manager"
app.Version = version.VERSION
app.Version = version.Version

app.Author = ""
app.Email = ""
Expand Down
2 changes: 1 addition & 1 deletion cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func printVersionCmd(c *cli.Context) error {
}

versionOutput := VersionOutputModel{
Version: version.VERSION,
Version: version.Version,
}

if fullVersion {
Expand Down
4 changes: 2 additions & 2 deletions version/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package version

// VERSION ...
const VERSION = "2.4.0"
// Version is the main CLI version number. It's defined at build time using -ldflags
var Version = "0.99-development"

0 comments on commit 1300c57

Please sign in to comment.