diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a7d52eb..6d75947 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,6 +51,12 @@ jobs: choco install zip -y zip -j -9 ${INSTALLER_NAME_NO_EXE}_exe.zip ${INSTALLER_NAME} + - name: Extract changelog for this release + id: extract_changelog + run: | # 提取最新版本的changelog内容 + CHANGELOG=$(awk 'BEGIN {found=0; count=0} /^# / {if (count == 1) {found=0} if (count == 0) {found=1; count++} next} found {print}' CHANGELOG.md) + echo "CHANGELOG=$CHANGELOG" >> $GITHUB_ENV + - name: Upload Build Artifact uses: actions/upload-artifact@v3 # 安装用于上传最终打包结果到执行完毕界面的脚本 with: @@ -67,6 +73,7 @@ jobs: release_name: Release ${{ github.ref_name }} # 这个是当前release的名称<这个并非像上面一样的完整引用--即不包括`refs/heads/ 或 refs/tags/ 前缀`>。(理论上github.ref_name的值: 如果当前actions是被push/tag触发的, 则会选择tag名; 若仅是push触发, 则会选择分支名) draft: true # 此项为true, 表示发布的是仅自己可见的草稿(我们可以手动编辑检查后在手动发布) prerelease: false # 此项若为true, 则会将release打上预发布标志 + body: ${{env.CHANGELOG}} - name: Upload Build Artifact to Release uses: actions/upload-release-asset@v1 # 安装用于上传最终打包结果到本次release的脚本