mirror of https://github.com/liamg/aminal.git
release script
This commit is contained in:
parent
76397d2115
commit
261424c9ec
|
@ -11,3 +11,4 @@ jobs:
|
|||
steps:
|
||||
- checkout
|
||||
- run: make test
|
||||
- run: make release
|
39
Makefile
39
Makefile
|
@ -1,6 +1,5 @@
|
|||
SHELL := /bin/bash
|
||||
BINARY := aminal
|
||||
VERSION ?= vlatest
|
||||
FONTPATH := ./gui/packed-fonts
|
||||
|
||||
.PHONY: build
|
||||
|
@ -23,6 +22,7 @@ install-tools:
|
|||
which dep || curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||
which packr || go get -u github.com/gobuffalo/packr/packr
|
||||
which github-release || go get -u github.com/aktau/github-release
|
||||
which xgo || go get github.com/karalabe/xgo
|
||||
|
||||
.PHONY: update-fonts
|
||||
update-fonts: install-tools
|
||||
|
@ -32,40 +32,5 @@ update-fonts: install-tools
|
|||
|
||||
.PHONY: release
|
||||
release: test install-tools
|
||||
echo -n "Enter a version: "
|
||||
read -s VERSION
|
||||
if [[ "${VERSION}" == "" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
mkdir -p release/bin/darwin/amd64/
|
||||
mkdir -p release/bin/linux/amd64/
|
||||
mkdir -p release/bin/linux/i386/
|
||||
GOOS=darwin GOARCH=amd64 go build -o release/bin/darwin/amd64/${BINARY}
|
||||
GOOS=linux GOARCH=amd64 go build -o release/bin/linux/amd64/${BINARY}
|
||||
GOOS=linux GOARCH=386 go build -o release/bin/linux/386/${BINARY}
|
||||
git tag "${VERSION}"
|
||||
git push origin "${VERSION}"
|
||||
github-release release \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "Aminal ${VERSION}"
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-osx-amd64" \
|
||||
--file release/bin/darwin/amd64/${BINARY}
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-linux-amd64" \
|
||||
--file release/bin/linux/amd64/${BINARY}
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-linux-386" \
|
||||
--file release/bin/linux/386/${BINARY}
|
||||
./scripts/release.sh
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
BINARY=aminal
|
||||
|
||||
if [[ "${CIRCLE_TAG}" == "" ]]; then
|
||||
exit 0 # no tag, nothing to release
|
||||
fi
|
||||
mkdir -p release/bin/darwin/amd64/
|
||||
mkdir -p release/bin/linux/amd64/
|
||||
mkdir -p release/bin/linux/i386/
|
||||
|
||||
# build for osx using xgo - this cannot be used for linux builds due to missing deps in the xgo containers
|
||||
xgo --targets=darwin/amd64 --dest=release/bin/darwin/amd64 -out ${BINARY} .
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
git tag "${VERSION}"
|
||||
git push origin "${VERSION}"
|
||||
github-release release \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "Aminal ${VERSION}"
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-osx-amd64" \
|
||||
--file release/bin/darwin/amd64/${BINARY}
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-linux-amd64" \
|
||||
--file release/bin/linux/amd64/${BINARY}
|
||||
github-release upload \
|
||||
--user liamg \
|
||||
--repo aminal \
|
||||
--tag "${VERSION}" \
|
||||
--name "${BINARY}-linux-386" \
|
||||
--file release/bin/linux/386/${BINARY}
|
Loading…
Reference in New Issue