Support GH download badge in releases note

This commit is contained in:
Cuong-Tran 2025-03-25 03:17:42 +07:00
parent e73622c033
commit 0828057650
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
3 changed files with 6 additions and 0 deletions

View file

@ -212,6 +212,7 @@ jobs:
tag_name: ${{ needs.prepare-build.outputs.TAG_NAME }}
name: Komikku Preview ${{ needs.prepare-build.outputs.TAG_NAME }} (${{ needs.prepare-build.outputs.VERSION_TAG }})
body: |
[![GitHub downloads](https://img.shields.io/github/downloads/komikku-app/komikku/${{ needs.prepare-build.outputs.TAG_NAME }}/total?label=Downloaded&labelColor=27303D&color=0D1117&logo=github&logoColor=FFFFFF&style=flat)](https://github.com/komikku-app/komikku/releases/${{ needs.prepare-build.outputs.TAG_NAME }})
#### What's Changed
##### New

View file

@ -191,6 +191,7 @@ jobs:
tag_name: ${{ needs.prepare-build.outputs.VERSION_TAG }}
name: Komikku ${{ needs.prepare-build.outputs.VERSION_TAG }}
body: |
[![GitHub downloads](https://img.shields.io/github/downloads/komikku-app/komikku/${{ needs.prepare-build.outputs.VERSION_TAG }}/total?label=Downloaded&labelColor=27303D&color=0D1117&logo=github&logoColor=FFFFFF&style=flat)](https://github.com/komikku-app/komikku/releases/${{ needs.prepare-build.outputs.VERSION_TAG }})
#### What's Changed
##### New

View file

@ -51,6 +51,7 @@ class ReleaseServiceImpl(
"[${mention.value}](https://github.com/${mention.value.substring(1)})"
}
// KMK -->
.replace(getHubDownloadBadgeRegex, "")
.replace(gitHubCommitsCompareRegex) { matchResult ->
val owner = matchResult.groups["owner"]!!.value
val repo = matchResult.groups["repo"]!!.value
@ -104,6 +105,9 @@ class ReleaseServiceImpl(
.toRegex(RegexOption.IGNORE_CASE)
// KMK -->
private val getHubDownloadBadgeRegex = """\[!\[GitHub downloads]\(.*\)]\(.*\)"""
.toRegex(RegexOption.IGNORE_CASE)
/**
* Convert from: https://github.com/komikku-app/komikku/compare/23d862d17...48fb4a2e6
* to: [komikku-app/komikku@23d862d17...48fb4a2e6](https://github.com/komikku-app/komikku/compare/23d862d17...48fb4a2e6)