From ab0a8ed60875ad72e951dbbcec2deb33c449fd99 Mon Sep 17 00:00:00 2001 From: Xiao YiFang Date: Sun, 12 Jun 2022 10:02:48 +0800 Subject: [PATCH] github: add release changelog --- .github/workflows/macos-6.2.yml | 17 +++++++++++++++-- .github/workflows/macos.yml | 15 +++++++++++++-- .github/workflows/ubuntu-6.2.yml | 20 ++++++++++++++++---- .github/workflows/ubuntu.yml | 20 ++++++++++++++++---- .github/workflows/windows-6.2.yml | 24 +++++++++++++++++++++--- .github/workflows/windows.yml | 22 ++++++++++++++++++---- 6 files changed, 99 insertions(+), 19 deletions(-) diff --git a/.github/workflows/macos-6.2.yml b/.github/workflows/macos-6.2.yml index b0fe6e9a..501ff491 100644 --- a/.github/workflows/macos-6.2.yml +++ b/.github/workflows/macos-6.2.yml @@ -74,6 +74,13 @@ jobs: mv ${targetName}.app ./tmp # --background "installer_background.png" create-dmg --volname "${targetName} Installer" --volicon "icons/macicon.icns" --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "${targetName}.app" 200 190 --hide-extension "${targetName}.app" --app-drop-link 600 185 --skip-jenkins "${targetName}.dmg" tmp/ + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Set outputs id: vars run: | @@ -82,6 +89,11 @@ jobs: echo "::set-output name=release_time::$(date +'%H%M%S')" echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -91,7 +103,7 @@ jobs: CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" CHANGELOG="${CHANGELOG//'\"'/'%22'}" CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" # tag 上传Release - name: uploadRelease uses: svenstaro/upload-release-action@v2 @@ -119,4 +131,5 @@ jobs: auto built by github action. use on your on risk:-) CHANGES: - ${{ steps.vars.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 7624d090..6da78257 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -75,7 +75,12 @@ jobs: mv ${targetName}.app ./tmp # --background "installer_background.png" create-dmg --volname "${targetName} Installer" --volicon "icons/macicon.icns" --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "${targetName}.app" 200 190 --hide-extension "${targetName}.app" --app-drop-link 600 185 --skip-jenkins "${targetName}.dmg" tmp/ - + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} - name: Set outputs id: vars @@ -85,6 +90,11 @@ jobs: echo "::set-output name=release_time::$(date +'%H%M%S')" echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -122,4 +132,5 @@ jobs: auto built by github action. use on your on risk:-) CHANGES: - ${{ steps.vars.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} diff --git a/.github/workflows/ubuntu-6.2.yml b/.github/workflows/ubuntu-6.2.yml index b0d38ee3..812c067b 100644 --- a/.github/workflows/ubuntu-6.2.yml +++ b/.github/workflows/ubuntu-6.2.yml @@ -80,15 +80,26 @@ jobs: # with: # name: AppImage # path: './*.AppImage*' + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Set outputs id: vars run: | echo "::set-output name=sha_short::$(git rev-parse --short=8 HEAD)" echo "::set-output name=release_date::$(date +'%Y%m%d')" echo "::set-output name=release_time::$(date +'%H%M%S')" - echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" - echo "::set-output name=appname::$(ls *.AppImage*)" + echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -98,7 +109,7 @@ jobs: CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" CHANGELOG="${CHANGELOG//'\"'/'%22'}" CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" - name: uploadRelease # if: startsWith(github.event.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 @@ -126,4 +137,5 @@ jobs: auto built by github action. use on your on risk:-) CHANGES: - ${{ steps.vars.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 09022a26..aaf44c8b 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -77,15 +77,26 @@ jobs: chmod a+x linuxdeploy-x86_64.AppImage ./linuxdeploy-x86_64.AppImage --appdir appdir --output appimage --plugin qt -i redist/icons/goldendict.png -d redist/org.goldendict.GoldenDict.desktop + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Set outputs id: vars run: | echo "::set-output name=sha_short::$(git rev-parse --short=8 HEAD)" echo "::set-output name=release_date::$(date +'%Y%m%d')" echo "::set-output name=release_time::$(date +'%H%M%S')" - echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" - echo "::set-output name=appname::$(ls *.AppImage*)" + echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -95,7 +106,7 @@ jobs: CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" CHANGELOG="${CHANGELOG//'\"'/'%22'}" CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" - name: uploadRelease # if: startsWith(github.event.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 @@ -123,4 +134,5 @@ jobs: auto built by github action. use on your on risk:-) CHANGES: - ${{ steps.vars.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} diff --git a/.github/workflows/windows-6.2.yml b/.github/workflows/windows-6.2.yml index 8a227e06..020ba6de 100644 --- a/.github/workflows/windows-6.2.yml +++ b/.github/workflows/windows-6.2.yml @@ -52,15 +52,28 @@ jobs: with: fetch-depth: 0 + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Set outputs id: vars shell: bash run: | echo "::set-output name=sha_short::$(git rev-parse --short=8 HEAD)" echo "::set-output name=release_date::$(date +'%Y%m%d')" - echo "::set-output name=release_time::$(date +'%H%M%S')" - echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" + echo "::set-output name=release_time::$(date +'%H%M%S')" + echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + shell: bash + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -70,7 +83,7 @@ jobs: CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" CHANGELOG="${CHANGELOG//'\"'/'%22'}" CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" # # msvc编译 - uses: ilammy/msvc-dev-cmd@v1 @@ -128,6 +141,11 @@ jobs: Qt6.X(Universal Build) Qt5.15.2(Intel Kind) auto built by github action. use on your on risk:-) + + CHANGES: + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} + - name: upload goldendict.exe only # if: startsWith(github.event.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c57f1628..2e6cfb78 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -54,15 +54,28 @@ jobs: with: fetch-depth: 0 + - name: Generate changelog + if: ${{!env.prerelease}} + id: changelog1 + uses: metcalfc/changelog-generator@v3.0.0 + with: + myToken: ${{ secrets.GITHUB_TOKEN }} + - name: Set outputs id: vars shell: bash run: | echo "::set-output name=sha_short::$(git rev-parse --short=8 HEAD)" echo "::set-output name=release_date::$(date +'%Y%m%d')" - echo "::set-output name=release_time::$(date +'%H%M%S')" - echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" + echo "::set-output name=release_time::$(date +'%H%M%S')" + echo "::set-output name=release_time_clock::$(date +'%H:%M:%S')" echo "::set-output name=release_hm::$(date +'%y%m%d')" + + - name: changelog + if: $${{env.prerelease}} + id: changelog2 + shell: bash + run: | previousTag=$(git tag --sort=-creatordate | sed -n 2p) echo "previousTag : $previousTag" @@ -72,7 +85,7 @@ jobs: CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" CHANGELOG="${CHANGELOG//'\"'/'%22'}" CHANGELOG="${CHANGELOG//"'"/ }" - echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" + echo "::set-output name=COMMIT_SUMMARY::$(echo "$CHANGELOG")" - uses: ilammy/msvc-dev-cmd@v1 # msvc编译 - name: msvc-build goldendict @@ -127,7 +140,8 @@ jobs: auto built by github action. use on your on risk:-) CHANGES: - ${{ steps.vars.outputs.COMMIT_SUMMARY }} + ${{ steps.changelog1.outputs.changelog }} + ${{ steps.changelog2.outputs.COMMIT_SUMMARY }} - name: upload goldendict.exe only # if: startsWith(github.event.ref, 'refs/tags/') uses: svenstaro/upload-release-action@v2