t
continuous-integration/drone/push Build is failing Details

pull/4/head
dmitry.kirdyashkin 2023-07-22 01:52:38 +03:00
parent d1a3356a2e
commit 4e2e32093d
1 changed files with 13 additions and 0 deletions

13
lib
View File

@ -13,6 +13,13 @@ function create-release(){
exit
fi
if [[ $1 == 'latest' ]]; then
echo "Deleting old latest release"
RELEASE_LIST=$(curl -X GET -Url https://gitea.kdiva.ru/api/v1/repos/modules/sc-items/releases)
LATEST_RELEASE_ID=(jq -r '.[] | select(.tag_name=="latest") | .id' <<< $RELEASE_LIST)
delete-release $LATEST_RELEASE_ID
fi
RESPONSE=$(curl \
-X 'POST' \
-Url "https://gitea.kdiva.ru/api/v1/repos/${DRONE_REPO}/releases" \
@ -40,6 +47,12 @@ function upload-attachments(){
-F "attachment=@$1"
}
function delete-release(){
curl \
-X 'DELETE' \
-Url "https://gitea.kdiva.ru/api/v1/repos/${DRONE_REPO}/releases/${1}"
}
function vars() {
echo "DRONE_SEMVER $DRONE_SEMVER"
echo "DRONE_REPO_LINK $DRONE_REPO_LINK"