mirror of
https://github.com/Luzifer/github-publish.git
synced 2024-12-21 02:11:22 +00:00
Add mod-mode support for Go 1.12+ (#4)
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
48856fb852
commit
0f44b2988a
2 changed files with 15 additions and 3 deletions
|
@ -1,2 +1,2 @@
|
||||||
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
|
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
|
||||||
b3f9247e566899d8d05147d69fb3d65df09d7eeae7287f242f169232df0a3108 golang.sh
|
a74844ac5c37963f276e8af9cb7cb46cde38dc18a4dbdc6c3b2ca37b362e87e5 golang.sh
|
||||||
|
|
16
golang.sh
16
golang.sh
|
@ -24,6 +24,7 @@ PACKAGES=${PACKAGES:-$(echo ${godir} | cut -d '/' -f 1-3)}
|
||||||
BUILD_DIR=${BUILD_DIR:-.build}
|
BUILD_DIR=${BUILD_DIR:-.build}
|
||||||
DRAFT=${DRAFT:-true}
|
DRAFT=${DRAFT:-true}
|
||||||
FORCE_SKIP_UPLOAD=${FORCE_SKIP_UPLOAD:-false}
|
FORCE_SKIP_UPLOAD=${FORCE_SKIP_UPLOAD:-false}
|
||||||
|
MOD_MODE=${MOD_MODE:-}
|
||||||
|
|
||||||
go version
|
go version
|
||||||
|
|
||||||
|
@ -40,8 +41,19 @@ rm -rf ${BUILD_DIR}
|
||||||
|
|
||||||
step "Compile program"
|
step "Compile program"
|
||||||
mkdir ${BUILD_DIR}
|
mkdir ${BUILD_DIR}
|
||||||
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" \
|
|
||||||
-output="${BUILD_DIR}/{{.Dir}}_{{.OS}}_{{.Arch}}" \
|
build_params=(
|
||||||
|
-ldflags="-X main.version=${VERSION}"
|
||||||
|
-osarch="${ARCHS}"
|
||||||
|
-output="${BUILD_DIR}/{{.Dir}}_{{.OS}}_{{.Arch}}"
|
||||||
|
)
|
||||||
|
|
||||||
|
if [[ -n ${MOD_MODE} ]]; then
|
||||||
|
build_params+=(-mod="${MOD_MODE}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
gox \
|
||||||
|
"${build_params[@]}" \
|
||||||
${PACKAGES}
|
${PACKAGES}
|
||||||
|
|
||||||
step "Generate binary SHASUMs"
|
step "Generate binary SHASUMs"
|
||||||
|
|
Loading…
Reference in a new issue