Closed vdye closed 1 year ago
Overall, looks really good! The one thing I'm having trouble with is getting the new command to work locally (although I recognize this is probabaly just me holding it wrong). Here's what I'm seeing:
make
outputldennington@Lessleys-MBP:~/repos/git-bundle-server(vdye/version-cmd○) » make rm -f -r /Users/ldennington/repos/git-bundle-server/bin GOOS="darwin" GOARCH="amd64" go build -o /Users/ldennington/repos/git-bundle-server/bin -ldflags "-X 'github.com/github/git-bundle-server/cmd/utils.Version='" ./...
git-bundle-server version
outputldennington@Lessleys-MBP:~/repos/git-bundle-server(vdye/version-cmd○) » ./bin/git-bundle-server version git-bundle-server version <no version>
git tag --list
outputldennington@Lessleys-MBP:~/repos/git-bundle-server(vdye/version-cmd○) » git tag --list v0.0.1 v0.1.0 v0.1.1 v0.1.2 v0.2.0
@ldennington the issue is that none of those tags are on the main
branch, so they're not in the ancestry path searched by git describe
, so no version is found. If you locally tag the main
branch with v<something>
, does that work?
@ldennington the issue is that none of those tags are on the
main
branch, so they're not in the ancestry path searched bygit describe
, so no version is found. If you locally tag themain
branch withv<something>
, does that work?
That worked! Thanks for clarifying.
Closes #17
This pull request contains a smattering of CI/CD updates as well as the addition of the
git-bundle-server version
command.CI/CD changes
main.yml
workflow to runMakefile
targets rather than customgo (build|vet|test)
invocations.release.yml
to match only the exact set of patterns we want for releases (the previous pattern would allow tags likev1a.2b.3c-d.4ef
).git-bundle-server version
git-bundle-server version
command, which prints a (currently unset) globally-accessible version string compiled into the program.Makefile
to determine theVERSION
if it is not set by a user, then compiles that value intogit-bundle-server
using-ldflags
.CC: @jeffhostetler (since this is based on your recommendation in an earlier PR)