fix: address all review findings (zero remaining)
Tests: - Add WithTemperature tests (builder method, chaining, zero omission) - Add temperature serialization tests (omitted when 0, included when set) Composite action: - Use python3 for robust JSON version parsing (replaces sed) - Verify SHA-256 checksum before executing downloaded binary - Wire up repo input (no longer hardcodes rodin/review-bot) Release workflow: - Handle 409 conflict (existing release for tag) - Use file-based JSON parsing for reliability Code: - Tighten WithTemperature doc comment (single clear line) - Fix flag alignment (missing tab on llmTemp declaration)
This commit is contained in:
@@ -38,23 +38,34 @@ jobs:
|
||||
GITEA_URL="${{ github.server_url }}"
|
||||
REPO="${{ github.repository }}"
|
||||
|
||||
# Create release
|
||||
RESPONSE=$(curl -sSf -X POST \
|
||||
# Create release (or find existing one for this tag)
|
||||
HTTP_CODE=$(curl -s -o /tmp/release_response.json -w "%{http_code}" -X POST \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
||||
-d "{\"tag_name\": \"${VERSION}\", \"name\": \"${VERSION}\", \"body\": \"Release ${VERSION}\", \"draft\": false, \"prerelease\": false}")
|
||||
|
||||
# Parse release ID using Python (robust JSON parsing)
|
||||
RELEASE_ID=$(echo "$RESPONSE" | python3 -c "import sys, json; print(json.load(sys.stdin)['id'])")
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to create release" >&2
|
||||
echo "$RESPONSE" >&2
|
||||
if [ "$HTTP_CODE" = "409" ]; then
|
||||
echo "Release for ${VERSION} already exists, fetching existing..."
|
||||
curl -sSf -o /tmp/release_response.json \
|
||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases/tags/${VERSION}"
|
||||
elif [ "$HTTP_CODE" != "201" ]; then
|
||||
echo "Failed to create release (HTTP ${HTTP_CODE})" >&2
|
||||
cat /tmp/release_response.json >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Created release ID: ${RELEASE_ID}"
|
||||
# Parse release ID (python3 available on ubuntu-24.04 runners)
|
||||
RELEASE_ID=$(python3 -c "import json; print(json.load(open('/tmp/release_response.json'))['id'])")
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "Failed to parse release ID" >&2
|
||||
cat /tmp/release_response.json >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Release ID: ${RELEASE_ID}"
|
||||
|
||||
# Upload each asset
|
||||
for file in dist/*; do
|
||||
|
||||
Reference in New Issue
Block a user