Skip to content

Commit

Permalink
Merge pull request #18 from cego/staal0-add-ldflags-to-workflow
Browse files Browse the repository at this point in the history
Adding github latest tag to ldflags
  • Loading branch information
staal0 authored Feb 6, 2024
2 parents 018bead + 4e35df2 commit a25e7bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ jobs:
fetch-depth: '0'

- name: Build
run: |
LATEST_TAG=$(git describe --tags)
go build -ldflags "-X main.Build=$LATEST_TAG" -v ./...
run: go build -v ./...

- name: Test
run: go test -v ./...
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
binary_name: "james"
extra_files: LICENSE README.md
sha256sum: true
ldflags: "-X main.Build=$(git describe --tags)"
ldflags: "-X main.Build=${GITHUB_REF#refs/tags/v}"

0 comments on commit a25e7bc

Please sign in to comment.