Compare commits
	
		
			11 Commits
		
	
	
		
			v1.3.22
			...
			946202de0e
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 946202de0e | |||
| 41a3717347 | |||
| 255c820439 | |||
| aef3ba77ba | |||
| 2592c3a497 | |||
| a48c5dfef0 | |||
| 00554d0b09 | |||
| 05a91cd8d8 | |||
| 7cf113eaff | |||
| 44d27adab2 | |||
| e0a2dff5fe | 
							
								
								
									
										80
									
								
								.github/workflows/gitea-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										80
									
								
								.github/workflows/gitea-release.yml
									
									
									
									
										vendored
									
									
								
							@@ -71,32 +71,74 @@ jobs:
 | 
				
			|||||||
        echo "$CHANGELOG" >> $GITHUB_OUTPUT
 | 
					        echo "$CHANGELOG" >> $GITHUB_OUTPUT
 | 
				
			||||||
        echo "EOF" >> $GITHUB_OUTPUT
 | 
					        echo "EOF" >> $GITHUB_OUTPUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - name: Determine Gitea URL
 | 
				
			||||||
 | 
					      id: gitea_url
 | 
				
			||||||
 | 
					      run: |
 | 
				
			||||||
 | 
					        echo "Debug Environment:"
 | 
				
			||||||
 | 
					        echo "GITHUB_SERVER_URL=${GITHUB_SERVER_URL:-not set}"
 | 
				
			||||||
 | 
					        echo "GITEA_SERVER_URL=${GITEA_SERVER_URL:-not set}"
 | 
				
			||||||
 | 
					        echo "GITHUB_REPOSITORY=${GITHUB_REPOSITORY:-not set}"
 | 
				
			||||||
 | 
					        echo "GITEA_REPOSITORY=${GITEA_REPOSITORY:-not set}"
 | 
				
			||||||
 | 
					        echo "RUNNER_NAME=${RUNNER_NAME:-not set}"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        # Set API URL based on environment
 | 
				
			||||||
 | 
					        if [ -n "${GITEA_ACTIONS}" ] || [ -n "${GITEA_REPOSITORY}" ] || [[ "${RUNNER_NAME}" == *"gitea"* ]]; then
 | 
				
			||||||
 | 
					          GITEA_API_URL="${GITHUB_SERVER_URL}"
 | 
				
			||||||
 | 
					          GITEA_REPO=$(echo "${GITHUB_REPOSITORY}" | cut -d'/' -f2)
 | 
				
			||||||
 | 
					          GITEA_OWNER=$(echo "${GITHUB_REPOSITORY}" | cut -d'/' -f1)
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					          echo "Error: This workflow is only for Gitea"
 | 
				
			||||||
 | 
					          exit 1
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        echo "GITEA_API_URL=${GITEA_API_URL}" >> $GITHUB_OUTPUT
 | 
				
			||||||
 | 
					        echo "GITEA_REPO=${GITEA_REPO}" >> $GITHUB_OUTPUT
 | 
				
			||||||
 | 
					        echo "GITEA_OWNER=${GITEA_OWNER}" >> $GITHUB_OUTPUT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - name: Create Gitea Release
 | 
					    - name: Create Gitea Release
 | 
				
			||||||
      env:
 | 
					      env:
 | 
				
			||||||
        GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
 | 
					        GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
 | 
				
			||||||
        GITEA_API_URL: ${{ secrets.GITEA_API_URL }}
 | 
					        GITEA_API_URL: ${{ steps.gitea_url.outputs.GITEA_API_URL }}
 | 
				
			||||||
        GITEA_REPO: ${{ secrets.GITEA_REPO }}
 | 
					        GITEA_REPO: ${{ steps.gitea_url.outputs.GITEA_REPO }}
 | 
				
			||||||
        GITEA_OWNER: ${{ secrets.GITEA_OWNER }}
 | 
					        GITEA_OWNER: ${{ steps.gitea_url.outputs.GITEA_OWNER }}
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        VERSION=${{ steps.get_version.outputs.VERSION }}
 | 
					        VERSION=${{ steps.get_version.outputs.VERSION }}
 | 
				
			||||||
        cd .pio/build/esp32dev
 | 
					        cd .pio/build/esp32dev
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 | 
					        # Debug-Ausgaben
 | 
				
			||||||
 | 
					        echo "Debug: Checking API URL..."
 | 
				
			||||||
 | 
					        echo "GITEA_API_URL=${GITEA_API_URL}"
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
        # Prepare files for upload
 | 
					        # Prepare files for upload
 | 
				
			||||||
        FILES=""
 | 
					        FILES=""
 | 
				
			||||||
        for file in upgrade_filaman_firmware_v${VERSION}.bin upgrade_filaman_website_v${VERSION}.bin filaman_full_${VERSION}.bin; do
 | 
					        for file in upgrade_filaman_firmware_v${VERSION}.bin upgrade_filaman_website_v${VERSION}.bin filaman_full_${VERSION}.bin; do
 | 
				
			||||||
          if [ -f "$file" ]; then
 | 
					          if [ -f "$file" ]; then
 | 
				
			||||||
            FILES="$FILES -a $file"
 | 
					            FILES="$FILES -a $file"
 | 
				
			||||||
 | 
					            echo "Debug: Found file: $file"
 | 
				
			||||||
          fi
 | 
					          fi
 | 
				
			||||||
        done
 | 
					        done
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        # Check if tag exists
 | 
					        # Check if tag exists
 | 
				
			||||||
        if ! git rev-parse "v${VERSION}" >/dev/null 2>&1; then
 | 
					        if ! git rev-parse "v${VERSION}" >/dev/null 2>&1; then
 | 
				
			||||||
          # Create tag if it doesn't exist
 | 
					          echo "Debug: Creating new tag v${VERSION}"
 | 
				
			||||||
          git tag -a "v${VERSION}" -m "Release ${VERSION}"
 | 
					          git tag -a "v${VERSION}" -m "Release ${VERSION}"
 | 
				
			||||||
          git push origin "v${VERSION}"
 | 
					          git push origin "v${VERSION}"
 | 
				
			||||||
 | 
					        else
 | 
				
			||||||
 | 
					          echo "Debug: Tag v${VERSION} already exists"
 | 
				
			||||||
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        # Test API connection
 | 
				
			||||||
 | 
					        echo "Debug: Testing API connection..."
 | 
				
			||||||
 | 
					        TEST_RESPONSE=$(curl -s -w "\n%{http_code}" -H "Authorization: token ${GITEA_TOKEN}" "${GITEA_API_URL}/api/v1/version")
 | 
				
			||||||
 | 
					        TEST_STATUS=$(echo "$TEST_RESPONSE" | tail -n1)
 | 
				
			||||||
 | 
					        if [ "$TEST_STATUS" != "200" ]; then
 | 
				
			||||||
 | 
					          echo "Error: Cannot connect to Gitea API"
 | 
				
			||||||
 | 
					          echo "Response: $TEST_RESPONSE"
 | 
				
			||||||
 | 
					          exit 1
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Create Gitea release using API
 | 
					        # Create Gitea release using API
 | 
				
			||||||
 | 
					        echo "Debug: Creating release..."
 | 
				
			||||||
        RELEASE_DATA="{
 | 
					        RELEASE_DATA="{
 | 
				
			||||||
          \"tag_name\": \"v${VERSION}\",
 | 
					          \"tag_name\": \"v${VERSION}\",
 | 
				
			||||||
          \"name\": \"v${VERSION}\",
 | 
					          \"name\": \"v${VERSION}\",
 | 
				
			||||||
