fix(ci): fix release creation and artifact collection
All checks were successful
Build and Test / build (push) Successful in 1h5m11s
All checks were successful
Build and Test / build (push) Successful in 1h5m11s
- 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)
This commit is contained in:
@@ -131,7 +131,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: release-linux
|
name: release-linux
|
||||||
path: |
|
path: |
|
||||||
package/rattler-build/linux/*.AppImage
|
package/rattler-build/linux/FreeCAD_*.AppImage
|
||||||
package/rattler-build/linux/*.deb
|
package/rattler-build/linux/*.deb
|
||||||
package/rattler-build/linux/*-SHA256.txt
|
package/rattler-build/linux/*-SHA256.txt
|
||||||
package/rattler-build/linux/*.sha256
|
package/rattler-build/linux/*.sha256
|
||||||
@@ -347,12 +347,13 @@ jobs:
|
|||||||
REPO: ${{ github.repository }}
|
REPO: ${{ github.repository }}
|
||||||
run: |
|
run: |
|
||||||
TAG="${BUILD_TAG}"
|
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
|
### Downloads
|
||||||
|
|
||||||
@@ -363,7 +364,14 @@ jobs:
|
|||||||
|
|
||||||
*macOS and Windows builds are not yet available.*
|
*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
|
# Delete existing release for this tag (if any) so we can recreate
|
||||||
existing=$(curl -s -o /dev/null -w "%{http_code}" \
|
existing=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||||
@@ -384,12 +392,7 @@ jobs:
|
|||||||
release_id=$(curl -s -X POST \
|
release_id=$(curl -s -X POST \
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "$(python3 -c "import json; print(json.dumps({
|
-d "$PAYLOAD" \
|
||||||
'tag_name': '${TAG}',
|
|
||||||
'name': 'Kindred Create ${TAG}',
|
|
||||||
'body': '''${BODY}''',
|
|
||||||
'prerelease': ${PRERELEASE}
|
|
||||||
}))")" \
|
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases" | \
|
"${GITEA_URL}/api/v1/repos/${REPO}/releases" | \
|
||||||
python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
||||||
echo "Created release ${release_id}"
|
echo "Created release ${release_id}"
|
||||||
|
|||||||
Reference in New Issue
Block a user