From cab5b606a9728871de830dbf3f8c01361071ef02 Mon Sep 17 00:00:00 2001 From: Gitea Actions Date: Thu, 9 Oct 2025 17:32:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3job=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/gui-version-release.yml | 36 +++++++++++++++--------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.gitea/workflows/gui-version-release.yml b/.gitea/workflows/gui-version-release.yml index 699f4e5..d2f3d10 100644 --- a/.gitea/workflows/gui-version-release.yml +++ b/.gitea/workflows/gui-version-release.yml @@ -105,22 +105,14 @@ jobs: exit 1 } - # Read version from updated config.py - $VERSION = "" + # Verify version was updated if (Test-Path "config.py") { $configContent = Get-Content "config.py" -Raw if ($configContent -match 'APP_VERSION\s*=\s*"([\d.]+)"') { $VERSION = $matches[1] - Write-Host "Extracted version from config.py: $VERSION" - } else { - Write-Host "Failed to extract version from config.py" + Write-Host "Version updated successfully: $VERSION" } - } else { - Write-Host "config.py not found" } - - # Set version for next steps - echo "VERSION=$VERSION" >> $env:GITHUB_ENV env: DB_HOST: 8.155.9.53 DB_NAME: ai_web @@ -134,7 +126,16 @@ jobs: shell: powershell run: | Write-Host "Committing version changes..." - Write-Host "New version: $env:VERSION" + + # Read version from 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 "New version: $VERSION" + } + } git config user.name "Gitea Actions" git config user.email "actions@gitea.local" @@ -144,7 +145,7 @@ jobs: $hasChanges = git diff --staged --quiet if ($LASTEXITCODE -ne 0) { - git commit -m "[skip ci] Update version to $env:VERSION" + git commit -m "[skip ci] Update version to $VERSION" git push origin master Write-Host "Version changes committed and pushed" } else { @@ -156,12 +157,21 @@ jobs: if: always() shell: powershell run: | + # Read version from config.py + $VERSION = "Unknown" + if (Test-Path "config.py") { + $configContent = Get-Content "config.py" -Raw + if ($configContent -match 'APP_VERSION\s*=\s*"([\d.]+)"') { + $VERSION = $matches[1] + } + } + Write-Host "==========================================" Write-Host "GUI Version Release Summary" Write-Host "==========================================" Write-Host "Author: ${{ github.actor }}" Write-Host "Branch: ${{ github.ref_name }}" - Write-Host "Version: $env:VERSION" + Write-Host "Version: $VERSION" Write-Host "Time: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')" Write-Host "Commit: ${{ github.sha }}" Write-Host "=========================================="