Skip to content

Commit

Permalink
add automatic publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai authored Sep 16, 2024
1 parent 53a8fc2 commit 00728b6
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 9 deletions.
Empty file added CHANGELOG.md
Empty file.
48 changes: 40 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,14 @@ plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "java-library"
id "maven-publish"
id "me.modmuss50.mod-publish-plugin" version "0.5.2"
}

int javaVersion = Integer.parseInt(project.java_version)

sourceCompatibility = javaVersion
targetCompatibility = javaVersion

loom {
runs {
client {
vmArgs "-Dfabric-tag-conventions-v1.legacyTagWarning=DEV_VERBOSE -Dfabric-tag-conventions-v2.missingTagTranslationWarning=VERBOSE"
}
}
}

repositories {
maven { url = "https://maven.gegy.dev/" }
maven { url = "https://maven.terraformersmc.com/releases/" }
Expand Down Expand Up @@ -52,6 +45,45 @@ dependencies {
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}")
}

publishMods {
displayName = "bodacious berries ${project.version}"
file = remapJar.archiveFile
changelog = rootProject.file("CHANGELOG.md").getText()
type = STABLE

modLoaders.add("quilt")
modLoaders.add("fabric")

dryRun = !providers.environmentVariable("MODRINTH_TOKEN").isPresent()
|| !providers.environmentVariable("CURSEFORGE_TOKEN").isPresent()
|| property("pub.should_publish") == "false"
dryRun = false

var mcVersions = [project.minecraft_version]
mcVersions.addAll(property("pub.additional_versions").toString().split(" ").findAll { !it.empty })

modrinth {
projectId = "KEFyvbuH"
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
mcVersions.forEach(minecraftVersions::add)

requires("fabric-api")
optional("modmenu")
}

curseforge {
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
projectId = "576755"
mcVersions.forEach(minecraftVersions::add)

clientRequired = true
serverRequired = true

requires("fabric-api")
optional("modmenu")
}
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = 'UTF-8'
it.options.deprecation(true)
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ emi_version=1.1.10+1.21
mod_menu_version=11.0.1

# other dependencies
night_config_version=3.8.1
night_config_version=3.8.1

# publishing
pub.should_publish = true
pub.additional_versions = 1.21

0 comments on commit 00728b6

Please sign in to comment.