From 06ef7f4f89e149c14656497e8bbcac60b1aad5b3 Mon Sep 17 00:00:00 2001 From: ohdj <71207981+ohdj@users.noreply.github.com> Date: Thu, 30 May 2024 19:54:15 +0800 Subject: [PATCH] ci(GitHub Actions): Generate compare links in release drafts Adds the `WyriHaximus/github-action-get-previous-tag@v1` action to retrieve the previous tag. The release draft body now includes a compare link between the previous and current versions. --- .github/workflows/build_release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index a7dff1c..38f0cba 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -25,6 +25,13 @@ jobs: echo "CODE=$(cat .github/release.json | jq -r '.code')" >> $GITHUB_ENV echo "VERSION=$(cat .github/release.json | jq -r '.version')" >> $GITHUB_ENV + # 获取上一个 tag + - name: Get previous tag + id: get_previous_tag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + with: + fallback: "0.0.1" # 设置默认的 fallback tag,如果找不到上一个 tag + - name: Generate signing.properties run: | ${{ secrets.BASH_DOWNLOAD_JKS }} @@ -71,7 +78,7 @@ jobs: | MD5 | ${{ env.MD5 }} | | SHA1 | ${{ env.SHA1 }} | - [View changes on GitHub](https://github.com/ohdj/NfcAimeReader/commits/v${{ env.VERSION }}) + [View changes on GitHub](https://github.com/ohdj/NfcAimeReader/compare/v${{ steps.get_previous_tag.outputs.tag }}...v${{ env.VERSION }}) - name: Upload APK uses: actions/upload-release-asset@v1