Skip to content

Commit

Permalink
Add unifiedPublishing
Browse files Browse the repository at this point in the history
  • Loading branch information
tyra314 committed Sep 13, 2022
1 parent c728fce commit 1a9765c
Show file tree
Hide file tree
Showing 3 changed files with 85 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.+"
}

architectury {
Expand Down
44 changes: 44 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 @@ -83,3 +84,46 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
gameVersions = ["1.16.2", "1.16.3", "1.16.4", "1.16.5"]
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"
gameVersions.addAll "Java 8"
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = rootProject.modrinth_id
}
}
}
}
40 changes: 40 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 @@ -88,3 +89,42 @@ publishing {
// Add repositories to publish to here.
}
}

unifiedPublishing {
project {
gameVersions = ["1.16.2", "1.16.3", "1.16.4", "1.16.5"]
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"
gameVersions.addAll "Java 8"
}
}

var mrToken = System.getenv("MODRINTH_TOKEN")
if (mrToken != null) {
modrinth {
token = mrToken
id = rootProject.modrinth_id
}
}
}
}

0 comments on commit 1a9765c

Please sign in to comment.