ci: 修改自动生成changelog与上个tag对比,而非与上个公版

This commit is contained in:
status102
2024-03-15 16:46:49 +08:00
parent 2343bcf626
commit 726fef72b0

View File

@@ -93,7 +93,10 @@ jobs:
- name: Generate Changelog
id: generate_changelog
run: |
$content=$(git log --pretty=format:"%s @%an" ${{ steps.set_tag.outputs.pre_version }}..alpha/${{ steps.set_tag.outputs.tag }})
# pre_version是上一个公版这里需要拉上一个tag避免堆积过多commit
latest_tag=$(git describe --tags --abbrev=0)
content=$(git log --pretty=format:"%s    @%an" $latest_tag..alpha/${{ steps.set_tag.outputs.tag }})
content=%content:\n=\n\n%
echo "changelog=$content" >> $env:GITHUB_OUTPUT
echo $content
@@ -241,7 +244,7 @@ jobs:
run: |
pre_version=${{ needs.build-win-nightly.outputs.pre_version }}
cur_version=${{ needs.build-win-nightly.outputs.main_tag_name }}
echo -e "${{ inputs.release_body || '' }}\n\n${{ needs.build-win-nightly.outputs.changelog }}\n\n**Full Changelog**: [$pre_version -> $cur_version](https://github.com/$GITHUB_REPOSITORY/compare/$pre_version...$cur_version)" > alpha_changelog.md
echo -e "${{ inputs.release_body || '' }}\n\n\n\n${{ needs.build-win-nightly.outputs.changelog }}\n\n**Full Changelog**: [$pre_version -> $cur_version](https://github.com/$GITHUB_REPOSITORY/compare/$pre_version...$cur_version)" > alpha_changelog.md
export r=$(cat alpha_changelog.md)
# https://github.com/svenstaro/upload-release-action