解决job构建失败的问题
This commit is contained in:
@@ -105,22 +105,14 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# Read version from updated config.py
|
# Verify version was updated
|
||||||
$VERSION = ""
|
|
||||||
if (Test-Path "config.py") {
|
if (Test-Path "config.py") {
|
||||||
$configContent = Get-Content "config.py" -Raw
|
$configContent = Get-Content "config.py" -Raw
|
||||||
if ($configContent -match 'APP_VERSION\s*=\s*"([\d.]+)"') {
|
if ($configContent -match 'APP_VERSION\s*=\s*"([\d.]+)"') {
|
||||||
$VERSION = $matches[1]
|
$VERSION = $matches[1]
|
||||||
Write-Host "Extracted version from config.py: $VERSION"
|
Write-Host "Version updated successfully: $VERSION"
|
||||||
} else {
|
|
||||||
Write-Host "Failed to extract version from config.py"
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Write-Host "config.py not found"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Set version for next steps
|
|
||||||
echo "VERSION=$VERSION" >> $env:GITHUB_ENV
|
|
||||||
env:
|
env:
|
||||||
DB_HOST: 8.155.9.53
|
DB_HOST: 8.155.9.53
|
||||||
DB_NAME: ai_web
|
DB_NAME: ai_web
|
||||||
@@ -134,7 +126,16 @@ jobs:
|
|||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
run: |
|
||||||
Write-Host "Committing version changes..."
|
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.name "Gitea Actions"
|
||||||
git config user.email "actions@gitea.local"
|
git config user.email "actions@gitea.local"
|
||||||
@@ -144,7 +145,7 @@ jobs:
|
|||||||
|
|
||||||
$hasChanges = git diff --staged --quiet
|
$hasChanges = git diff --staged --quiet
|
||||||
if ($LASTEXITCODE -ne 0) {
|
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
|
git push origin master
|
||||||
Write-Host "Version changes committed and pushed"
|
Write-Host "Version changes committed and pushed"
|
||||||
} else {
|
} else {
|
||||||
@@ -156,12 +157,21 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
shell: powershell
|
shell: powershell
|
||||||
run: |
|
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 "=========================================="
|
||||||
Write-Host "GUI Version Release Summary"
|
Write-Host "GUI Version Release Summary"
|
||||||
Write-Host "=========================================="
|
Write-Host "=========================================="
|
||||||
Write-Host "Author: ${{ github.actor }}"
|
Write-Host "Author: ${{ github.actor }}"
|
||||||
Write-Host "Branch: ${{ github.ref_name }}"
|
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 "Time: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
|
||||||
Write-Host "Commit: ${{ github.sha }}"
|
Write-Host "Commit: ${{ github.sha }}"
|
||||||
Write-Host "=========================================="
|
Write-Host "=========================================="
|
||||||
|
|||||||
Reference in New Issue
Block a user