Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Don't try Darwin builds on Linux #21

Merged
merged 1 commit into from
May 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ mkdir -p bin

build(){
tmpdir=$(mktemp -d)
go build -ldflags "-X main.version=${tag}" -o "$tmpdir/coder" ../cmd/coder
go build -ldflags "-s -w -X main.version=${tag}" -o "$tmpdir/coder" ../cmd/coder

pushd "$tmpdir"
tarname="coder-cli-$GOOS-$GOARCH.tar.gz"
Expand All @@ -25,5 +25,14 @@ build(){
rm -rf "$tmpdir"
}

# Darwin builds do not work from Linux, so only try to build them from Darwin.
# See: https://github.com/cdr/coder-cli/issues/20
if [[ "$(uname)" -eq "Darwin" ]]; then
GOOS=linux build
CGO_ENABLED=1 GOOS=darwin build
exit 0
fi

echo "Warning: Darwin builds don't work on Linux."
echo "Please use an OSX machine to build Darwin tars."
GOOS=linux build
# GOOS=darwin build