Skip to content

Commit

Permalink
Fix: Version number in released binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
soumeh01 committed Nov 13, 2024
1 parent 33b9dcd commit 36aa7b3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ jobs:
steps:
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install go 1.22
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Build
run: |
make build/vidx2pidx
Expand Down
2 changes: 1 addition & 1 deletion cmd/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var flags struct {

// printVersionAndLicense prints out vidx2pidx current version and its license.
func printVersionAndLicense(file io.Writer) {
fmt.Fprintf(file, "vidx2pidx version %v %v\n", Version, License)
fmt.Fprintf(file, "vidx2pidx version %v %v\n", version, License)
}

// NewCli creates a new instance of vidx2pidx cli.
Expand Down
4 changes: 2 additions & 2 deletions cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

package main

// Version contains the version of vidx2pid.
// version contains the version of vidx2pid.
// Its value is collected in build time. See `make build/vidx2pidx`.
var Version string
var version string

// License is a hardcoded string specifying vidx2pidx's license.
const License = `Copyright 2021 Linaro
Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ all:

$(PROG): $(SOURCES)
@echo Building project
GOOS=$(OS) GOARCH=$(ARCH) go build -ldflags "-X main.Version=`git describe 2>/dev/null || echo unknown`" -o $(PROG) ./...
GOOS=$(OS) GOARCH=$(ARCH) go build -ldflags "-X main.version=`git describe 2>/dev/null || echo unknown`" -o $(PROG) ./...

run: $(PROG)
@./$(PROG) $(ARGS) || true
Expand Down

0 comments on commit 36aa7b3

Please sign in to comment.