Skip to content

Commit

Permalink
Merge branch '1.16' into 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Siphalor committed Mar 18, 2022
2 parents 24250f4 + ddbf95a commit d6c1a18
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 51 deletions.
82 changes: 33 additions & 49 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.11-SNAPSHOT'
id 'maven-publish'
id 'com.matthewprenger.cursegradle' version '1.4.0'
id 'com.modrinth.minotaur' version '1.2.1'
id 'com.modrinth.minotaur' version '2.1.1'
id 'org.cadixdev.licenser' version '0.6.1'
id 'com.github.breadmoirai.github-release' version '2.2.12'
}
Expand Down Expand Up @@ -51,12 +51,12 @@ dependencies {

modImplementation("com.terraformersmc:modmenu:2.0.14")

include(modApi("de.siphalor.tweed4:tweed4-base-$minecraft_major_version:1.3.1+"))
include(modApi("de.siphalor.tweed4:tweed4-annotated-$minecraft_major_version:1.2.0+"))
include(modApi("de.siphalor.tweed4:tweed4-data-$minecraft_major_version:1.2.0+"))
include(modApi("de.siphalor.tweed4:tweed4-base-$minecraft_major_version:1.4.2+"))
include(modApi("de.siphalor.tweed4:tweed4-annotated-$minecraft_major_version:1.3.0+"))
include(modApi("de.siphalor.tweed4:tweed4-data-$minecraft_major_version:1.2.1+"))
include(modApi("de.siphalor.tweed4:tweed4-data-hjson-$minecraft_major_version:1.1.0+"))
include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$minecraft_major_version:1.0.1+"))
include(modApi("de.siphalor.tweed4:tweed4-tailor-coat-$minecraft_major_version:1.0.1+"))
include(modApi("de.siphalor.tweed4:tweed4-tailor-screen-$minecraft_major_version:1.1.0+"))
include(modApi("de.siphalor.tweed4:tweed4-tailor-coat-$minecraft_major_version:1.1.1+"))
include(modApi("de.siphalor:coat-$minecraft_major_version:$coat_version"))

modImplementation(include("de.siphalor:amecsapi-$minecraft_major_version:${project.amecs_version}")) {
Expand Down Expand Up @@ -113,6 +113,7 @@ publishing {
artifactId = "${project.archives_base_name}-${project.minecraft_major_version}"

from components.java
java.withSourcesJar()
}
}

Expand All @@ -133,36 +134,24 @@ publishing {

// Mod sites

String getProjectChangelog() {
def commits = 'git log -20 --format=oneline'.execute().text.readLines()
def versionCommit = null
for (commit in commits) {
if (commit.contains('Version')) {
versionCommit = commit.split(' ')[0]
break
}
}
if (versionCommit == null) {
return """## Version ${project.mod_version}

No changelog found!"""
}
return "git log -1 --format=format:##%x20%s%n%n%b%nRelease%x20by%x20%an $versionCommit".execute().text.trim()
static def getChangelog() {
return 'git log -1 --format=format:##%x20%s%n%n%b%nRelease%x20by%x20%an --grep Version'.execute().text.trim()
}

task uploadToModSites {
dependsOn build
group = "upload"
}

if (project.hasProperty("siphalorCurseForgeApi")) {
if (project.hasProperty("curseforgeToken")) {
curseforge {
apiKey project.siphalorCurseForgeApi
apiKey project.curseforgeToken
project {
id = "317514"
releaseType = project.mod_release
changelogType = "markdown"
changelog = getProjectChangelog()
changelog = project.getChangelog()
addGameVersion("Fabric")
for (version in ((String) project.mod_mc_versions).split(";")) {
addGameVersion(version)
Expand All @@ -181,36 +170,31 @@ if (project.hasProperty("siphalorCurseForgeApi")) {
uploadToModSites.finalizedBy(tasks.curseforge)
}

import com.modrinth.minotaur.TaskModrinthUpload
if (project.hasProperty("siphalorModrinthApi")) {
task modrinth (type: TaskModrinthUpload) {
group = "upload"
dependsOn(build)

token = project.siphalorModrinthApi
projectId = "u5Ic2U1u"
versionNumber = version
versionName = "[${project.mod_mc_version_specifier}] ${project.mod_version}"
changelog = getProjectChangelog()
uploadFile = remapJar
versionType = project.mod_release
for (version in ((String) project.mod_mc_versions).split(";")) {
addGameVersion(version)
}
addLoader("fabric")
modrinth {
if (project.hasProperty("modrinthToken")) {
token = project.modrinthToken
uploadToModSites.finalizedBy(tasks.modrinth)
}
uploadToModSites.finalizedBy(tasks.modrinth)

projectId = "u5Ic2U1u"
versionName = "[$project.mod_mc_version_specifier] $project.mod_version"
versionType = project.mod_release
changelog = project.getChangelog()
uploadFile = remapJar
gameVersions = project.mod_mc_versions.split(";") as List<String>
loaders = ["fabric"]
}
tasks.modrinth.group = "upload"

if (project.hasProperty("siphalorGitHubToken")) {
if (project.hasProperty("githubToken")) {
githubRelease {
token siphalorGitHubToken
targetCommitish.set(minecraft_major_version)
releaseName.set("Version $mod_version for $mod_mc_version_specifier")
body.set(getProjectChangelog())
token project.githubToken
targetCommitish = project.minecraft_major_version
releaseName = "Version $project.mod_version for $project.mod_mc_version_specifier"
body = project.getChangelog()
releaseAssets remapJar.getArchiveFile()
prerelease.set(mod_release != "release")
overwrite.set(true)
prerelease = mod_release != "release"
overwrite = true
}
uploadToModSites.finalizedBy(tasks.githubRelease)
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ yarn_build=64:v2
loader_version=0.11.6
# Mod Properties
mod_id=mousewheelie
mod_version=1.8.3
mod_version=1.8.4
mod_release=release
mod_mc_version_specifier=1.17.1
mod_mc_versions=1.17.1
maven_group=de.siphalor
archives_base_name=mousewheelie
# Dependencies
amecs_version=1.3.5+
coat_version=1.0.0-beta.14
coat_version=1.0.0-beta.17+
fabric_api_version=0.46.1+1.17

0 comments on commit d6c1a18

Please sign in to comment.