mirror of
https://github.com/Luzifer/git-recurse-status.git
synced 2024-11-09 15:40:00 +00:00
Publish to Github
This commit is contained in:
parent
5a8e2e2316
commit
455f9178f1
3 changed files with 45 additions and 0 deletions
10
.repo-runner.yaml
Normal file
10
.repo-runner.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
image: "quay.io/luzifer/repo-runner-image"
|
||||||
|
checkout_dir: /go/src/github.com/Luzifer/git-recurse-status
|
||||||
|
|
||||||
|
commands:
|
||||||
|
- make ci
|
||||||
|
|
||||||
|
environment:
|
||||||
|
CGO_ENABLED: 0
|
4
Makefile
Normal file
4
Makefile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
default: ci
|
||||||
|
|
||||||
|
ci:
|
||||||
|
./publish.sh
|
31
publish.sh
Normal file
31
publish.sh
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
VERSION=$(git describe --tags --exact-match)
|
||||||
|
REPO=$(basename $(pwd))
|
||||||
|
ARCHS="linux/386 linux/amd64 linux/arm darwin/amd64 darwin/386 windows/amd64"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}"
|
||||||
|
sha256sum ${REPO}_* > SHA256SUMS
|
||||||
|
|
||||||
|
github-release release --user Luzifer --repo ${REPO} --tag ${VERSION} --name ${VERSION} --draft || true
|
||||||
|
|
||||||
|
for file in ${REPO}_* SHA256SUMS; do
|
||||||
|
github-release upload --user Luzifer --repo ${REPO} --tag ${VERSION} --name ${file} --file ${file}
|
||||||
|
done
|
Loading…
Reference in a new issue