mirror of
https://github.com/denglihong2007/CRSim
synced 2026-08-11 20:29:45 +08:00
ci: TMD这玩意儿能好吗
This commit is contained in:
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@@ -92,32 +92,20 @@ jobs:
|
||||
shell: pwsh
|
||||
run: |
|
||||
|
||||
# 获取最新 Release 版本号
|
||||
$latestTag = gh release list --limit 1 --json tagName --jq ".[0].tagName" 2>$null
|
||||
$releaseInfo = gh release view --json tagName | ConvertFrom-Json
|
||||
$latestTag = $releaseInfo.tagName
|
||||
echo "Latest release tag: $latestTag"
|
||||
if (-not $latestTag) {
|
||||
$latestTag = ""
|
||||
}
|
||||
$originalOutputEncoding = [Console]::OutputEncoding
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
$releaseNotesPath = "release_notes.md"
|
||||
|
||||
try {
|
||||
# 初始化日志文件(UTF-8 编码)
|
||||
$releaseNotesPath = "release_notes.md"
|
||||
echo "Release notes path: $releaseNotesPath"
|
||||
|
||||
# 获取 Commit 日志
|
||||
if (-not $latestTag) {
|
||||
Set-Content -Path $releaseNotesPath -Value "## 初始版本" -Encoding UTF8
|
||||
$commitLogs = git log --pretty=format:"%s"
|
||||
} else {
|
||||
$latestTag += "..HEAD"
|
||||
Set-Content -Path $releaseNotesPath -Value "## 更新日志" -Encoding UTF8
|
||||
$commitLogs = git log $latestTag --pretty=format:"%s"
|
||||
}
|
||||
$latestTag += "..HEAD"
|
||||
Set-Content -Path $releaseNotesPath -Value "## 更新日志" -Encoding UTF8
|
||||
$commitLogs = git log $latestTag --pretty=format:"%s"
|
||||
echo "Commit logs: $commitLogs"
|
||||
} finally {
|
||||
# 恢复原始编码设置
|
||||
[Console]::OutputEncoding = $originalOutputEncoding
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user