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

Fix: Flag parser of github-release behaves different as expected

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-08-10 12:18:04 +02:00
parent 69acf19945
commit f209f099ea
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
2 changed files with 17 additions and 12 deletions

View file

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

View file

@ -26,28 +26,28 @@ DRAFT=${DRAFT:-true}
go version go version
step Retrieve dependencies step "Retrieve dependencies"
go get github.com/aktau/github-release go get github.com/aktau/github-release
go get github.com/mitchellh/gox go get github.com/mitchellh/gox
step Test code step "Test code"
go vet ${PACKAGES} go vet ${PACKAGES}
go test ${PACKAGES} go test ${PACKAGES}
step Cleanup build directory if present step "Cleanup build directory if present"
rm -rf ${BUILD_DIR} 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}" \
-output="${BUILD_DIR}/{{.Dir}}_{{.OS}}_{{.Arch}}" \ -output="${BUILD_DIR}/{{.Dir}}_{{.OS}}_{{.Arch}}" \
${PACKAGES} ${PACKAGES}
step Generate binary SHASUMs step "Generate binary SHASUMs"
cd ${BUILD_DIR} cd ${BUILD_DIR}
sha256sum * >SHA256SUMS sha256sum * >SHA256SUMS
step Packing archives step "Packing archives"
for file in *; do for file in *; do
if [ "${file}" = "SHA256SUMS" ]; then if [ "${file}" = "SHA256SUMS" ]; then
continue continue
@ -62,12 +62,12 @@ for file in *; do
rm "${file}" rm "${file}"
done done
step Generate archive SHASUMs step "Generate archive SHASUMs"
sha256sum * >>SHA256SUMS sha256sum * >>SHA256SUMS
grep -v 'SHA256SUMS' SHA256SUMS >SHA256SUMS.tmp grep -v 'SHA256SUMS' SHA256SUMS >SHA256SUMS.tmp
mv SHA256SUMS.tmp SHA256SUMS mv SHA256SUMS.tmp SHA256SUMS
step Publish builds to Github step "Publish builds to Github"
if (test "${VERSION}" == "ghpublish__notags"); then if (test "${VERSION}" == "ghpublish__notags"); then
echo "No tag present, stopping build now." echo "No tag present, stopping build now."
@ -79,10 +79,15 @@ if [ -z "${GITHUB_TOKEN}" ]; then
exit 1 exit 1
fi fi
step Create a drafted release if [[ "${DRAFT}" == "true" ]]; then
github-release release --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${DEPLOYMENT_TAG} --draft=${DRAFT} || true step "Create a drafted release"
github-release release --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${DEPLOYMENT_TAG} --draft || true
else
step "Create a published release"
github-release release --user ${GHUSER} --repo ${REPO} --tag ${DEPLOYMENT_TAG} --name ${DEPLOYMENT_TAG} || true
fi
step Upload build assets step "Upload build assets"
for file in *; do for file in *; do
echo "- ${file}" echo "- ${file}"
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}