yq/scripts/xcompile.sh

22 lines
853 B
Bash
Raw Normal View History

2015-09-28 23:39:44 +00:00
#!/bin/bash
2020-12-22 08:52:44 +00:00
set -e
2015-09-28 23:39:44 +00:00
# This assumes that gonative and gox is installed as per the 'one time setup' instructions
# at https://github.com/inconshreveable/gonative
2020-09-13 00:32:45 +00:00
2020-12-22 09:23:13 +00:00
CGO_ENABLED=0 gox -ldflags "${LDFLAGS}" -output="build/yq_{{.OS}}_{{.Arch}}" --osarch="darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm linux/arm64 linux/mips linux/mips64 linux/mips64le linux/mipsle linux/ppc64 linux/ppc64le linux/s390x netbsd/386 netbsd/amd64 netbsd/arm openbsd/386 openbsd/amd64 windows/386 windows/amd64"
2015-09-28 23:39:44 +00:00
2020-03-01 21:43:47 +00:00
cd build
rhash -r -a . -P -o checksums
rhash --list-hashes > checksums_hashes_order
find . | xargs -I {} tar czvf {}.tar.gz {}
rm checksums_hashes_order.tar.gz
rm checksums.tar.gz
rm yq_windows_386.exe.tar.gz
rm yq_windows_amd64.exe.tar.gz
zip yq_windows_386.zip yq_windows_386.exe
zip yq_windows_amd64.zip yq_windows_amd64.exe