diff --git a/.gitignore b/.gitignore index 00c3410..5e18e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ gotop -build/ +dist/ diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..5984d05 --- /dev/null +++ b/.goreleaser.yml @@ -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 diff --git a/build.sh b/build.sh deleted file mode 100755 index abf0eb5..0000000 --- a/build.sh +++ /dev/null @@ -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 diff --git a/download.sh b/download.sh index 7296f27..ddecfd1 100755 --- a/download.sh +++ b/download.sh @@ -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)