xmtop/ci/script.sh
Caleb Bassi 180ab4c804 Add .travis.yml and reconfigure release process
- travis-ci used to publish binaries to the GitHub releases tab on new release
- Will also publish .deb and .rpm packages
- Haven't gotten the checksums file to work yet
- OSX x86 also isn't working
- No longer using goreleaser to publish binaries
    - didn't support cgo cross compilation which made things difficult
- Remove obsolete Makefile
2019-02-07 00:27:21 -08:00

37 lines
879 B
Bash
Executable File

#!/usr/bin/env bash
GOARCH=${_GOARCH}
GOOS=${_GOOS}
if [[ ! ${GOARCH} ]]; then
exit
fi
env GOOS=${GOOS} GOARCH=${GOARCH} GOARM=${GOARM} go build -o ${NAME}
mkdir -p dist
if [[ ${GOARCH} == "arm64" ]]; then
FILE=${NAME}_${TRAVIS_BRANCH}_${GOOS}_arm8
else
FILE=${NAME}_${TRAVIS_BRANCH}_${GOOS}_${GOARCH}${GOARM}
fi
tar -czf dist/${FILE}.tgz ${NAME}
if [[ ${GOOS} == "linux" && ${GOARCH} == "amd64" ]]; then
VERSION=$(go run main.go -v) # used by nfpm
docker run --rm \
-v $PWD:/tmp/pkg \
-e VERSION=${VERSION} \
goreleaser/nfpm pkg \
--config /tmp/pkg/ci/nfpm.yml \
--target /tmp/pkg/dist/${FILE}.deb
docker run --rm \
-v $PWD:/tmp/pkg \
-e VERSION=${VERSION} \
goreleaser/nfpm pkg \
--config /tmp/pkg/ci/nfpm.yml \
--target /tmp/pkg/dist/${FILE}.rpm
fi