-- Leo's gemini proxy

-- Connecting to capsule.adrianhesketh.com:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

capsule.adrianhesketh.com


home


Releasing Versioned Go Apps From Travis


So, thanks to Redditor vruin, I learned that there's an easier way to add a version number than what I was doing:


https://www.atatus.com/blog/golang-auto-build-versioning/


The way described in the blog post uses the `-ldflags` `go build` parameter instead of my relatively convoluted approach of using `go generate` to create a version.go file. I just needed to make a couple of changes to the version scheme to make it work for me:


GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=`git describe --tags --long`" -o release/terminator

The next thing I needed to do was to package up those builds and push them back out to Github. I followed some excellent instructions, just making a few changes to take out the need for a `make` file:


https://loads.pickle.me.uk/2015/08/22/easy-peasy-github-releases-for-go-projects-using-travis/


I've put this into practice on my "Terminator" application at [0] and I'm now confident I can deploy new distributions of my applications automatically.


[0]


More


Next


Immutable Windows Infrastructure on AWS


Previous


Adding a Version Number to Go Packages with `go generate`


Home


home

-- Response ended

-- Page fetched on Sun Apr 28 01:52:50 2024