Skip to content

Commit 314aa8f

Browse files
committed
Adds darwin/arm64 as a build target
Also adds `$GOARCH` to the the build paths, since there are two darwin targets now (otherwise one would overwrite the other).
1 parent 988642d commit 314aa8f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script/build

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if [ -d build ]; then
1515
fi
1616
mkdir -p build
1717

18-
platforms=("windows/amd64" "linux/amd64" "darwin/amd64")
18+
platforms=("windows/amd64" "linux/amd64" "darwin/amd64" "darwin/arm64")
1919

2020
echo "==> Build started for v${version}"
2121

@@ -35,9 +35,9 @@ do
3535
GCFLAGS="-gcflags=all=-trimpath=$GOPATH -asmflags=all=-trimpath=$GOPATH"
3636

3737
if [ $GOOS = "windows" ]; then
38-
env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o "build/${GOOS}/cf-vault.exe" -ldflags "-X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha}" .
38+
env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o "build/${GOOS}/${GOARCH}/cf-vault.exe" -ldflags "-X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha}" .
3939
else
40-
env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o "build/${GOOS}/cf-vault" -ldflags "-X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha}" .
40+
env GOOS=$GOOS GOARCH=$GOARCH go build $GCFLAGS -o "build/${GOOS}/${GOARCH}/cf-vault" -ldflags "-X github.com/jacobbednarz/cf-vault/cmd.Rev=${version_with_sha}" .
4141
fi
4242
if [ $? -ne 0 ]; then
4343
echo "Building the binary has failed!"
@@ -48,9 +48,9 @@ do
4848

4949
printf "==> Tarballing %s\t%s\n" "$platform" "build/${output_name}.tar.gz" | expand -t 30
5050
if [ $GOOS = "windows" ]; then
51-
tar -czf "build/${output_name}.tar.gz" -C "build/$GOOS" "cf-vault.exe"
51+
tar -czf "build/${output_name}.tar.gz" -C "build/$GOOS/$GOARCH" "cf-vault.exe"
5252
else
53-
tar -czf "build/${output_name}.tar.gz" -C "build/$GOOS" "cf-vault"
53+
tar -czf "build/${output_name}.tar.gz" -C "build/$GOOS/$GOARCH" "cf-vault"
5454
fi
5555

5656
if [ $? -ne 0 ]; then
@@ -59,7 +59,7 @@ do
5959
fi
6060

6161
echo "==> Adding file checksums to build/checksums.txt"
62-
shasum -a 256 build/$GOOS/* >> "build/checksums.txt"
62+
shasum -a 256 build/$GOOS/$GOARCH/* >> "build/checksums.txt"
6363
done
6464

6565
shasum -a 256 build/*.tar.gz >> "build/checksums.txt"

0 commit comments

Comments
 (0)