当前仓库属于暂停状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 14

MicroOS / pic2ascii
暂停

forked from wzshiming / pic2ascii
暂停
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build_all.bash 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
wzshiming 提交于 2018-04-27 03:45 . update travis
#!/usr/bin/env bash
set -e
SRC_ROOT=$(git rev-parse --show-toplevel)
VERSION=$(git describe --tags --dirty)
COMMIT_HASH=$(git rev-parse --short HEAD 2>/dev/null)
DATE=$(date "+%Y-%m-%d")
IMPORT_DURING_SOLVE=${IMPORT_DURING_SOLVE:-false}
if [[ -z "${BASENAME}" ]]; then
BASENAME="out"
fi
if [[ -z "${RELEASE}" ]]; then
RELEASE="release"
fi
if [[ "$(pwd)" != "${SRC_ROOT}" ]]; then
echo "you are not in the root of the repo" 1>&2
echo "please cd to ${SRC_ROOT} before running this script" 1>&2
exit 1
fi
if [[ -z "${GO_BUILD_FLAGS}" ]]; then
GO_BUILD_FLAGS="-a -installsuffix cgo"
fi
GO_BUILD_CMD="go build ${GO_BUILD_FLAGS} "
GO_BUILD_LDFLAGS="-s -w -X main.commitHash=${COMMIT_HASH} -X main.buildDate=${DATE} -X main.version=${VERSION} -X main.flagImportDuringSolve=${IMPORT_DURING_SOLVE}"
if [[ -z "${SRC_BUILD_PLATFORMS}" ]]; then
SRC_BUILD_PLATFORMS="linux windows darwin freebsd"
fi
if [[ -z "${SRC_BUILD_ARCHS}" ]]; then
SRC_BUILD_ARCHS="amd64 386"
fi
mkdir -p "${SRC_ROOT}/${RELEASE}"
for OS in ${SRC_BUILD_PLATFORMS[@]}; do
for ARCH in ${SRC_BUILD_ARCHS[@]}; do
NAME="${BASENAME}_${OS}_${ARCH}"
if [[ "${OS}" == "windows" ]]; then
NAME="${NAME}.exe"
fi
NAME="${SRC_ROOT}/${RELEASE}/${NAME}"
echo "Building to ${NAME} for ${OS}/${ARCH}"
GOARCH=${ARCH} GOOS=${OS} CGO_ENABLED=0 ${GO_BUILD_CMD} -ldflags "${GO_BUILD_LDFLAGS}" -o "${NAME}" ./cmd/${BASENAME}
shasum -a 256 "${NAME}" > "${NAME}".sha256
done
done
Go
1
https://gitee.com/MicroOS/pic2ascii.git
git@gitee.com:MicroOS/pic2ascii.git
MicroOS
pic2ascii
pic2ascii
master

搜索帮助