fix(build.sh): name macOS files after the darwin platform

This was what we used to do in the past. Spotted by @sarathms.
This commit is contained in:
Simone Basso 2020-08-24 19:16:58 +02:00
parent fe89b2454c
commit 770a822fd4
3 changed files with 13 additions and 9 deletions

View File

@ -12,9 +12,9 @@ jobs:
with:
go-version: "1.14"
- uses: actions/checkout@v2
- run: ./build.sh macos
- run: ./smoketest.sh ./CLI/macos/amd64/ooniprobe
- run: ./build.sh darwin
- run: ./smoketest.sh ./CLI/darwin/amd64/ooniprobe
- uses: actions/upload-artifact@v1
with:
name: ooniprobe-macos-amd64
path: ./CLI/macos/amd64/ooniprobe
name: ooniprobe-darwin-amd64
path: ./CLI/darwin/amd64/ooniprobe

View File

@ -26,23 +26,23 @@ case $1 in
go build -tags netgo -ldflags='-s -w -extldflags "-static"' ./cmd/ooniprobe
;;
macos)
macos|darwin)
# Note! The following line _assumes_ you have a working C compiler. If you
# have Xcode command line tools installed, you are fine.
go build -ldflags='-s -w' ./cmd/ooniprobe
tar -cvzf ooniprobe_${v}_macos_amd64.tar.gz LICENSE.md Readme.md ooniprobe
mv ooniprobe ./CLI/macos/amd64/
tar -cvzf ooniprobe_${v}_darwin_amd64.tar.gz LICENSE.md Readme.md ooniprobe
mv ooniprobe ./CLI/darwin/amd64/
;;
release)
$0 linux
$0 windows
$0 macos
$0 darwin
shasum -a 256 ooniprobe_${v}_*_amd64.* > ooniprobe_checksums.txt
;;
*)
echo "Usage: $0 linux|macos|windows|release"
echo "Usage: $0 darwin|linux|macos|windows|release"
echo ""
echo "You need a C compiler and Go >= 1.14. The C compiler must be a"
echo "UNIX like compiler like GCC, Clang, Mingw-w64."
@ -54,5 +54,9 @@ case $1 in
echo "macOS has never been tested. We have a bunch of cross compiling"
echo "checks inside the .github/workflows/cross.yml file."
echo ""
echo "The macos rule is an alias for the darwin rule. The generated"
echo "binary file is named ooniprobe_${version}_darwin_${arch}.tar.gz"
echo "because the platform name is darwin."
echo ""
;;
esac