This is a build issue: you need to be able to include in your compiled delivery the checksum which shows from which sources said deliverable has been compiled.
It depends on your compilation language.
Go, for instance, would use build flags (as in this example):
go build -i -v -ldflags="-X main.version=$(git describe --always --long --dirty)" github.com/MyUserName/MyProject
Travis-CI would use the same ldflags, but with a fixed value.
This example simply add the Git commit as a flag.
script:
- go get -t -v ./...
- diff -u <(echo -n) <(gofmt -d .)
- go vet $(go list ./... | grep -v /vendor/)
- go test -v -race ./...
# Only build binaries from the latest Go release.
- if [ "${LATEST}" = "true" ]; then gox -os="linux darwin windows" \
-arch="amd64" -output="logshare.." \
-ldflags "-X main.Rev=`git rev-parse --short HEAD`" -verbose ./...; fi
Again, this is a build step, before the deployment step.
And it is illustrated for Go, but the idea remain for any other language.
At runtime, the program is able to display its version, and let the user know of the GitHub reference: they can check that reference is the one used for the build.
Alternative approach: signing a docker image
Then your Travis-CI could apply that on build stages for sharing that image.
But you will need to manage the Docker Content Trust (DCT) keys.