This repository has been archived by the owner on Dec 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 70
/
build.sh
executable file
·23 lines (19 loc) · 1.85 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
VERSION=0.0.59
BINARY_NAME=stoppropaganda
# Remove old binaries (if any)
mkdir -p ./dist
rm -rf ./dist/*
# Run tests
go test ./...
# Build binaries
env CGO_ENABLED=0 GOOS=linux GOARCH=386 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_linux_i386" cmd/stoppropaganda/main.go # Linux i386
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_linux_x86_64" cmd/stoppropaganda/main.go # Linux 64bit
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=5 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_linux_arm" cmd/stoppropaganda/main.go # Linux armv5/armel/arm (it also works on armv6)
env CGO_ENABLED=0 GOOS=linux GOARCH=arm GOARM=7 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_linux_armhf" cmd/stoppropaganda/main.go # Linux armv7/armhf
env CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_linux_aarch64" cmd/stoppropaganda/main.go # Linux armv8/aarch64
env CGO_ENABLED=0 GOOS=freebsd GOARCH=amd64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_freebsd_x86_64" cmd/stoppropaganda/main.go # FreeBSD 64bit
env CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_darwin_x86_64" cmd/stoppropaganda/main.go # Darwin 64bit
env CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_darwin_aarch64" cmd/stoppropaganda/main.go # Darwin armv8/aarch64
env CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_windows_i386.exe" cmd/stoppropaganda/main.go # Windows 32bit
env CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o "dist/${BINARY_NAME}_v${VERSION}_windows_x86_64.exe" cmd/stoppropaganda/main.go # Windows 64bit