Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
416c8b07d2 | ||
|
|
32d4178875 |
@@ -180,13 +180,20 @@ jobs:
|
||||
MD_LIST=$(echo "$COMMIT_LOG" | sed 's/^/- /')
|
||||
BODY=$(printf '%s' "$MD_LIST" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read()))")
|
||||
|
||||
# ── Create the release ───────────────────────────────────────────────
|
||||
RESP=$(curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"Build $VERSION\",\"body\":$BODY,\"draft\":false,\"prerelease\":false}")
|
||||
RELEASE_ID=$(echo "$RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
echo "Created release $TAG (id=$RELEASE_ID)"
|
||||
# ── Create release (idempotent: reuse existing tag if already present) ───
|
||||
EXISTING=$(curl -sf "$API/releases/tags/$TAG" \
|
||||
-H "Authorization: token $TOKEN" || true)
|
||||
if [[ -n "$EXISTING" ]]; then
|
||||
RELEASE_ID=$(echo "$EXISTING" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
echo "Release $TAG already exists (id=$RELEASE_ID) — reusing."
|
||||
else
|
||||
RESP=$(curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"Build $VERSION\",\"body\":$BODY,\"draft\":false,\"prerelease\":false}")
|
||||
RELEASE_ID=$(echo "$RESP" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||
echo "Created release $TAG (id=$RELEASE_ID)"
|
||||
fi
|
||||
|
||||
# ── Upload APKs as release assets ────────────────────────────────────
|
||||
upload_asset() {
|
||||
|
||||
Reference in New Issue
Block a user