mirror of
https://github.com/Luzifer/yaml-vault.git
synced 2024-12-30 00:31:21 +00:00
Switch build system
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
44793facbb
commit
941793860a
3 changed files with 13 additions and 36 deletions
10
.repo-runner.yaml
Normal file
10
.repo-runner.yaml
Normal file
|
@ -0,0 +1,10 @@
|
|||
---
|
||||
|
||||
image: "reporunner/golang-alpine"
|
||||
checkout_dir: /go/src/github.com/Luzifer/yaml-vault
|
||||
|
||||
commands:
|
||||
- make publish
|
||||
|
||||
environment:
|
||||
CGO_ENABLED: 0
|
3
Makefile
Normal file
3
Makefile
Normal file
|
@ -0,0 +1,3 @@
|
|||
publish:
|
||||
curl -sSLo golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh
|
||||
bash golang.sh
|
36
publish.sh
36
publish.sh
|
@ -1,36 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
VERSION=$(git describe --tags --exact-match)
|
||||
REPO=$(basename $(pwd))
|
||||
ARCHS="linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/386 windows/amd64"
|
||||
|
||||
set -e
|
||||
|
||||
if [ -z "${TRAVIS_TAG}" ]; then
|
||||
echo "Not executing for non tag, but this is no failure."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
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}"
|
||||
sha256sum ${REPO}_* > SHA256SUMS
|
||||
|
||||
for file in ${REPO}_* SHA256SUMS; do
|
||||
github-release upload --user Jimdo --repo ${REPO} --tag ${VERSION} --name ${file} --file ${file}
|
||||
done
|
Loading…
Reference in a new issue