Skip to content

Commit

Permalink
Adds unifiedPublishing
Browse files Browse the repository at this point in the history
  • Loading branch information
tyra314 committed Sep 13, 2022
1 parent 3817cab commit b8f21ef
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
id "me.shedaniel.unified-publishing" version "0.1.+"
id "maven-publish"
}

Expand Down
43 changes: 43 additions & 0 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "me.shedaniel.unified-publishing"
}

architectury {
Expand Down Expand Up @@ -85,3 +86,45 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
gameVersions = ["1.18.2"]
gameLoaders = ["fabric"]
releaseType = "release"

mainPublication tasks.remapJar

relations {
depends {
curseforge = "cloth-config"
modrinth = "cloth-config"
}
depends {
curseforge = "fabric-api"
modrinth = "fabric-api"
}
depends {
curseforge = "architectury-api"
modrinth = "architectury-api"
}
}

var cfToken = System.getenv("CF_TOKEN")
if (cfToken != null) {
curseforge {
token = cfToken
id = rootProject.curseforge_id
gameVersions.addAll "Java 17"
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = rootProject.modrinth_id
}
}
}
}
39 changes: 39 additions & 0 deletions forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.1.2"
id "me.shedaniel.unified-publishing"
}

architectury {
Expand Down Expand Up @@ -89,3 +90,41 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
gameVersions = ["1.18.2"]
gameLoaders = ["forge"]
releaseType = "release"

mainPublication tasks.remapJar

relations {
depends {
curseforge = "cloth-config"
modrinth = "cloth-config"
}
depends {
curseforge = "architectury-api"
modrinth = "architectury-api"
}
}

var cfToken = System.getenv("CF_TOKEN")
if (cfToken != null) {
curseforge {
token = cfToken
id = rootProject.curseforge_id
gameVersions.addAll "Java 17"
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = rootProject.modrinth_id
}
}
}
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ architectury_version = 4.9.83
cloth_config_version = 6.4.90
fabric_api_version = 0.58.0+1.18.2
mod_menu_version = 3.2.3

# Publishing
curseforge_id = 227795
modrinth_id = wHODup9j

0 comments on commit b8f21ef

Please sign in to comment.