This commit is contained in:
@@ -79,14 +79,15 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
VERSION=${TAG#v}
|
VERSION=${TAG#v}
|
||||||
JAR_PATH=$(ls build/libs/*.jar | head -n 1)
|
JAR_PATH=$(ls build/libs/*.jar | head -n 1)
|
||||||
RELEASE_ID=$(curl -sS -X POST \
|
RELEASE_RESPONSE=$(curl -sS -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
"${GITEA_API}/repos/${GITHUB_REPOSITORY}/releases" \
|
"${GITEA_API}/repos/${GITHUB_REPOSITORY}/releases" \
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false,\"prerelease\":false}")
|
||||||
| python -c "import sys, json; print(json.load(sys.stdin).get('id', ''))")
|
RELEASE_ID=$(printf "%s" "$RELEASE_RESPONSE" | node -e "const fs=require('fs');const data=fs.readFileSync(0,'utf8');const json=JSON.parse(data);process.stdout.write(String(json.id||''));")
|
||||||
if [ -z "$RELEASE_ID" ]; then
|
if [ -z "$RELEASE_ID" ]; then
|
||||||
echo "Failed to create release."
|
echo "Failed to create release."
|
||||||
|
echo "$RELEASE_RESPONSE"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
curl -sS -X POST \
|
curl -sS -X POST \
|
||||||
|
|||||||
Reference in New Issue
Block a user