Add goreleaser
This commit is contained in:
parent
39f7d34c50
commit
b36602ca97
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
gotop
|
gotop
|
||||||
build/
|
dist/
|
||||||
|
|
20
.goreleaser.yml
Normal file
20
.goreleaser.yml
Normal 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
|
27
build.sh
27
build.sh
|
@ -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
|
|
|
@ -3,9 +3,10 @@
|
||||||
VERSION=1.2.3
|
VERSION=1.2.3
|
||||||
|
|
||||||
download() {
|
download() {
|
||||||
curl -L https://github.com/cjbassi/gotop/releases/download/$VERSION/gotop-$VERSION-${1}.tgz > gotop.tgz
|
archive=gotop-$VERSION-${1}.tgz
|
||||||
tar xf gotop.tgz
|
curl -LO https://github.com/cjbassi/gotop/releases/download/$VERSION/$archive
|
||||||
rm gotop.tgz
|
tar xf $archive
|
||||||
|
rm $archive
|
||||||
}
|
}
|
||||||
|
|
||||||
arch=$(uname -sm)
|
arch=$(uname -sm)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user