Skip to content

Commit

Permalink
Automated Github release, and reduced arch/os combos.
Browse files Browse the repository at this point in the history
  • Loading branch information
ronoaldo committed Aug 25, 2021
1 parent 1eb0233 commit 0fb5629
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions scripts/make-dist.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
#!/bin/sh
set -e
set -x

ARCHS="386 amd64 arm64"
OSES="linux darwin windows"
ARCHS="amd64 386"
OSES="linux windows"

# Cleanup previous builds
rm -rf dist
mkdir -p dist

# Build for all os/arch combos
FILES=""
for GOOS in $OSES; do
for GOARCH in $ARCHS; do
echo "Building for GOOS=$GOOS GOARCH=$GOARCH"
GOOS=$GOOS GOARCH=$GOARCH go build -o dist/contentdb ./cmd/contentdb
zip dist/contentdb-$GOOS-$GOARCH.zip dist/contentdb README.md LICENSE
export FILES="$FILES dist/contentdb-$GOOS-$GOARCH.zip"
rm -f dist/contentdb
done
done
done

# Prepare a Github release
git tag --sort creatordate
LAST=$(git tag --sort creatordate | tail -n 1)
read -p "Release version (latest is $LAST): " VERSION
CHANGES="$(mktemp)"
git log --pretty="* %an: %s" ${LAST}..HEAD > $CHANGES

echo "Releasing '$FILES' ..."

gh release --repo ronoaldo/minetools create \
--draft \
--notes-file $CHANGES \
$VERSION \
$FILES

0 comments on commit 0fb5629

Please sign in to comment.