Skip to content

Commit fc0bde8

Browse files
committed
ci: 修复构建版本号
1 parent 55755c3 commit fc0bde8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/build-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ jobs:
3838
$tag = $version
3939
} elseif ($env:CREATE_RELEASE -eq 'false') {
4040
# 非 release 构建,使用日期作为版本号
41-
$date = Get-Date -Format "MMdd"
42-
$time = Get-Date -Format "HHmm"
43-
$version = "v$date.$time"
41+
$version = (Get-Date).ToUniversalTime().AddHours(8).ToString('vyyyy.MMdd.HHmm')
4442
$tag = $version
4543
} else {
4644
# 手动 workflow_dispatch 触发:使用 git 的语义化版本排序,选出最新 tag,然后生成 / 递增 beta 版本
@@ -138,8 +136,10 @@ jobs:
138136
139137
- name: Build executables
140138
shell: pwsh
139+
env:
140+
RELEASE_VERSION: ${{ needs.version.outputs.version }}
141141
run: |
142-
echo "__version__ = '$version'" | Out-File -FilePath src/one_dragon/version.py -Encoding utf8
142+
echo "__version__ = '$env:RELEASE_VERSION'" | Out-File -FilePath src/one_dragon/version.py -Encoding utf8
143143
.\.venv\Scripts\Activate.ps1
144144
cd deploy
145145
pyinstaller "OneDragon-Installer.spec"

0 commit comments

Comments
 (0)