Skip to content

Commit

Permalink
Generate changelog (#158)
Browse files Browse the repository at this point in the history
  • Loading branch information
chippmann authored Apr 20, 2021
1 parent 2d41153 commit 4cd4efd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/create-draft-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ jobs:
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Clone Godot JVM module.
uses: actions/checkout@v2
- name: Checkout submodules
uses: snickerbockers/submodules-init@v4
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- name: Generate changelog
uses: eskatos/gradle-command-action@v1
with:
wrapper-directory: kt/
build-root-directory: kt/
arguments: generateChangelog
- name: Create draft release
id: create_release
uses: actions/create-release@v1
Expand All @@ -20,9 +34,7 @@ jobs:
release_name: ${{ github.ref }}
draft: true
prerelease: false
body: |
The pre built engines are the zip files.
The other files are export templates needed for exporting your game. See [exporting](https://godot-kotl.in/en/latest/user-guide/exporting/) documentation on how to use them.
body_path: kt/build/changelog.md

- name: Output release url file
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
Expand Down
26 changes: 26 additions & 0 deletions kt/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ subprojects {
}

tasks {
val generateChangelog by creating {
group = "godot-kotlin-jvm"

doLast {
val tags = grgit.tag.list().reversed()
val fromTag = tags.getOrNull(1)
val toTag = tags.getOrNull(0)
val changeLogPrefix = """
The pre built engines are the zip files.
The other files are export templates needed for exporting your game. See [exporting](https://godot-kotl.in/en/latest/user-guide/exporting/) documentation on how to use them.
**Changelog:**
""".trimIndent()

val changelogString = grgit.log {
range(fromTag?.name, toTag?.name)
}
.joinToString(separator = "\n", prefix = changeLogPrefix) { commit ->
val link = "https://github.com/utopia-rise/godot-kotlin-jvm/commit/${commit.id}"
"- [${commit.abbreviatedId}]($link) ${commit.shortMessage}"
}

project.buildDir.resolve("changelog.md").writeText(changelogString)
}
}
val buildEngineDebug by creating(Exec::class) {
group = "godot-kotlin-jvm"

Expand Down

0 comments on commit 4cd4efd

Please sign in to comment.