Skip to content

Commit

Permalink
Get publish.sh working
Browse files Browse the repository at this point in the history
  • Loading branch information
phoebesimon committed May 22, 2017
1 parent b7a1543 commit 33dd4a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@

burrow-exporter
dist/
vendor
vendor/
2 changes: 1 addition & 1 deletion burrow-exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/jirwin/burrow_exporter/burrow_exporter"
)

var Version := "0.0.1"
var Version = "0.0.1"

func main() {
app := cli.NewApp()
Expand Down
15 changes: 9 additions & 6 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/bin/bash

VERSION=$(git describe --tags)
echo "Publishing $VERSION..."

gox -ldflags "-X main.Version $VERSION -X" -output "dist/{{.OS}}_{{.ARCH}}/burrow-exporter"

rm -rf releases
mkdir dist
mkdir releases
gox -osarch="linux/amd64" -osarch="linux/386" -osarch="darwin/amd64" -osarch="freebsd/amd64" -osarch="freebsd/386" -ldflags "-X main.Version=$VERSION" -output "dist/{{.OS}}_{{.Arch}}/burrow-exporter"

for i in src/* ; do
for i in dist/* ; do
if [ -d "$i" ]; then
ARCH=$(basename "$i")
zip releases/burrow-exporter-$VERSION-$ARCH.zip dist/$ARCH/burrow-exporter
zip releases/burrow-exporter_$VERSION_$ARCH.zip dist/$ARCH/burrow-exporter
fi
done

ghr -t $GITHUB_TOKEN -u jirwin -r burrow-exporter --replace `git describe --tags` dist/
ghr -t $GITHUB_TOKEN -u jirwin -r burrow_exporter --replace $VERSION releases/

rm -rf dist
rm -rf releases

0 comments on commit 33dd4a3

Please sign in to comment.