[patch] 优化版本管理显示 与 更新提示(修改表名信息)

This commit is contained in:
2025-10-10 11:53:56 +08:00
parent bb5ef9ccbf
commit c819bdaa1c
5 changed files with 289 additions and 27 deletions

View File

@@ -8,29 +8,29 @@ jobs:
gui-version-release:
runs-on: windows
defaults:
run:
working-directory: E:\shuidrop_gui
steps:
# Step 1: Clone repository manually
- name: Clone repository
# Step 1: Checkout repository (使用 Gitea 自动检出,适配所有路径)
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }} # 动态分支master 或 develop
fetch-depth: 0 # 获取完整历史(用于版本号计算)
# Step 1.5: Verify checkout
- name: Verify checkout
shell: powershell
run: |
Write-Host "Cloning repository..."
# Change to workspace directory
cd E:\shuidrop_gui
Write-Host "=========================================="
Write-Host "Repository Information"
Write-Host "=========================================="
Write-Host "Current directory: $(Get-Location)"
Write-Host "Branch: ${{ github.ref_name }}"
Write-Host "Commit: ${{ github.sha }}"
Write-Host "Author: ${{ github.actor }}"
Write-Host ""
Write-Host "Git status:"
git status
Write-Host "Fetching latest changes..."
git fetch origin
git reset --hard origin/master
Write-Host "Repository ready"
Write-Host "=========================================="
# Step 2: Check Python environment
- name: Check Python environment
@@ -137,21 +137,27 @@ jobs:
}
}
git config user.name "Gitea Actions"
git config user.email "actions@gitea.local"
# 配置 Git 用户(自动化提交)
git config user.name "Gitea Actions Bot"
git config user.email "bot@gitea.local"
# 添加修改的文件
git add config.py
git add version_history.json
# 检查是否有变更
$hasChanges = git diff --staged --quiet
if ($LASTEXITCODE -ne 0) {
# 动态获取当前分支名 (用于测试使用)
$BRANCH = git rev-parse --abbrev-ref HEAD
git commit -m "[skip ci] Update version to $VERSION"
# 动态获取当前分支名(兼容 master 和 develop
$BRANCH = "${{ github.ref_name }}"
Write-Host "Committing to branch: $BRANCH"
git commit -m "[skip ci] 🤖 自动更新版本到 v$VERSION"
git push origin $BRANCH
Write-Host "Version changes committed and pushed to $BRANCH"
Write-Host "✅ Version changes committed and pushed to $BRANCH"
} else {
Write-Host "No changes to commit"
Write-Host " No changes to commit"
}
# Step 6: Display summary