Skip to content

Commit

Permalink
Add publish script.
Browse files Browse the repository at this point in the history
  • Loading branch information
jirwin committed Oct 7, 2017
1 parent 5c6d852 commit 3befce9
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

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

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}}/ipfs-archive"

for i in dist/* ; do
if [ -d "$i" ]; then
ARCH=$(basename "$i")
zip releases/ipfs-archive_$VERSION_$ARCH.zip dist/$ARCH/ipfs-archive
fi
done

ghr -t $GITHUB_TOKEN -u jirwin -r ipfs-archive --replace $VERSION releases/

rm -rf dist
rm -rf releases

0 comments on commit 3befce9

Please sign in to comment.