@@ -104,37 +146,19 @@ jobs:
 | 
				
			|||||||
        }"
 | 
					        }"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Create release and capture HTTP status
 | 
					        # Create release and capture HTTP status
 | 
				
			||||||
        RESPONSE=$(curl -s -w "%{http_code}" -X POST \
 | 
					        RESPONSE=$(curl -v -s -w "\n%{http_code}" -X POST \
 | 
				
			||||||
          -H "Authorization: token ${GITEA_TOKEN}" \
 | 
					          -H "Authorization: token ${GITEA_TOKEN}" \
 | 
				
			||||||
          -H "Content-Type: application/json" \
 | 
					          -H "Content-Type: application/json" \
 | 
				
			||||||
          -d "$RELEASE_DATA" \
 | 
					          -d "$RELEASE_DATA" \
 | 
				
			||||||
          "${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases")
 | 
					          "${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases")
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        HTTP_STATUS=${RESPONSE: -3}
 | 
					        HTTP_STATUS=$(echo "$RESPONSE" | tail -n1)
 | 
				
			||||||
        RESPONSE_BODY=${RESPONSE:0:-3}
 | 
					        RESPONSE_BODY=$(echo "$RESPONSE" | head -n -1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        echo "Debug: HTTP Status: $HTTP_STATUS"
 | 
				
			||||||
 | 
					        echo "Debug: Response Body: $RESPONSE_BODY"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if [ "$HTTP_STATUS" != "201" ]; then
 | 
					        if [ "$HTTP_STATUS" != "201" ]; then
 | 
				
			||||||
          echo "Fehler beim Erstellen des Releases: $RESPONSE_BODY"
 | 
					          echo "Fehler beim Erstellen des Releases: $RESPONSE_BODY"
 | 
				
			||||||
          exit 1
 | 
					          exit 1
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
 | 
					 | 
				
			||||||
        # Extract release ID from response
 | 
					 | 
				
			||||||
        RELEASE_ID=$(echo "$RESPONSE_BODY" | jq -r .id)
 | 
					 | 
				
			||||||
        
 | 
					 | 
				
			||||||
        # Upload assets
 | 
					 | 
				
			||||||
        for file in upgrade_filaman_firmware_v${VERSION}.bin upgrade_filaman_website_v${VERSION}.bin filaman_full_${VERSION}.bin; do
 | 
					 | 
				
			||||||
          if [ -f "$file" ]; then
 | 
					 | 
				
			||||||
            echo "Uploading $file..."
 | 
					 | 
				
			||||||
            UPLOAD_RESPONSE=$(curl -s -w "%{http_code}" -X POST \
 | 
					 | 
				
			||||||
              -H "Authorization: token ${GITEA_TOKEN}" \
 | 
					 | 
				
			||||||
              -H "Content-Type: application/octet-stream" \
 | 
					 | 
				
			||||||
              --data-binary @"$file" \
 | 
					 | 
				
			||||||
              "${GITEA_API_URL}/api/v1/repos/${GITEA_OWNER}/${GITEA_REPO}/releases/${RELEASE_ID}/assets?name=${file}")
 | 
					 | 
				
			||||||
            
 | 
					 | 
				
			||||||
            UPLOAD_STATUS=${UPLOAD_RESPONSE: -3}
 | 
					 | 
				
			||||||
            if [ "$UPLOAD_STATUS" != "201" ]; then
 | 
					 | 
				
			||||||
              echo "Fehler beim Upload von $file"
 | 
					 | 
				
			||||||
              exit 1
 | 
					 | 
				
			||||||
            fi
 | 
					 | 
				
			||||||
          fi
 | 
					 | 
				
			||||||
        done
 | 
					 | 
				
			||||||
							
								
								
									
										4
									
								
								.github/workflows/github-release.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/github-release.yml
									
									
									
									
										vendored
									
									
								
							@@ -115,12 +115,12 @@ jobs:
 | 
				
			|||||||
        FILES_TO_UPLOAD=""
 | 
					        FILES_TO_UPLOAD=""
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        # Always add firmware
 | 
					        # Always add firmware
 | 
				
			||||||
        if [ -f "update_filaman_firmware_v${VERSION}.bin" ]; then
 | 
					        if [ -f "upgrade_filaman_firmware_v${VERSION}.bin" ]; then
 | 
				
			||||||
          FILES_TO_UPLOAD="$FILES_TO_UPLOAD upgrade_filaman_firmware_v${VERSION}.bin"
 | 
					          FILES_TO_UPLOAD="$FILES_TO_UPLOAD upgrade_filaman_firmware_v${VERSION}.bin"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        # Add SPIFFS and full binary only if they exist
 | 
					        # Add SPIFFS and full binary only if they exist
 | 
				
			||||||
        if [ -f "update_filaman_website_v${VERSION}.bin" ]; then
 | 
					        if [ -f "upgrade_filaman_website_v${VERSION}.bin" ]; then
 | 
				
			||||||
          FILES_TO_UPLOAD="$FILES_TO_UPLOAD upgrade_filaman_website_v${VERSION}.bin"
 | 
					          FILES_TO_UPLOAD="$FILES_TO_UPLOAD upgrade_filaman_website_v${VERSION}.bin"
 | 
				
			||||||
        fi
 | 
					        fi
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										24
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								CHANGELOG.md
									
									
									
									
									
								
							@@ -1,5 +1,29 @@
 | 
				
			|||||||
# Changelog
 | 
					# Changelog
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.3.25] - 2025-02-21
 | 
				
			||||||
 | 
					### Changed
 | 
				
			||||||
 | 
					- update webpages for version v1.3.25
 | 
				
			||||||
 | 
					- workflow: update Gitea release workflow to include RUNNER_NAME and improve error handling
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.3.24] - 2025-02-21
 | 
				
			||||||
 | 
					### Changed
 | 
				
			||||||
 | 
					- update webpages for version v1.3.24
 | 
				
			||||||
 | 
					- workflow: rename update files to upgrade in GitHub release workflow
 | 
				
			||||||
 | 
					- workflow: aktualisiere bestehende Einträge im Changelog für vorhandene Versionen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Fixed
 | 
				
			||||||
 | 
					- workflow: improve Gitea release process with dynamic URL determination and debug outputs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## [1.3.23] - 2025-02-21
 | 
				
			||||||
 | 
					### Changed
 | 
				
			||||||
 | 
					- update webpages for version v1.3.23
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### Fixed
 | 
				
			||||||
 | 
					- workflow: enhance Gitea release process with debug outputs and API connection checks
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## [1.3.22] - 2025-02-21
 | 
					## [1.3.22] - 2025-02-21
 | 
				
			||||||
