Skip to content

Instantly share code, notes, and snippets.

@rikkix
Created July 21, 2021 03:12
Show Gist options
  • Save rikkix/326a6318510b579029108dd4213d547b to your computer and use it in GitHub Desktop.
Save rikkix/326a6318510b579029108dd4213d547b to your computer and use it in GitHub Desktop.
#!/bin/sh
p=`pwd`
binname=`basename $p`
mkdir $binname/{linux-386,linux-arm,linux-arm5,linux,freeBSD,win64,win32,mac,zip} -p
env GOARCH=386 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-386/$binname &
env GOARCH=arm GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm/$binname &
env GOARCH=arm GOARM=5 GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux-arm5/$binname &
env GOOS=linux CGO_ENABLED=0 go build -v -o $binname/linux/$binname &
env GOOS=freebsd CGO_ENABLED=0 go build -v -o $binname/freeBSD/$binname &
env GOOS=windows go build -v -o $binname/win64/$binname.exe &
env GOARCH=386 GOOS=windows go build -v -o $binname/win32/$binname-32.exe &
env GOOS=darwin go build -v -o $binname/mac/$binname &
wait
pa=($binname/linux-386/$binname $binname/linux-arm/$binname $binname/linux-arm5/$binname $binname/linux/$binname $binname/freeBSD/$binname $binname/win64/$binname.exe $binname/win32/$binname-32.exe $binname/mac/$binname)
pa1=(linux-386 linux-arm linux-arm5 linux freeBSD win64 win32 mac)
for data in ${pa[@]}
do
gpg --sign $data
done
for data in ${pa1[@]}
do
zip $binname/zip/$data $binname/$data/*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment