修改网络问题
This commit is contained in:
@@ -81,23 +81,13 @@ jobs:
|
|||||||
|
|
||||||
# Retry mechanism: maximum 3 attempts
|
# Retry mechanism: maximum 3 attempts
|
||||||
$SUCCESS = $false
|
$SUCCESS = $false
|
||||||
$VERSION = ""
|
|
||||||
for ($i = 1; $i -le 3; $i++) {
|
for ($i = 1; $i -le 3; $i++) {
|
||||||
Write-Host "Attempt $i to create version record..."
|
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) {
|
if ($LASTEXITCODE -eq 0) {
|
||||||
Write-Host "Version record created successfully"
|
Write-Host "Version record created successfully"
|
||||||
$SUCCESS = $true
|
$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
|
break
|
||||||
} else {
|
} else {
|
||||||
Write-Host "Attempt $i failed"
|
Write-Host "Attempt $i failed"
|
||||||
@@ -115,6 +105,16 @@ jobs:
|
|||||||
exit 1
|
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
|
# Set version for next steps
|
||||||
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
|
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
|
||||||
env:
|
env:
|
||||||
|
|||||||
Reference in New Issue
Block a user