-
Notifications
You must be signed in to change notification settings - Fork 792
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper script for binary releases
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
VERSION=$(go run main.go -version | cut -d\ -f2) | ||
|
||
function pack() { | ||
dir=freegeoip-$VERSION-$1 | ||
mkdir $dir | ||
cp -r freegeoip public ansible-playbook $dir | ||
tar czf ${dir}.tar.gz $dir | ||
rm -rf $dir | ||
} | ||
|
||
for OS in linux darwin freebsd | ||
do | ||
GOOS=$OS GOARCH=amd64 go build -ldflags '-w' | ||
pack $OS-amd64 | ||
done |