surrealpatch/build/macos.sh

51 lines
1.6 KiB
Bash
Raw Normal View History

2019-12-08 20:54:59 +00:00
#!/usr/bin/env bash
2019-12-08 13:53:49 +00:00
VERS=$(git describe --tags --abbrev=0)
2021-03-22 21:44:24 +00:00
NAME=surreal-${VERS}.darwin-universal
HASH=${NAME}.txt
FILE=${NAME}.tgz
GOOS=darwin GOARCH=amd64 go build -v -o surreal-amd64 -ldflags "$(bash build/flags.sh)"
GOOS=darwin GOARCH=arm64 go build -v -o surreal-arm64 -ldflags "$(bash build/flags.sh)"
lipo -create -output surreal surreal-amd64 surreal-arm64
tar -zcvf $FILE -s "#^#${NAME}/#" surreal
echo $(shasum -a 256 $FILE | cut -f1 -d' ') > $HASH
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$FILE s3://download.surrealdb.com/
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$HASH s3://download.surrealdb.com/
rm -rf $FILE $HASH surreal.exe surreal surreal-amd64 surreal-arm64
# amd64
2019-12-08 13:53:49 +00:00
NAME=surreal-${VERS}.darwin-amd64
2019-12-08 14:46:30 +00:00
HASH=${NAME}.txt
2019-12-08 13:53:49 +00:00
FILE=${NAME}.tgz
GOOS=darwin GOARCH=amd64 go build -v -ldflags "$(bash build/flags.sh)"
tar -zcvf $FILE -s "#^#${NAME}/#" surreal
2019-12-08 14:46:30 +00:00
echo $(shasum -a 256 $FILE | cut -f1 -d' ') > $HASH
2019-12-08 13:53:49 +00:00
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$FILE s3://download.surrealdb.com/
2019-12-08 14:46:30 +00:00
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$HASH s3://download.surrealdb.com/
rm -rf $FILE $HASH surreal.exe surreal
2021-03-22 21:44:24 +00:00
# arm64
NAME=surreal-${VERS}.darwin-arm64
HASH=${NAME}.txt
FILE=${NAME}.tgz
GOOS=darwin GOARCH=amd64 go build -v -ldflags "$(bash build/flags.sh)"
tar -zcvf $FILE -s "#^#${NAME}/#" surreal
echo $(shasum -a 256 $FILE | cut -f1 -d' ') > $HASH
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$FILE s3://download.surrealdb.com/
aws s3 cp --region eu-west-2 --cache-control "no-store" ./$HASH s3://download.surrealdb.com/
rm -rf $FILE $HASH surreal.exe surreal