disable cgo

master
Evan Chen 2021-11-30 13:40:31 +08:00
parent 0910565e20
commit b7ee78bde5
1 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ for PLATFORM in $PLATFORMS; do
GOARCH=${PLATFORM#*/} GOARCH=${PLATFORM#*/}
BIN_FILENAME="${PROJ}" BIN_FILENAME="${PROJ}"
if [[ "${GOOS}" == "windows" ]]; then BIN_FILENAME="${BIN_FILENAME}.exe"; fi if [[ "${GOOS}" == "windows" ]]; then BIN_FILENAME="${BIN_FILENAME}.exe"; fi
CMD="GOOS=${GOOS} GOARCH=${GOARCH} go build ${LDFLAGS} -o ${DIST}/${BIN_FILENAME} $@" CMD="CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build ${LDFLAGS} -o ${DIST}/${BIN_FILENAME} $@"
echo "${CMD}" echo "${CMD}"
eval $CMD || FAILURES="${FAILURES} ${PLATFORM}" eval $CMD || FAILURES="${FAILURES} ${PLATFORM}"
sh -c "cd ${DIST} && tar -czf ${PROJ}-${VERSION}-${GOOS}-${GOARCH}.tar.gz ${BIN_FILENAME} && rm ${BIN_FILENAME}" sh -c "cd ${DIST} && tar -czf ${PROJ}-${VERSION}-${GOOS}-${GOARCH}.tar.gz ${BIN_FILENAME} && rm ${BIN_FILENAME}"
@ -29,4 +29,4 @@ if [[ "${FAILURES}" != "" ]]; then
echo "" echo ""
echo "${SCRIPT_NAME} failed on: ${FAILURES}" echo "${SCRIPT_NAME} failed on: ${FAILURES}"
exit 1 exit 1
fi fi