### Added
 | 
					### Added
 | 
				
			||||||
- workflow: improve Gitea release process with additional environment variables and error handling
 | 
					- workflow: improve Gitea release process with additional environment variables and error handling
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@
 | 
				
			|||||||
; https://docs.platformio.org/page/projectconf.html
 | 
					; https://docs.platformio.org/page/projectconf.html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[common]
 | 
					[common]
 | 
				
			||||||
version = "1.3.22"
 | 
					version = "1.3.25"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#test
 | 
					#test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -122,29 +122,29 @@ def update_changelog():
 | 
				
			|||||||
                f.write(updated_content)
 | 
					                f.write(updated_content)
 | 
				
			||||||
            push_changes(version)
 | 
					            push_changes(version)
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            # Version existiert bereits, füge neue Einträge unter der existierenden Version ein
 | 
					            # Version existiert bereits, aktualisiere die bestehenden Einträge
 | 
				
			||||||
            version_pattern = f"## \\[{version}\\] - \\d{{4}}-\\d{{2}}-\\d{{2}}"
 | 
					            version_pattern = f"## \\[{version}\\] - \\d{{4}}-\\d{{2}}-\\d{{2}}"
 | 
				
			||||||
            next_version_pattern = "## \\[.*?\\] - \\d{4}-\\d{2}-\\d{2}"
 | 
					            next_version_pattern = "## \\[.*?\\] - \\d{4}-\\d{2}-\\d{2}"
 | 
				
			||||||
            
 | 
					            
 | 
				
			||||||
            # Finde den Start der aktuellen Version
 | 
					            # Finde den Start der aktuellen Version
 | 
				
			||||||
            version_match = re.search(version_pattern, content)
 | 
					            version_match = re.search(version_pattern, content)
 | 
				
			||||||
            if version_match:
 | 
					            if version_match:
 | 
				
			||||||
                version_start = version_match.end()
 | 
					                version_start = version_match.start()
 | 
				
			||||||
                # Suche nach der nächsten Version
 | 
					                # Suche nach der nächsten Version
 | 
				
			||||||
                next_version_match = re.search(next_version_pattern, content[version_start:])
 | 
					                next_version_match = re.search(next_version_pattern, content[version_start + 1:])
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                if next_version_match:
 | 
					                if next_version_match:
 | 
				
			||||||
                    # Füge zwischen aktueller und nächster Version ein
 | 
					                    # Ersetze den Inhalt zwischen aktueller und nächster Version
 | 
				
			||||||
                    insert_pos = version_start + next_version_match.start()
 | 
					                    next_version_pos = version_start + 1 + next_version_match.start()
 | 
				
			||||||
                    updated_content = content[:insert_pos] + "\n" + changelog_entry + content[insert_pos:]
 | 
					                    updated_content = content[:version_start] + changelog_entry + content[next_version_pos:]
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    # Füge am Ende des Abschnitts ein
 | 
					                    # Wenn keine nächste Version existiert, ersetze bis zum Ende
 | 
				
			||||||
                    updated_content = content[:version_start] + "\n" + changelog_entry + content[version_start:]
 | 
					                    updated_content = content[:version_start] + changelog_entry + "\n"
 | 
				
			||||||
                
 | 
					                
 | 
				
			||||||
                with open(changelog_path, 'w') as f:
 | 
					                with open(changelog_path, 'w') as f:
 | 
				
			||||||
                    f.write(updated_content)
 | 
					                    f.write(updated_content)
 | 
				
			||||||
                push_changes(version)
 | 
					                push_changes(version)
 | 
				
			||||||
                print(f"Added new entries to existing version {version}")
 | 
					                print(f"Updated entries for version {version}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
    update_changelog()
 | 
					    update_changelog()
 | 
				
			||||||
		Reference in New Issue
	
	Block a user