go/utils/publishrelease,.github: Publish darwin-arm64 releases and make them work with install.sh.

This commit is contained in:
Aaron Son
2021-11-18 16:29:07 -08:00
parent e211f3eae1
commit 8b72e81092
3 changed files with 35 additions and 26 deletions
+19 -19
View File
@@ -13,29 +13,29 @@ set -e
set -o pipefail
apt-get update && apt-get install -y zip
cd /src
BINS="dolt git-dolt git-dolt-smudge"
OSES="windows linux darwin"
ARCHS="amd64 arm64"
for os in $OSES; do
for arch in $ARCHS; do
o="out/dolt-$os-$arch"
mkdir -p "$o/bin"
cp Godeps/LICENSES "$o/"
for bin in $BINS; do
echo Building "$o/$bin"
obin="$bin"
if [ "$os" = windows ]; then
obin="$bin.exe"
fi
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -o "$o/bin/$obin" "./cmd/$bin/"
done
BINS="dolt git-dolt git-dolt-smudge"
OS_ARCH_TUPLES="windows-amd64 linux-amd64 darwin-amd64 darwin-arm64"
for tuple in $OS_ARCH_TUPLES; do
os=`echo $tuple | sed 's/-.*//'`
arch=`echo $tuple | sed 's/.*-//'`
o="out/dolt-$os-$arch"
mkdir -p "$o/bin"
cp Godeps/LICENSES "$o/"
for bin in $BINS; do
echo Building "$o/$bin"
obin="$bin"
if [ "$os" = windows ]; then
(cd out && zip -r "dolt-$os-$arch" "dolt-$os-$arch")
else
tar czf "out/dolt-$os-$arch.tar.gz" -C out "dolt-$os-$arch"
obin="$bin.exe"
fi
CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build -o "$o/bin/$obin" "./cmd/$bin/"
done
if [ "$os" = windows ]; then
(cd out && zip -r "dolt-$os-$arch" "dolt-$os-$arch")
else
tar czf "out/dolt-$os-$arch.tar.gz" -C out "dolt-$os-$arch"
fi
done
render_install_sh() {
+4 -5
View File
@@ -51,7 +51,8 @@ assert_linux_or_macos() {
if [ "$OS" != Linux -a "$OS" != Darwin ]; then
fail "E_UNSUPPORTED_OS" "dolt install.sh only supports macOS and Linux."
fi
if [ "$ARCH" != x86_64 -a "$ARCH" != i386 -a "$ARCH" != i686 -a "$ARCH-$OS" != arm64-Darwin ]; then
if [ "$ARCH-$OS" != "x86_64-Linux" -a "$ARCH-$OS" != "x86_64-Darwin" -a "$ARCH-$OS" != "arm64-Darwin" ]; then
fail "E_UNSUPPOSED_ARCH" "dolt install.sh only supports installing dolt on x86_64 or x86 or Darwin-arm64."
fi
@@ -62,10 +63,8 @@ assert_linux_or_macos() {
fi
if [ "$ARCH" == x86_64 ]; then
PLATFORM_TUPLE=$PLATFORM_TUPLE-amd64
elif [ "$ARCH" == arm64 -a "$OS" == Darwin ]; then
PLATFORM_TUPLE=$PLATFORM_TUPLE-amd64
else
PLATFORM_TUPLE=$PLATFORM_TUPLE-386
elif [ "$ARCH" == arm64 ]; then
PLATFORM_TUPLE=$PLATFORM_TUPLE-arm64
fi
}