From 8f50360ea93637ba99f77f4a0fe951deab66670a Mon Sep 17 00:00:00 2001 From: amass <168062547@qq.com> Date: Wed, 2 Oct 2024 16:48:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4=E6=96=87?= =?UTF-8?q?=E5=AD=97.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/windows.yaml | 2 ++ resources/build.ps1 | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/.gitea/workflows/windows.yaml b/.gitea/workflows/windows.yaml index cb43188..3717a17 100644 --- a/.gitea/workflows/windows.yaml +++ b/.gitea/workflows/windows.yaml @@ -11,8 +11,10 @@ jobs: run: | resources/build.ps1 build resources/build.ps1 deploy + resources/build.ps1 changelog - name: Upload Gitea Release uses: akkuman/gitea-release-action@v1 with: + body_path: build/CHANGELOG.txt files: |- build/SmartLockerTools.zip \ No newline at end of file diff --git a/resources/build.ps1 b/resources/build.ps1 index b324cae..0e7c6cd 100644 --- a/resources/build.ps1 +++ b/resources/build.ps1 @@ -16,6 +16,7 @@ $projectPath = Get-Location $buildPath = Join-Path -Path $projectPath -ChildPath "build" $deployPath = Join-Path -Path $buildPath -ChildPath "SmartLockerTools" $zipFilePath = Join-Path -Path $buildPath -ChildPath "SmartLockerTools.zip" +$changelogPath = Join-Path -Path $buildPath -ChildPath "CHANGELOG.txt" function Build() { if (!(Test-Path $buildPath\CMakeCache.txt)) { @@ -78,6 +79,13 @@ function Clean() { } } +function Changelog() { + $commit_message = git log -1 --pretty=format:"%B" + Write-Output "Latest commit message:" + Write-Output $commit_message + $commit_message | Out-File -FilePath $changelogPath -Encoding utf8 + Write-Output "Commit message has been written to $changelogPath" +} switch ($type) { @@ -93,6 +101,9 @@ switch ($type) { "installer" { Installer } + "changelog" { + Changelog + } "update" { UpdateServer }