Skip to content

Commit

Permalink
ci(GitHub Actions): Generate compare links in release drafts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ohdj authored May 30, 2024
1 parent 77c467e commit 06ef7f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/build_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 06ef7f4

Please sign in to comment.