Compare commits

..

No commits in common. "31ef3ac8df112c6edc0ce1df6fe3c8425c6e2ec5" and "8e2a8d597d007056c74208f14383c5fc67885b4f" have entirely different histories.

3 changed files with 42 additions and 47 deletions

View File

@ -120,46 +120,47 @@ jobs:
echo "Debug: API URL: ${GITEA_API_URL}" echo "Debug: API URL: ${GITEA_API_URL}"
echo "Debug: Repository: ${GITEA_OWNER}/${GITEA_REPO}" echo "Debug: Repository: ${GITEA_OWNER}/${GITEA_REPO}"
# Erstelle zuerst den Release ohne Dateien # Prepare files for upload
echo "Debug: Creating release..." FILES=""
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.changelog.outputs.CHANGES }}\"}" for file in upgrade_filaman_firmware_v${VERSION}.bin upgrade_filaman_website_v${VERSION}.bin filaman_full_${VERSION}.bin; do
if [ -f "$file" ]; then
FILES="$FILES -F \"attach[]=@$file\""
echo "Debug: Found file: $file"
fi
done
RELEASE_RESPONSE=$(curl -s -w "\n%{http_code}" \ # Test API connection with explicit token header
-X POST \ echo "Debug: Testing API connection..."
TEST_RESPONSE=$(curl -s -w "\n%{http_code}" \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \ "${GITEA_API_URL}/api/v1/version")
-d "${RELEASE_DATA}" \ TEST_STATUS=$(echo "$TEST_RESPONSE" | tail -n1)
"${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases") if [ "$TEST_STATUS" != "200" ]; then
echo "Error: Cannot connect to Gitea API"
RELEASE_STATUS=$(echo "$RELEASE_RESPONSE" | tail -n1) echo "Response: $TEST_RESPONSE"
RELEASE_BODY=$(echo "$RELEASE_RESPONSE" | head -n -1)
if [ "$RELEASE_STATUS" != "201" ]; then
echo "Error: Failed to create release"
echo "Response: $RELEASE_BODY"
exit 1 exit 1
fi fi
# Extrahiere die Release-ID aus der Antwort # Create release using API
RELEASE_ID=$(echo "$RELEASE_BODY" | grep -o '"id":[0-9]*' | cut -d':' -f2) echo "Debug: Creating release..."
RELEASE_DATA="{\"tag_name\":\"v${VERSION}\",\"name\":\"v${VERSION}\",\"body\":\"${{ steps.changelog.outputs.CHANGES }}\"}"
# Lade die Dateien einzeln hoch # Create release with explicit token header and file uploads
for file in upgrade_filaman_firmware_v${VERSION}.bin upgrade_filaman_website_v${VERSION}.bin filaman_full_${VERSION}.bin; do CURL_CMD="curl -s -w \"\n%{http_code}\" \
if [ -f "$file" ]; then
echo "Debug: Uploading $file..."
UPLOAD_RESPONSE=$(curl -s -w "\n%{http_code}" \
-X POST \ -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \ -H \"Authorization: token ${GITEA_TOKEN}\" \
-H "Content-Type: application/octet-stream" \ -H \"Content-Type: application/json\" \
--data-binary @"$file" \ -d '${RELEASE_DATA}' \
"${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases/${RELEASE_ID}/assets?name=${file}") ${FILES} \
\"${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases\""
UPLOAD_STATUS=$(echo "$UPLOAD_RESPONSE" | tail -n1) RESPONSE=$(eval $CURL_CMD)
if [ "$UPLOAD_STATUS" != "201" ]; then
echo "Warning: Failed to upload $file" HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
echo "Response: $(echo "$UPLOAD_RESPONSE" | head -n -1)" RESPONSE_BODY=$(echo "$RESPONSE" | head -n -1)
else
echo "Successfully uploaded $file" echo "Debug: HTTP Status: $HTTP_STATUS"
fi if [ "$HTTP_STATUS" != "201" ]; then
fi echo "Error: Failed to create release"
done echo "Response: $RESPONSE_BODY"
exit 1

View File

@ -1,11 +1,5 @@
# Changelog # Changelog
## [1.3.29] - 2025-02-21
### Changed
- update webpages for version v1.3.29
- workflow: update Gitea release workflow to create release before file uploads
## [1.3.28] - 2025-02-21 ## [1.3.28] - 2025-02-21
### Changed ### Changed
- update webpages for version v1.3.28 - update webpages for version v1.3.28

View File

@ -9,7 +9,7 @@
; https://docs.platformio.org/page/projectconf.html ; https://docs.platformio.org/page/projectconf.html
[common] [common]
version = "1.3.29" version = "1.3.28"
#test #test