DEVTOOLS-7321: Add scripts for macOS builds and homebrew uploads

This commit is contained in:
Robert McNeil
2020-03-30 12:36:32 -07:00
committed by Arég Harutyunyan
parent 9e76e42e3c
commit 8c59254488
3 changed files with 91 additions and 0 deletions

27
.teamcity/build-macos.sh vendored Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
set -euo pipefail
if ! git describe --tags --exact-match 2>/dev/null ; then
echo "Skipping public release for an untagged commit."
echo "##teamcity[buildStatus status='SUCCESS' text='Skipped due to lack of tag']"
exit 0
fi
if [[ "$(uname)" != "Darwin" ]] ; then
echo "This should be run on macOS"
exit 1
fi
go version
export GO111MODULE=on
# build 'cloudflared-darwin-amd64.tgz'
mkdir -p artifacts
FILENAME="$(pwd)/artifacts/cloudflared-darwin-amd64.tgz"
export PATH="$PATH:/usr/local/bin"
mkdir -p ../src/github.com/cloudflare/
cp -r . ../src/github.com/cloudflare/cloudflared
cd ../src/github.com/cloudflare/cloudflared
GOCACHE="$PWD/../../../../" GOPATH="$PWD/../../../../" CGO_ENABLED=1 make cloudflared
tar czf "$FILENAME" cloudflared