Compare commits
No commits in common. "be784c37efdddec796e42b4ea512b07742f9c2f3" and "720b7f3e543b3e84da76b8bc62ae2a331ed89c47" have entirely different histories.
be784c37ef
...
720b7f3e54
20
lib
20
lib
|
@ -21,6 +21,22 @@ function create-commit(){
|
|||
}
|
||||
|
||||
function create-release(){
|
||||
if [[ -z "${TAG}" ]]; then
|
||||
echo "TAG key is not set"
|
||||
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
|
||||
delete-tag
|
||||
RELEASE_TAG="$1"
|
||||
else
|
||||
RELEASE_TAG="$1-$DRONE_BRANCH"
|
||||
fi
|
||||
|
||||
COMMIT_SHA=$(git rev-parse HEAD)
|
||||
RESPONSE=$(curl \
|
||||
-X 'POST' \
|
||||
|
@ -30,9 +46,9 @@ function create-release(){
|
|||
-H 'Authorization: Bearer 10e4af53e553aacb905766512e36487492d61a66' \
|
||||
-d '{
|
||||
"draft": false,
|
||||
"name": "'"release $RELEASE"'",
|
||||
"name": "'"release $RELEASE_TAG"'",
|
||||
"prerelease": false,
|
||||
"tag_name": "'"$RELEASE"'",
|
||||
"tag_name": "'"$RELEASE_TAG"'",
|
||||
"target_commitish": "'"$COMMIT_SHA"'"
|
||||
}')
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue