diff --git a/.gitea/workflows/gui-version-release.yml b/.gitea/workflows/gui-version-release.yml index 8ccb6c6..0c2f941 100644 --- a/.gitea/workflows/gui-version-release.yml +++ b/.gitea/workflows/gui-version-release.yml @@ -81,23 +81,13 @@ jobs: # Retry mechanism: maximum 3 attempts $SUCCESS = $false - $VERSION = "" for ($i = 1; $i -le 3; $i++) { Write-Host "Attempt $i to create version record..." - $output = python .gitea/scripts/gui_version_creator.py | Out-String + python .gitea/scripts/gui_version_creator.py if ($LASTEXITCODE -eq 0) { Write-Host "Version record created successfully" $SUCCESS = $true - - # Extract version from JSON output (last line) - $jsonLine = ($output -split "`n" | Where-Object { $_ -match '^\{' } | Select-Object -Last 1) - if ($jsonLine) { - $json = $jsonLine | ConvertFrom-Json - $VERSION = $json.version - Write-Host "Created version: $VERSION" - } - break } else { Write-Host "Attempt $i failed" @@ -115,6 +105,16 @@ jobs: exit 1 } + # Read version from updated config.py + $VERSION = "" + if (Test-Path "config.py") { + $configContent = Get-Content "config.py" -Raw + if ($configContent -match 'APP_VERSION\s*=\s*"([\d.]+)"') { + $VERSION = $matches[1] + Write-Host "Detected version: $VERSION" + } + } + # Set version for next steps echo "VERSION=$VERSION" >> $env:GITHUB_ENV env: