Skip to content

Commit

Permalink
Further changelog generation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Adubbz committed Nov 19, 2023
1 parent 4c2f505 commit b1c1dea
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 16 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Generate Changelog
run: ./gradlew createChangelog
- name: Publish
run: ./gradlew publish
env:
Expand Down
5 changes: 1 addition & 4 deletions Fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ jar {
}
}

def changelog_file = rootProject.file("build/TerraBlender-${version}-changelog.txt")

curseforge {
if (project.hasProperty('curseApiKey')) {
apiKey = project.getProperty('curseApiKey')
Expand Down Expand Up @@ -104,8 +102,7 @@ modrinth {
loaders = ['fabric']

if (changelog_file.exists()) {
def changelog_text = changelog_file.text
changelog = "```\n" + changelog_text.substring(0, changelog_text.indexOf("=========")).replace("\t", " ") + "```"
changelog = changelog_file.text
}

dependencies {
Expand Down
5 changes: 1 addition & 4 deletions Forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ processResources {

jar.finalizedBy('reobfJar')

def changelog_file = rootProject.file("build/TerraBlender-${version}-changelog.txt")

curseforge {
if (project.hasProperty('curseApiKey')) {
apiKey = project.getProperty('curseApiKey')
Expand Down Expand Up @@ -125,8 +123,7 @@ modrinth {
loaders = ['forge']

if (changelog_file.exists()) {
def changelog_text = changelog_file.text
changelog = "```\n" + changelog_text.substring(0, changelog_text.indexOf("=========")).replace("\t", " ") + "```"
changelog = changelog_file.text
}
// debugMode = true
}
Expand Down
8 changes: 8 additions & 0 deletions NeoForge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ curseforge {
project {
id = '940057'

if (changelog_file.exists()) {
changelog = changelog_file
}

releaseType = release_channel
addGameVersion minecraft_version

Expand All @@ -94,6 +98,10 @@ modrinth {
uploadFile = jar
gameVersions = [minecraft_version]
loaders = ['neoforge']

if (changelog_file.exists()) {
changelog = changelog_file.text
}
}

publishing {
Expand Down
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ plugins {
id 'net.minecraftforge.gradleutils' version '[2.1.3,)'
}

version = "${minecraft_version}-${mod_version}.${System.getenv().BUILD_NUMBER}"
changelog {
fromMergeBase()
}

ext {
mod_version = gradleutils.getFilteredTagOffsetVersion(true, '[0-9]', MC_VERSION)
mod_version = gradleutils.getTagOffsetVersion()
changelog_file = rootProject.file("build/changelog.txt")
}

changelog {
fromMergeBase()
}
version = "${minecraft_version}-${mod_version}"

subprojects {
apply plugin: 'java'
Expand All @@ -25,16 +26,15 @@ subprojects {
java.withJavadocJar()

version = rootProject.version
def mod_build_version = "${mod_version}.${System.getenv().BUILD_NUMBER}"

jar {
manifest {
attributes([
'Specification-Title' : mod_name,
'Specification-Vendor' : mod_author,
'Specification-Version' : mod_build_version,
'Specification-Version' : mod_version,
'Implementation-Title' : project.name,
'Implementation-Version' : mod_build_version,
'Implementation-Version' : mod_version,
'Implementation-Vendor' : mod_author,
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'Timestamp' : System.currentTimeMillis(),
Expand Down

0 comments on commit b1c1dea

Please sign in to comment.