From a4e49e91525e3dcfb8a4972b4d025cd4cd7dfdab Mon Sep 17 00:00:00 2001 From: shenleban tongying Date: Sat, 19 Oct 2024 16:32:26 -0400 Subject: [PATCH] fix change log generation --- .github/workflows/Release-all.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Release-all.yml b/.github/workflows/Release-all.yml index b7872995..4a4326b6 100644 --- a/.github/workflows/Release-all.yml +++ b/.github/workflows/Release-all.yml @@ -141,35 +141,31 @@ jobs: id: shortSHA run: | echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - - name: Get changelog tags + - name: Get previous tag id: changelogTags run: | if [[ '${{env.prerelease}}' == 'true' ]] then echo "This is a pre-release" - previousTag=$(git tag --sort=-creatordate | grep "^v" | sed -n 2p) - currentTag=$(git tag --sort=-creatordate | grep "^v" | sed -n 1p) + previousTag=$(git tag --sort=-creatordate | grep "^v" | head -n 1) else echo "This is not a pre-release" - previousTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | sed -n 2p) - currentTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | sed -n 1p) + previousTag=$(git tag --sort=-creatordate | grep "^v" | grep -v "alpha" | head -n 1) fi echo "prev_tag=$previousTag" >> $GITHUB_OUTPUT - echo "curr_tag=$currentTag" >> $GITHUB_OUTPUT echo "previousTag : $previousTag" - echo "currentTag : $currentTag" - name: Get new tag id: getNewTag run: | echo "newTag=v${{ env.version }}-${{ env.versionSuffix }}.${{ steps.shortSHA.outputs.sha_short }}" >> $GITHUB_OUTPUT - name: Build Changelog id: build_changelog - uses: mikepenz/release-changelog-builder-action@v3 + uses: mikepenz/release-changelog-builder-action@v5 with: commitMode: false fromTag: ${{ steps.changelogTags.outputs.prev_tag }} - toTag: "${{ steps.changelogTags.outputs.curr_tag }}" + toTag: ${{ github.sha }} configurationJson: | { "template": "#{{CHANGELOG}}\n\n
\n🔴 Uncategorized\n\n#{{UNCATEGORIZED}}\n
", @@ -232,7 +228,7 @@ jobs: if-no-files-found: error retention-days: 7 path: ./changelog.txt - + publish: needs: [build_macOS, build_Windows, generate_other_staffs] runs-on: ubuntu-24.04