forked from um/web
ci: skip upload step when api key is empty (usually happens for PR)
This commit is contained in:
parent
e21456d38f
commit
f97cb04159
@ -4,11 +4,16 @@ set -ex
|
|||||||
|
|
||||||
cd "$(git rev-parse --show-toplevel)"
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
if [ -z "$GITEA_API_KEY" ]; then
|
||||||
|
echo "GITEA_API_KEY is empty, skip upload."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
URL_BASE="$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build"
|
URL_BASE="$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build"
|
||||||
|
|
||||||
for ZIP_NAME in *.zip; do
|
for ZIP_NAME in *.zip; do
|
||||||
UPLOAD_URL="${URL_BASE}/${DRONE_BUILD_NUMBER}/${ZIP_NAME}"
|
UPLOAD_URL="${URL_BASE}/${DRONE_BUILD_NUMBER}/${ZIP_NAME}"
|
||||||
sha256sum "${ZIP_NAME}"
|
sha256sum "${ZIP_NAME}"
|
||||||
curl -sLifu "um-release-bot:$GITEA_API_KEY" -T "${ZIP_NAME}" "${UPLOAD_URL}"
|
curl -sLifu "um-release-bot:$GITEA_API_KEY" -T "${ZIP_NAME}" "${UPLOAD_URL}"
|
||||||
echo "Uploaded to: ${UPLOAD_URL}"
|
echo "Uploaded to: ${UPLOAD_URL}"
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user