xmtop/build.sh

28 lines
670 B
Bash
Raw Normal View History

2018-02-22 05:08:22 +08:00
#!/usr/bin/env bash
2018-03-05 10:30:02 +08:00
# Build Steps
2018-03-10 12:33:29 +08:00
# 1. update version number in `gotop.go` and `download.sh`
2018-03-05 10:30:02 +08:00
# 2. run this script
# 3. publish binaries on GitHub
2018-03-10 08:35:05 +08:00
# 4. push changes to GitHub
# 5. update AUR package
2018-03-05 10:30:02 +08:00
# more info at https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
2018-02-22 05:08:22 +08:00
VERSION=$(go run gotop.go -v)
2018-03-10 12:33:29 +08:00
mkdir build
cd build
2018-03-05 10:30:02 +08:00
env GOOS=darwin GOARCH=amd64 go build ../
2018-02-22 05:08:22 +08:00
tar czf gotop-$VERSION-darwin_amd64.tgz gotop
rm gotop
2018-03-05 10:30:02 +08:00
env GOOS=linux GOARCH=386 go build ../
2018-02-22 05:08:22 +08:00
tar czf gotop-$VERSION-linux_386.tgz gotop
rm gotop
2018-03-05 10:30:02 +08:00
env GOOS=linux GOARCH=amd64 go build ../
2018-02-22 05:08:22 +08:00
tar czf gotop-$VERSION-linux_amd64.tgz gotop
rm gotop