Add goreleaser

This commit is contained in:
Caleb Bassi 2018-04-09 18:07:36 -07:00
parent 39f7d34c50
commit b36602ca97
4 changed files with 25 additions and 31 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
gotop
build/
dist/

20
.goreleaser.yml Normal file
View File

@ -0,0 +1,20 @@
# Build Steps
# 1. update version number in `main.go` and `download.sh`
# 2. commit changes
# 3.
# 4. push changes to GitHub
# 5. update AUR package
builds:
- binary: gotop
goos:
- darwin
- linux
goarch:
- amd64
- 386
ignore:
- goos: darwin
goarch: 386
archive:
format: tgz

View File

@ -1,27 +0,0 @@
#!/usr/bin/env bash
# Build Steps
# 1. update version number in `main.go` and `download.sh`
# 2. run this script
# 3. publish binaries on GitHub
# 4. push changes to GitHub
# 5. update AUR package
# more info at https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
VERSION=$(go run main.go -v)
mkdir -p build
cd build
env GOOS=darwin GOARCH=amd64 go build -o gotop ../
tar czf gotop-$VERSION-darwin_amd64.tgz gotop
rm gotop
env GOOS=linux GOARCH=386 go build -o gotop ../
tar czf gotop-$VERSION-linux_386.tgz gotop
rm gotop
env GOOS=linux GOARCH=amd64 go build -o gotop ../
tar czf gotop-$VERSION-linux_amd64.tgz gotop
rm gotop

View File

@ -3,9 +3,10 @@
VERSION=1.2.3
download() {
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$VERSION-${1}.tgz > gotop.tgz
tar xf gotop.tgz
rm gotop.tgz
archive=gotop-$VERSION-${1}.tgz
curl -LO https://github.com/cjbassi/gotop/releases/download/$VERSION/$archive
tar xf $archive
rm $archive
}
arch=$(uname -sm)