1
0
mirror of https://github.com/Luzifer/github-publish.git synced 2024-09-19 16:02:57 +00:00

Leave build dir at the end for following tassk

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-03-21 11:32:58 +01:00
parent a346ae949a
commit 68ba18f83d
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 33 additions and 33 deletions

View File

@ -1,2 +1,2 @@
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
b3fb1862829bd85992de6c234d3895483fb92a963a489376fde32182fa5a8c55 golang.sh
635091c14de852b5cb183ebe345c2711f430907c439aec7c9d5dba1b9c8309cd golang.sh

View File

@ -1,7 +1,7 @@
#!/bin/bash
set -euo pipefail
curl -sL https://raw.githubusercontent.com/Luzifer/github-publish/master/SHA256SUMS | \
curl -sL https://raw.githubusercontent.com/Luzifer/github-publish/master/SHA256SUMS |
grep "golang.sh" | sha256sum -c || exit 2
(which zip 2>&1 1>/dev/null) || {
@ -9,13 +9,13 @@ curl -sL https://raw.githubusercontent.com/Luzifer/github-publish/master/SHA256S
(which apt-get 2>&1 1>/dev/null) && apt-get install -y zip
}
function step {
function step() {
echo "===> $@..."
}
VERSION=$(git describe --tags --exact-match || echo "ghpublish__notags")
PWD=$(pwd)
godir=${PWD/${GOPATH}\/src\/}
godir=${PWD/${GOPATH}\/src\//}
REPO=${REPO:-$(echo ${godir} | cut -d '/' -f 3)}
GHUSER=${GHUSER:-$(echo ${godir} | cut -d '/' -f 2)}
ARCHS=${ARCHS:-"linux/amd64 linux/arm darwin/amd64 windows/amd64"}
@ -31,6 +31,9 @@ step Test code
go vet ${PACKAGES}
go test ${PACKAGES}
step Cleanup build directory if present
rm -rf ${BUILD_DIR}
step Compile program
mkdir ${BUILD_DIR}
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" \
@ -85,7 +88,4 @@ done
echo -e "\n\n=== Recorded checksums ==="
cat SHA256SUMS
step Cleanup build directory
cd -
rm -rf ${BUILD_DIR}