Merge remote-tracking branch 'origin/main' into 1.18
This commit is contained in:
commit
e777a4ae6e
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -4,6 +4,9 @@ libs
|
||||||
media
|
media
|
||||||
classes/
|
classes/
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
CHANGELOG.md
|
||||||
|
|
||||||
# Created by https://www.gitignore.io/api/gradle,intellij,eclipse,windows,osx,linux
|
# Created by https://www.gitignore.io/api/gradle,intellij,eclipse,windows,osx,linux
|
||||||
|
|
||||||
### Gradle ###
|
### Gradle ###
|
||||||
|
|
|
||||||
49
build.gradle
49
build.gradle
|
|
@ -3,6 +3,8 @@ plugins {
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
id 'com.matthewprenger.cursegradle' version '1.4.0'
|
||||||
id 'com.palantir.git-version' version '1.0.0'
|
id 'com.palantir.git-version' version '1.0.0'
|
||||||
|
id 'se.bjurr.gitchangelog.git-changelog-gradle-plugin' version '1.79.0'
|
||||||
|
id "com.modrinth.minotaur" version "2.+"
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_17
|
||||||
|
|
@ -114,6 +116,22 @@ tasks.withType(JavaCompile) {
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task generateChangelog(type: se.bjurr.gitchangelog.plugin.gradle.GitChangelogTask) {
|
||||||
|
def details = versionDetails();
|
||||||
|
if(details.commitDistance > 0) {
|
||||||
|
fromRef = details.lastTag;
|
||||||
|
} else {
|
||||||
|
def secondLastTagCmd = "git describe --abbrev=0 " + details.lastTag + "^"
|
||||||
|
def secondLastTag = secondLastTagCmd.execute().text.trim()
|
||||||
|
fromRef = secondLastTag;
|
||||||
|
}
|
||||||
|
|
||||||
|
file = new File("CHANGELOG.md");
|
||||||
|
def otherTemplateContent = new File('gradle/changelog.mustache').getText('UTF-8');
|
||||||
|
templateContent = "## Changes since " + fromRef + "\n" + otherTemplateContent;
|
||||||
|
toCommit = "HEAD";
|
||||||
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
|
||||||
// if it is present.
|
// if it is present.
|
||||||
|
|
@ -159,7 +177,7 @@ curseforge {
|
||||||
apiKey = System.getenv("CURSEFORGE_TOKEN")
|
apiKey = System.getenv("CURSEFORGE_TOKEN")
|
||||||
project {
|
project {
|
||||||
id = "790626"
|
id = "790626"
|
||||||
changelog = '[Changelog is not currently available]'
|
changelog = file('./CHANGELOG.md')
|
||||||
changelogType = "markdown"
|
changelogType = "markdown"
|
||||||
releaseType = "release"
|
releaseType = "release"
|
||||||
addGameVersion "Forge"
|
addGameVersion "Forge"
|
||||||
|
|
@ -168,3 +186,32 @@ curseforge {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
modrinth {
|
||||||
|
token = System.getenv("MODRINTH_TOKEN")
|
||||||
|
projectId = "modernfix" // This can be the project ID or the slug. Either will work!
|
||||||
|
versionType = "release" // This is the default -- can also be `beta` or `alpha`
|
||||||
|
uploadFile = remapJar
|
||||||
|
gameVersions = [minecraft_version]
|
||||||
|
loaders = ["forge"]
|
||||||
|
changelog.set(provider { file("./CHANGELOG.md").getText('UTF-8') })
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register('checkCleanTag') {
|
||||||
|
doLast {
|
||||||
|
def details = versionDetails()
|
||||||
|
if (!details.isCleanTag || versionDetails().commitDistance != 0) {
|
||||||
|
throw new GradleException('Not a clean tree.')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.curseforge.dependsOn(":checkCleanTag")
|
||||||
|
tasks.curseforge.dependsOn(":generateChangelog")
|
||||||
|
tasks.modrinth.dependsOn(":checkCleanTag")
|
||||||
|
tasks.modrinth.dependsOn(":generateChangelog")
|
||||||
|
|
||||||
|
tasks.register('publishToModSites') {
|
||||||
|
publishToModSites.dependsOn(tasks.modrinth)
|
||||||
|
publishToModSites.dependsOn(tasks.curseforge)
|
||||||
|
}
|
||||||
3
gradle/changelog.mustache
Normal file
3
gradle/changelog.mustache
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
{{#commits}}
|
||||||
|
* [{{{messageTitle}}}](https://github.com/embeddedt/ModernFix/commit/{{hashFull}}) - {{{authorName}}}
|
||||||
|
{{/commits}}
|
||||||
Loading…
Reference in New Issue
Block a user