From 7bec3d5c3b2361d23143bba80c439c32de87ce1b Mon Sep 17 00:00:00 2001 From: forbes Date: Sat, 7 Feb 2026 08:20:24 -0600 Subject: [PATCH] fix(ci): fix release creation and artifact collection - Exclude appimagetool from artifact upload (FreeCAD_*.AppImage glob) - Build release JSON payload in Python to fix false/False type error (shell 'false' is not valid Python; use bool with re.search instead) --- .gitea/workflows/release.yml | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 50db6e8c0d..d6d7a19dd2 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -131,7 +131,7 @@ jobs: with: name: release-linux path: | - package/rattler-build/linux/*.AppImage + package/rattler-build/linux/FreeCAD_*.AppImage package/rattler-build/linux/*.deb package/rattler-build/linux/*-SHA256.txt package/rattler-build/linux/*.sha256 @@ -347,12 +347,13 @@ jobs: REPO: ${{ github.repository }} run: | TAG="${BUILD_TAG}" - PRERELEASE=false - if echo "$TAG" | grep -qE '(rc|beta|alpha)'; then - PRERELEASE=true - fi - BODY="## Kindred Create ${TAG} + # Build JSON payload entirely in Python to avoid shell/Python type mismatches + PAYLOAD=$(python3 -c " + import json, re + tag = '${TAG}' + prerelease = bool(re.search(r'(rc|beta|alpha)', tag)) + body = '''## Kindred Create {tag} ### Downloads @@ -363,7 +364,14 @@ jobs: *macOS and Windows builds are not yet available.* - SHA256 checksums are provided alongside each artifact." + SHA256 checksums are provided alongside each artifact.'''.format(tag=tag) + print(json.dumps({ + 'tag_name': tag, + 'name': f'Kindred Create {tag}', + 'body': body, + 'prerelease': prerelease, + })) + ") # Delete existing release for this tag (if any) so we can recreate existing=$(curl -s -o /dev/null -w "%{http_code}" \ @@ -384,12 +392,7 @@ jobs: release_id=$(curl -s -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \ - -d "$(python3 -c "import json; print(json.dumps({ - 'tag_name': '${TAG}', - 'name': 'Kindred Create ${TAG}', - 'body': '''${BODY}''', - 'prerelease': ${PRERELEASE} - }))")" \ + -d "$PAYLOAD" \ "${GITEA_URL}/api/v1/repos/${REPO}/releases" | \ python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") echo "Created release ${release_id}"