refactor: build miniooni from toplevel (#203)

* refactor: build miniooni from toplevel

Of course, also move the specific test checking whether we are
still able of building miniooni.

Part of https://github.com/ooni/probe/issues/1335

* build for current branch just to confirm

* fix: correct the path where linux/arm binary is

* okay, it works, we can remove the special rule
This commit is contained in:
Simone Basso 2021-02-02 15:34:03 +01:00 committed by GitHub
parent 47dd063b77
commit 90d15c1c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 21 additions and 21 deletions

View File

@ -14,7 +14,7 @@ jobs:
go-version: "1.14" go-version: "1.14"
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: ./build-cli.sh linux - run: ./build-miniooni.sh linux
- run: ./CLI/linux/amd64/miniooni --yes -nNi https://example.com web_connectivity - run: ./CLI/linux/amd64/miniooni --yes -nNi https://example.com web_connectivity
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
@ -26,21 +26,21 @@ jobs:
path: ./CLI/linux/amd64/miniooni path: ./CLI/linux/amd64/miniooni
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: miniooni-linux-armv7 name: miniooni-linux-arm
path: ./CLI/linux/armv7/miniooni path: ./CLI/linux/arm/miniooni
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: miniooni-linux-arm64 name: miniooni-linux-arm64
path: ./CLI/linux/arm64/miniooni path: ./CLI/linux/arm64/miniooni
- run: ./build-cli.sh darwin - run: ./build-miniooni.sh darwin
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: miniooni-darwin-amd64 name: miniooni-darwin-amd64
path: ./CLI/darwin/amd64/miniooni path: ./CLI/darwin/amd64/miniooni
- run: sudo apt install --yes mingw-w64 - run: sudo apt install --yes mingw-w64
- run: ./build-cli.sh windows - run: ./build-miniooni.sh windows
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: miniooni-windows-amd64.exe name: miniooni-windows-amd64.exe

3
CLI/README.md Normal file
View File

@ -0,0 +1,3 @@
# Directory github.com/ooni/probe-cli/CLI
We use this directory for building CLI binaries (e.g. ooniprobe).

View File

@ -1 +1,2 @@
/ooniprobe /ooniprobe
/miniooni

View File

@ -1 +1,2 @@
/ooniprobe /ooniprobe
/miniooni

View File

@ -1 +1,2 @@
/ooniprobe /ooniprobe
/miniooni

View File

@ -1 +1,2 @@
/ooniprobe.exe /ooniprobe.exe
/miniooni.exe

View File

@ -1 +1,2 @@
/ooniprobe.exe /ooniprobe.exe
/miniooni.exe

View File

@ -3,27 +3,27 @@ set -e
case $1 in case $1 in
macos|darwin) macos|darwin)
export GOOS=darwin GOARCH=amd64 export GOOS=darwin GOARCH=amd64
go build -o ./CLI/darwin/amd64 -ldflags="-s -w" ./cmd/miniooni go build -o ./CLI/darwin/amd64 -ldflags="-s -w" ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/darwin/amd64/miniooni";; echo "Binary ready at ./CLI/darwin/amd64/miniooni";;
linux) linux)
export GOOS=linux GOARCH=386 export GOOS=linux GOARCH=386
go build -o ./CLI/linux/386 -tags netgo -ldflags='-s -w -extldflags "-static"' ./cmd/miniooni go build -o ./CLI/linux/386 -tags netgo -ldflags='-s -w -extldflags "-static"' ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/linux/386/miniooni" echo "Binary ready at ./CLI/linux/386/miniooni"
export GOOS=linux GOARCH=amd64 export GOOS=linux GOARCH=amd64
go build -o ./CLI/linux/amd64 -tags netgo -ldflags='-s -w -extldflags "-static"' ./cmd/miniooni go build -o ./CLI/linux/amd64 -tags netgo -ldflags='-s -w -extldflags "-static"' ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/linux/amd64/miniooni" echo "Binary ready at ./CLI/linux/amd64/miniooni"
export GOOS=linux GOARCH=arm GOARM=7 export GOOS=linux GOARCH=arm GOARM=7
go build -o ./CLI/linux/armv7 -tags netgo -ldflags='-s -w -extldflags "-static"' ./cmd/miniooni go build -o ./CLI/linux/arm -tags netgo -ldflags='-s -w -extldflags "-static"' ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/linux/armv7/miniooni" echo "Binary ready at ./CLI/linux/arm/miniooni"
export GOOS=linux GOARCH=arm64 export GOOS=linux GOARCH=arm64
go build -o ./CLI/linux/arm64 -tags netgo -ldflags='-s -w -extldflags "-static"' ./cmd/miniooni go build -o ./CLI/linux/arm64 -tags netgo -ldflags='-s -w -extldflags "-static"' ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/linux/arm64/miniooni";; echo "Binary ready at ./CLI/linux/arm64/miniooni";;
windows) windows)
export GOOS=windows GOARCH=386 export GOOS=windows GOARCH=386
go build -o ./CLI/windows/386 -ldflags="-s -w" ./cmd/miniooni go build -o ./CLI/windows/386 -ldflags="-s -w" ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/windows/386/miniooni.exe" echo "Binary ready at ./CLI/windows/386/miniooni.exe"
export GOOS=windows GOARCH=amd64 export GOOS=windows GOARCH=amd64
go build -o ./CLI/windows/amd64 -ldflags="-s -w" ./cmd/miniooni go build -o ./CLI/windows/amd64 -ldflags="-s -w" ./internal/engine/cmd/miniooni
echo "Binary ready at ./CLI/windows/amd64/miniooni.exe";; echo "Binary ready at ./CLI/windows/amd64/miniooni.exe";;
*) *)
echo "usage: $0 darwin|linux|windows" 1>&2 echo "usage: $0 darwin|linux|windows" 1>&2

View File

@ -1,3 +0,0 @@
# Directory github.com/ooni/probe-engine/CLI
We use this directory for building CLI binaries (e.g. miniooni).

View File

@ -1 +0,0 @@
/miniooni

View File

@ -1 +0,0 @@
/miniooni

View File

@ -1 +0,0 @@
/miniooni

View File

@ -1 +0,0 @@
/miniooni.exe

View File

@ -1 +0,0 @@
/miniooni.exe