[patch] 优化版本管理显示 与 更新提示(修改表名信息)
This commit is contained in:
@@ -167,7 +167,7 @@ class DatabaseVersionManager:
|
||||
try:
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute("""
|
||||
SELECT version FROM web_versionhistory
|
||||
SELECT version FROM web_version_history
|
||||
WHERE type = '水滴智能通讯插件' AND is_delete = FALSE
|
||||
ORDER BY release_time DESC LIMIT 1
|
||||
""")
|
||||
@@ -211,7 +211,7 @@ class DatabaseVersionManager:
|
||||
try:
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute("""
|
||||
SELECT version FROM web_versionhistory
|
||||
SELECT version FROM web_version_history
|
||||
WHERE content LIKE %s AND type = '水滴智能通讯插件'
|
||||
ORDER BY release_time DESC LIMIT 1
|
||||
""", (f'%{commit_id}%',))
|
||||
@@ -241,7 +241,7 @@ class DatabaseVersionManager:
|
||||
|
||||
cursor = self.conn.cursor()
|
||||
cursor.execute("""
|
||||
INSERT INTO web_versionhistory
|
||||
INSERT INTO web_version_history
|
||||
(id, version, type, content, download_url, release_time, is_delete)
|
||||
VALUES (%s, %s, %s, %s, %s, %s, %s)
|
||||
""", (
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user