github.com/Finschia/finschia-sdk@v0.48.1/.build.sh (about) 1 #!/bin/bash 2 3 set -ue 4 5 # Expect the following envvars to be set: 6 # - APP 7 # - VERSION 8 # - COMMIT 9 # - TARGET_OS 10 # - LEDGER_ENABLED 11 # - DEBUG 12 13 # Source builder's functions library 14 . /usr/local/share/tendermint/buildlib.sh 15 16 # These variables are now available 17 # - BASEDIR 18 # - OUTDIR 19 20 # Build for each os-architecture pair 21 for platform in ${TARGET_PLATFORMS} ; do 22 # This function sets GOOS, GOARCH, and OS_FILE_EXT environment variables 23 # according to the build target platform. OS_FILE_EXT is empty in all 24 # cases except when the target platform is 'windows'. 25 setup_build_env_for_platform "${platform}" 26 27 make clean 28 echo Building for $(go env GOOS)/$(go env GOARCH) >&2 29 GOROOT_FINAL="$(go env GOROOT)" \ 30 make build \ 31 LDFLAGS=-buildid=${VERSION} \ 32 VERSION=${VERSION} \ 33 COMMIT=${COMMIT} \ 34 LEDGER_ENABLED=${LEDGER_ENABLED} 35 mv ./build/${APP}${OS_FILE_EXT} ${OUTDIR}/${APP}-${VERSION}-$(go env GOOS)-$(go env GOARCH)${OS_FILE_EXT} 36 37 # This function restore the build environment variables to their 38 # original state. 39 restore_build_env 40 done 41 42 # Generate and display build report. 43 generate_build_report 44 cat ${OUTDIR}/build_report