mirror of
https://github.com/Luzifer/vault-unseal.git
synced 2024-12-22 13:51:20 +00:00
Publish binaries to Github
This commit is contained in:
parent
88cd33d224
commit
726d2ff6c4
2 changed files with 36 additions and 0 deletions
7
.travis.yml
Normal file
7
.travis.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
language: go
|
||||||
|
|
||||||
|
go:
|
||||||
|
- 1.7
|
||||||
|
|
||||||
|
script:
|
||||||
|
- ./publish.sh
|
29
publish.sh
Executable file
29
publish.sh
Executable file
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
VERSION=$(git describe --tags --exact-match)
|
||||||
|
REPO=$(basename $(pwd))
|
||||||
|
ARCHS="linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386"
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ -z "${VERSION}" ]; then
|
||||||
|
echo "No tag present, stopping build now."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${GITHUB_TOKEN}" ]; then
|
||||||
|
echo "Please set \$GITHUB_TOKEN environment variable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
go get github.com/aktau/github-release
|
||||||
|
go get github.com/mitchellh/gox
|
||||||
|
|
||||||
|
github-release release --user Jimdo --repo ${REPO} --tag ${VERSION} --name ${VERSION} || true
|
||||||
|
|
||||||
|
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}"
|
||||||
|
for file in ${REPO}_*; do
|
||||||
|
github-release upload --user Jimdo --repo ${REPO} --tag ${VERSION} --name ${file} --file ${file}
|
||||||
|
done
|
Loading…
Reference in a new issue