From d52ba95a658a7a64a5fc633b8138660dba41a02c Mon Sep 17 00:00:00 2001 From: Gauthier Roebroeck Date: Mon, 6 Nov 2023 10:38:30 +0800 Subject: [PATCH] ci(jreleaser): add release introduction to the release notes --- .github/workflows/release.yml | 12 ++++++++++++ .gitignore | 1 + build.gradle.kts | 9 +++++++++ 3 files changed, 22 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3bd41503..8985c2d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.gitignore b/.gitignore index 43a0a4c3..518ea0cd 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,7 @@ nbdist/ /config-dir/ application-oauth2.yml /benchmark +/release_notes ### Conveyor output/ diff --git a/build.gradle.kts b/build.gradle.kts index 1d6364ab..a88b4272 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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