ci(jreleaser): add release introduction to the release notes

This commit is contained in:
Gauthier Roebroeck 2023-11-06 10:38:30 +08:00
parent d51fdeb025
commit d52ba95a65
3 changed files with 22 additions and 0 deletions

View File

@ -3,6 +3,10 @@ name: Release
on:
workflow_dispatch:
inputs:
release_notes:
description: Release notes (use \n for newlines)
type: string
required: false
bump:
description: 'Bump type'
required: false
@ -126,6 +130,14 @@ jobs:
with:
arguments: :komga:generateOpenApiDocs
- name: Create release notes
run: |
mkdir release_notes
echo -e "${{ inputs.release_notes }}" >> release_notes/release_notes.md
echo "Release notes:"
cat release_notes/release_notes.md
echo ""
- name: JReleaser Changelog append
uses: gradle/gradle-build-action@v2
if: needs.version.outputs.should_release #only redo if the version changed

1
.gitignore vendored
View File

@ -49,6 +49,7 @@ nbdist/
/config-dir/
application-oauth2.yml
/benchmark
/release_notes
### Conveyor
output/

View File

@ -2,6 +2,8 @@ import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.jreleaser.model.Active
import org.jreleaser.model.Distribution.DistributionType.SINGLE_JAR
import org.jreleaser.model.api.common.Apply
import kotlin.io.path.Path
import kotlin.io.path.exists
plugins {
run {
@ -73,6 +75,13 @@ jreleaser {
preset = "conventional-commits"
skipMergeCommits = true
links = true
content = (if (Path("./release_notes/release_notes.md").exists()) "{{#f_file_read}}{{basedir}}/release_notes/release_notes.md{{/f_file_read}}" else "") +
"""
## Changelog
{{changelogChanges}}
{{changelogContributors}}
""".trimIndent()
format = "- {{#commitIsConventional}}{{#conventionalCommitIsBreakingChange}}🚨 {{/conventionalCommitIsBreakingChange}}{{#conventionalCommitScope}}**{{conventionalCommitScope}}**: {{/conventionalCommitScope}}{{conventionalCommitDescription}}{{#conventionalCommitBreakingChangeContent}}: *{{conventionalCommitBreakingChangeContent}}*{{/conventionalCommitBreakingChangeContent}} ({{commitShortHash}}){{/commitIsConventional}}{{^commitIsConventional}}{{commitTitle}} ({{commitShortHash}}){{/commitIsConventional}}{{#commitHasIssues}}, closes{{#commitIssues}} {{issue}}{{/commitIssues}}{{/commitHasIssues}}"
hide {
uncategorized = true