From 41b686fff62d15c197c52e7b47d2ff57826ad00a Mon Sep 17 00:00:00 2001 From: jjz <3082705704@qq.com> Date: Thu, 9 Oct 2025 17:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BD=91=E7=BB=9C=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/gui-version-release.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) 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: