1
0
Fork 0
mirror of https://github.com/Luzifer/github-publish.git synced 2024-11-09 23:00:14 +00:00

Add flag to skip upload (#2)

This commit is contained in:
Knut Ahlers 2019-02-04 16:24:54 +01:00 committed by GitHub
parent 39ab7ef63c
commit 7c74fa3ca8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 7 deletions

View file

@ -1,2 +1,2 @@
05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh 05e4977d541b2ef07c757acca912b7b58b379fb425eceb3a1f53c829a78a4aa4 docker2aci.sh
bb37ce911951a311e6ab4c27ddbc310d0f609556371be46a47656e70165034cf golang.sh b97c0e9a9ec420d1c29a4236ff949cd01704896961f3d114c1bfb450dde52647 golang.sh

View file

@ -23,6 +23,7 @@ DEPLOYMENT_TAG=${DEPLOYMENT_TAG:-${VERSION}}
PACKAGES=${PACKAGES:-$(echo ${godir} | cut -d '/' -f 1-3)} 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}
go version go version
@ -67,19 +68,27 @@ sha256sum * >>SHA256SUMS
grep -v 'SHA256SUMS' SHA256SUMS >SHA256SUMS.tmp grep -v 'SHA256SUMS' SHA256SUMS >SHA256SUMS.tmp
mv SHA256SUMS.tmp SHA256SUMS mv SHA256SUMS.tmp SHA256SUMS
echo -e "\n\n=== Recorded checksums ==="
cat SHA256SUMS
if [[ ${FORCE_SKIP_UPLOAD} == "true" ]]; then
echo "Upload is skipped, stopping build now."
exit 0
fi
step "Publish builds to Github" step "Publish builds to Github"
if (test "${VERSION}" == "ghpublish__notags"); then if [[ ${VERSION} == "ghpublish__notags" ]]; then
echo "No tag present, stopping build now." echo "No tag present, stopping build now."
exit 0 exit 0
fi fi
if [ -z "${GITHUB_TOKEN}" ]; then if [ -z "${GITHUB_TOKEN}" ]; then
echo "Please set \$GITHUB_TOKEN environment variable" echo 'Please set $GITHUB_TOKEN environment variable'
exit 1 exit 1
fi fi
if [[ "${DRAFT}" == "true" ]]; then if [[ ${DRAFT} == "true" ]]; then
step "Create a drafted release" step "Create a drafted release"
github-release release --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${DEPLOYMENT_TAG} --draft || true github-release release --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${DEPLOYMENT_TAG} --draft || true
else else
@ -93,7 +102,4 @@ for file in *; do
github-release upload --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${file} --file ${file} github-release upload --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${file} --file ${file}
done done
echo -e "\n\n=== Recorded checksums ==="
cat SHA256SUMS
cd - cd -