mirror of
https://github.com/Luzifer/github-publish.git
synced 2024-11-09 23:00:14 +00:00
Leave build dir at the end for following tassk
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
a346ae949a
commit
68ba18f83d
2 changed files with 33 additions and 33 deletions
|
@ -1,2 +1,2 @@
|
||||||
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
|
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
|
||||||
b3fb1862829bd85992de6c234d3895483fb92a963a489376fde32182fa5a8c55 golang.sh
|
635091c14de852b5cb183ebe345c2711f430907c439aec7c9d5dba1b9c8309cd golang.sh
|
||||||
|
|
12
golang.sh
12
golang.sh
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euo pipefail
|
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
|
grep "golang.sh" | sha256sum -c || exit 2
|
||||||
|
|
||||||
(which zip 2>&1 1>/dev/null) || {
|
(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
|
(which apt-get 2>&1 1>/dev/null) && apt-get install -y zip
|
||||||
}
|
}
|
||||||
|
|
||||||
function step {
|
function step() {
|
||||||
echo "===> $@..."
|
echo "===> $@..."
|
||||||
}
|
}
|
||||||
|
|
||||||
VERSION=$(git describe --tags --exact-match || echo "ghpublish__notags")
|
VERSION=$(git describe --tags --exact-match || echo "ghpublish__notags")
|
||||||
PWD=$(pwd)
|
PWD=$(pwd)
|
||||||
godir=${PWD/${GOPATH}\/src\/}
|
godir=${PWD/${GOPATH}\/src\//}
|
||||||
REPO=${REPO:-$(echo ${godir} | cut -d '/' -f 3)}
|
REPO=${REPO:-$(echo ${godir} | cut -d '/' -f 3)}
|
||||||
GHUSER=${GHUSER:-$(echo ${godir} | cut -d '/' -f 2)}
|
GHUSER=${GHUSER:-$(echo ${godir} | cut -d '/' -f 2)}
|
||||||
ARCHS=${ARCHS:-"linux/amd64 linux/arm darwin/amd64 windows/amd64"}
|
ARCHS=${ARCHS:-"linux/amd64 linux/arm darwin/amd64 windows/amd64"}
|
||||||
|
@ -31,6 +31,9 @@ step Test code
|
||||||
go vet ${PACKAGES}
|
go vet ${PACKAGES}
|
||||||
go test ${PACKAGES}
|
go test ${PACKAGES}
|
||||||
|
|
||||||
|
step Cleanup build directory if present
|
||||||
|
rm -rf ${BUILD_DIR}
|
||||||
|
|
||||||
step Compile program
|
step Compile program
|
||||||
mkdir ${BUILD_DIR}
|
mkdir ${BUILD_DIR}
|
||||||
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" \
|
gox -ldflags="-X main.version=${VERSION}" -osarch="${ARCHS}" \
|
||||||
|
@ -85,7 +88,4 @@ done
|
||||||
echo -e "\n\n=== Recorded checksums ==="
|
echo -e "\n\n=== Recorded checksums ==="
|
||||||
cat SHA256SUMS
|
cat SHA256SUMS
|
||||||
|
|
||||||
step Cleanup build directory
|
|
||||||
cd -
|
cd -
|
||||||
rm -rf ${BUILD_DIR}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue