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:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run: make test
|
- run: make test
|
||||||
|
- run: make release
|
39
Makefile
39
Makefile
|
@ -1,6 +1,5 @@
|
||||||
SHELL := /bin/bash
|
SHELL := /bin/bash
|
||||||
BINARY := aminal
|
BINARY := aminal
|
||||||
VERSION ?= vlatest
|
|
||||||
FONTPATH := ./gui/packed-fonts
|
FONTPATH := ./gui/packed-fonts
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
|
@ -23,6 +22,7 @@ install-tools:
|
||||||
which dep || curl -L https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
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 packr || go get -u github.com/gobuffalo/packr/packr
|
||||||
which github-release || go get -u github.com/aktau/github-release
|
which github-release || go get -u github.com/aktau/github-release
|
||||||
|
which xgo || go get github.com/karalabe/xgo
|
||||||
|
|
||||||
.PHONY: update-fonts
|
.PHONY: update-fonts
|
||||||
update-fonts: install-tools
|
update-fonts: install-tools
|
||||||
|
@ -32,40 +32,5 @@ update-fonts: install-tools
|
||||||
|
|
||||||
.PHONY: release
|
.PHONY: release
|
||||||
release: test install-tools
|
release: test install-tools
|
||||||
echo -n "Enter a version: "
|
./scripts/release.sh
|
||||||
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}
|
|
||||||
|
|
|
@ -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