t
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
d1a3356a2e
commit
4e2e32093d
13
lib
13
lib
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue