Closed rtfmoz2 closed 2 years ago
Testing output
rtfmoz@DESKTOP-H138G2U:/mnt/c/Users/Kevin/Projects/alpaca$ sh -x build.sh
+ git describe --tags
+ grep ^v
+ head -1
+ tag=v1.2.0-4-geb0c143
+ semver=1.2.0-4-geb0c143
+ version=1.2.0
+ date
+ go build -ldflags=-X 'main.BuildTime=Sun Apr 3 15:14:32 AEST 2022' -X 'main.BuildVersion=1.2.0'
rtfmoz@DESKTOP-H138G2U:/mnt/c/Users/Kevin/Projects/alpaca$ ./alpaca -v
Alpaca 1.2.0 built at Sun Apr 3 15:14:32 AEST 2022
rtfmoz@DESKTOP-H138G2U:/mnt/c/Users/Kevin/Projects/alpaca$
This PR addresses issue #11 - Versioning
Use the following bash script at build time (tested on ubuntu) with the commits provided. This pulls the version number from the git tag on the current repository and injects this into compilation using ldflags.