Skip to content

Commit

Permalink
Fix wrong changelog and missing version display names in MN/CF public…
Browse files Browse the repository at this point in the history
…ations (#17)
  • Loading branch information
eigenraven authored Mar 11, 2024
1 parent 41b77a9 commit 87b6622
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/release-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,8 @@ jobs:
if [[ "$SNAPSHOT" == "true" ]]; then
PRERELEASE="--prerelease"
fi
export "CHANGELOG_FILE=$(mktemp --suffix=.md)"
echo "CHANGELOG_FILE=${CHANGELOG_FILE}" >> $GITHUB_ENV
gh api --method POST -H "Accept: application/vnd.github+json" \
"/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
-f tag_name="${RELEASE_VERSION}" \
--jq ".body" > "${CHANGELOG_FILE}"
cat "${CHANGELOG_FILE}"
gh release create "${RELEASE_VERSION}" -F "${CHANGELOG_FILE}" $PRERELEASE ./build/libs/*.jar
./gradlew --build-cache --stacktrace processDocs
gh release create "${RELEASE_VERSION}" -F "build/doc/changelog.html" $PRERELEASE ./build/libs/*.jar
shell: bash
continue-on-error: true
env:
Expand Down
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,26 @@ publishing.publications.withType<MavenPublication> {

pluginManager.withPlugin("com.modrinth.minotaur") {
val modrinth = project.extensions.getByType<ModrinthExtension>()
modrinth.versionName = "${mod_id}-${minecraft_version}-${project.version}"
modrinth.additionalFiles.add(fairPlayJar)
if (project.file("/build/doc/changelog.html").exists())
modrinth.changelog = project.file("/build/doc/changelog.html").readText(Charsets.UTF_8)
processDocs {
doLast {
// If the task executes, update the changelog in Minotaur as it doesn't support passing in a File
modrinth.changelog = project.file("/build/doc/changelog.html").readText(Charsets.UTF_8)
}
}
tasks.named("modrinth") {
dependsOn(processDocs)
}
}

tasks.publishCurseforge {
dependsOn(processDocs)

val mainArtifact = this.uploadArtifacts[0]
mainArtifact.displayName = "${mod_id}-${minecraft_version}-${project.version}"
mainArtifact.releaseType = curse_release_type
mainArtifact.changelogType = "html"
mainArtifact.changelog = project.file("/build/doc/changelog.html")
Expand Down

0 comments on commit 87b6622

Please sign in to comment.