-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automated Github release, and reduced arch/os combos.
- Loading branch information
Showing
1 changed file
with
25 additions
and
3 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 |
---|---|---|
@@ -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 |