This commit is contained in:
@@ -59,33 +59,15 @@ jobs:
|
||||
|
||||
release_json=$(curl -sS -H "Authorization: token ${RELEASE_TOKEN}" \
|
||||
"${API_URL}/repos/${REPO}/releases/tags/${TAG}")
|
||||
release_id=$(python3 - <<'PY'
|
||||
import json, sys
|
||||
data = json.load(sys.stdin)
|
||||
print(data.get("id", ""))
|
||||
PY
|
||||
<<<"$release_json")
|
||||
release_id=$(python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' <<<"$release_json")
|
||||
|
||||
if [ -z "$release_id" ]; then
|
||||
create_payload=$(python3 - <<'PY'
|
||||
import json, os
|
||||
print(json.dumps({
|
||||
"tag_name": os.environ["TAG"],
|
||||
"name": os.environ["TAG"],
|
||||
"body": ""
|
||||
}))
|
||||
PY
|
||||
)
|
||||
create_payload=$(python3 -c 'import json,os; print(json.dumps({"tag_name": os.environ["TAG"], "name": os.environ["TAG"], "body": ""}))')
|
||||
release_json=$(curl -sS -H "Authorization: token ${RELEASE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$create_payload" \
|
||||
"${API_URL}/repos/${REPO}/releases")
|
||||
release_id=$(python3 - <<'PY'
|
||||
import json, sys
|
||||
data = json.load(sys.stdin)
|
||||
print(data.get("id", ""))
|
||||
PY
|
||||
<<<"$release_json")
|
||||
release_id=$(python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' <<<"$release_json")
|
||||
fi
|
||||
|
||||
for file in dist/*.tar.gz; do
|
||||
|
||||
Reference in New Issue
Block a user