Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Version number in released binaries #20

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading