Skip to content

Commit

Permalink
ci(feat): 尝试对自动创建的release, 自动生成最新对应的changelog内容
Browse files Browse the repository at this point in the history
  • Loading branch information
LuSrackhall committed Aug 22, 2024
1 parent fd0d504 commit 4576b92
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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的脚本
Expand Down

0 comments on commit 4576b92

Please sign in to comment.