11plugins {
2- id ' dev.architectury.loom' version ' 1.6 -SNAPSHOT' apply false
2+ id ' dev.architectury.loom' version ' 1.7 -SNAPSHOT' apply false
33 id ' architectury-plugin' version ' 3.4-SNAPSHOT'
44 id ' com.github.johnrengelman.shadow' version ' 8.1.1' apply false
55 id ' maven-publish'
66 id ' pro.mikey.plugins.insaniam' version " 0.1-SNAPSHOT"
7- id " me.modmuss50.mod-publish-plugin" version " 0.5.1 "
7+ id " me.modmuss50.mod-publish-plugin" version " 0.7.4 "
88}
99
1010architectury {
@@ -17,7 +17,6 @@ allprojects {
1717}
1818
1919subprojects {
20- def ENV = System . getenv()
2120 version = project. mod_version
2221 group = project. maven_group
2322
@@ -44,9 +43,6 @@ subprojects {
4443 }
4544
4645 java {
47- // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
48- // if it is present.
49- // If you remove this line, sources will not be generated.
5046 withSourcesJar()
5147
5248 sourceCompatibility = JavaVersion . VERSION_21
@@ -74,62 +70,87 @@ subprojects {
7470 from components. java
7571 }
7672 }
73+
7774 repositories {
78- if (ENV . SAPS_TOKEN ) {
75+ def token = providers. environmentVariable(" SAPS_TOKEN" )
76+ if (token. isPresent()) {
7977 maven {
8078 url " https://maven.saps.dev/releases"
8179 credentials {
8280 username = " mikeymods"
83- password = " ${ ENV.SAPS_TOKEN } "
81+ password = token . get()
8482 }
8583 }
8684 }
8785 }
8886 }
89- def changelogData = insaniamUtils. createChangelog {
90- file = file(' CHANGELOG.md' )
91- versionPattern = ~/ ## \[ [^]]+]/
92- fallbackValue = " No changelog provided"
93- version = project. mod_version
94- }
87+ }
9588
96- publishMods {
97- def curseToken = providers. environmentVariable(" CURSE_DEPLOY_TOKEN" )
98-
99- dryRun = ! curseToken. isPresent()
100- changelog = changelogData
101- version = project. mod_version
102- type = STABLE
103- file = remapJar. archiveFile
104-
105- curseforge {
106- displayName = " Auto Clicker Fabric ${ mod_version} "
107- modLoaders. add(" fabric" )
108- accessToken = curseToken
109- projectId = project. curseforge_id
110- minecraftVersions. add(" ${ minecraft_version} " )
111- javaVersions. add(JavaVersion . VERSION_21 )
112- requires {
113- slug = " fabric-api"
114- }
115- }
89+ def changelogData = insaniamUtils. createChangelog {
90+ file = file(' CHANGELOG.md' )
91+ versionPattern = ~/ ## \[ [^]]+]/
92+ fallbackValue = " No changelog provided"
93+ version = project. mod_version
94+ }
11695
117- modrinth {
118- displayName = " Auto Clicker Fabric ${ mod_version} "
119- modLoaders. add(" fabric" )
120- accessToken = providers. environmentVariable(" MODRINTH_TOKEN" )
121- projectId = project. modrinth_id
122- minecraftVersions. add(" ${ minecraft_version} " )
123- requires {
124- slug = " fabric-api"
125- }
126- }
96+ publishMods {
97+ def curseToken = providers. environmentVariable(" CURSE_DEPLOY_TOKEN" )
98+
99+ dryRun = ! curseToken. isPresent()
100+ changelog = changelogData
101+ version = project. mod_version
102+ type = STABLE
127103
128- github {
129- repository = " AdvancedXRay/Auto-Clicker-Fabric "
130- accessToken = providers . environmentVariable( " GITHUB_TOKEN " )
131- commitish = providers . environmentVariable( " GITHUB_SHA " ) . orElse( " main " )
132- tagName = providers . environmentVariable( " GITHUB_REF_NAME " ) . orElse( " v ${ mod_version } " )
104+ def createOptions = ( String name) -> {
105+ publishOptions {
106+ file = project . provider { project( " : $n ame " ) . tasks . remapJar } . flatMap { it . archiveFile }
107+ displayName = " [ ${ name.toUpperCase() } ][ ${ minecraft_version } ] Auto Clicker ${ mod_version } "
108+ modLoaders . add(name . toLowerCase() )
133109 }
134110 }
111+
112+ def curseForgeOptions = curseforgeOptions {
113+ projectId = project. curseforge_id
114+ accessToken = providers. environmentVariable(" CURSE_DEPLOY_TOKEN" )
115+ minecraftVersions. add(" ${ minecraft_version} " )
116+ javaVersions. add(JavaVersion . VERSION_21 )
117+ }
118+
119+ def modrinthOptions = modrinthOptions {
120+ accessToken = providers. environmentVariable(" MODRINTH_TOKEN" )
121+ projectId = project. modrinth_id
122+ minecraftVersions. add(" ${ minecraft_version} " )
123+ }
124+
125+ def fabricOptions = createOptions(" fabric" )
126+ def neoforgeOptions = createOptions(" neoforge" )
127+
128+ curseforge(" curseforgeFabric" ) {
129+ from(curseForgeOptions, fabricOptions)
130+ requires(" fabric-api" )
131+ }
132+
133+ curseforge(" curseforgeNeoforge" ) {
134+ from(curseForgeOptions, neoforgeOptions)
135+ }
136+
137+ modrinth(" modrinthFabric" ) {
138+ from(modrinthOptions, fabricOptions)
139+ requires(" fabric-api" )
140+ }
141+
142+ modrinth(" modrinthNeoforge" ) {
143+ from(modrinthOptions, neoforgeOptions)
144+ }
145+
146+ github {
147+ file = project. provider { project(" :neoforge" ). tasks. remapJar }. flatMap { it. archiveFile }
148+ additionalFiles. from project. provider { project(" :fabric" ). tasks. remapJar }. flatMap { it. archiveFile }
149+ additionalFiles. from project. provider { project(" :common" ). tasks. remapJar }. flatMap { it. archiveFile }
150+
151+ repository = " AdvancedXRay/Auto-Clicker"
152+ accessToken = providers. environmentVariable(" GITHUB_TOKEN" )
153+ commitish = providers. environmentVariable(" GITHUB_SHA" ). orElse(" main" )
154+ tagName = providers. environmentVariable(" GITHUB_REF_NAME" ). orElse(" v${ mod_version} " )
155+ }
135156}
0 commit comments