Skip to content

Commit

Permalink
chore: add CF id, uncomment mod publish code
Browse files Browse the repository at this point in the history
  • Loading branch information
desht committed Nov 28, 2023
1 parent 5b8c97f commit e3cfae2
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 60 deletions.
120 changes: 60 additions & 60 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,63 +88,63 @@ subprojects {
}


//// TODO: Move this to a common location?
//Closure<ReleaseType> releaseTypeToPublishType = { type ->
// switch(type) {
// case "release": return ReleaseType.STABLE
// case "beta": return ReleaseType.BETA
// case "alpha": return ReleaseType.ALPHA
// default: return ReleaseType.STABLE
// }
//}

//publishMods {
// dryRun = providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null
// changelog = providers.environmentVariable("CHANGELOG").orElse("")
// version = mod_version
// type = releaseTypeToPublishType(ftbPublishing.relType)
//
// def curseOptions = curseforgeOptions {
// accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
// projectId = project.curseforge_id
// minecraftVersions.add(rootProject.minecraft_version)
//
// requires {
// slug = 'architectury-api'
// }
// }
//
// curseforge("forge") {
// from curseOptions
// modLoaders.add("neoforge")
// modLoaders.add("forge")
// file = project(":forge").tasks.remapJar.archiveFile
//
// requires {
// slug = 'ftb-library-forge'
// slug = 'architectury-api'
// }
// }
//
// curseforge("fabric") {
// from curseOptions
//
// file = project(":fabric").tasks.remapJar.archiveFile
// modLoaders.add("fabric")
//
// requires {
// slug = "fabric-api"
// slug = 'ftb-library-fabric'
// }
// }
//
// github {
// repository = "ftbteam/ftb-economy"
// accessToken = providers.environmentVariable("GITHUB_TOKEN")
// commitish = providers.environmentVariable("GITHUB_SHA").orElse("dryRun")
// tagName = providers.environmentVariable("GITHUB_REF_NAME").orElse("dryRun")
//
// // Gradle doesn't like accessing the buildApi task directly so we need to use the provider
// file = project.provider { project(":common").tasks.buildApi }.flatMap { it.archiveFile }
// }
//}
// TODO: Move this to a common location?
Closure<ReleaseType> releaseTypeToPublishType = { type ->
switch(type) {
case "release": return ReleaseType.STABLE
case "beta": return ReleaseType.BETA
case "alpha": return ReleaseType.ALPHA
default: return ReleaseType.STABLE
}
}

publishMods {
dryRun = providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null
changelog = providers.environmentVariable("CHANGELOG").orElse("")
version = mod_version
type = releaseTypeToPublishType(ftbPublishing.relType)

def curseOptions = curseforgeOptions {
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
projectId = project.curseforge_id
minecraftVersions.add(rootProject.minecraft_version)

requires {
slug = 'architectury-api'
}
}

curseforge("forge") {
from curseOptions
modLoaders.add("neoforge")
modLoaders.add("forge")
file = project(":forge").tasks.remapJar.archiveFile

requires {
slug = 'ftb-library-forge'
slug = 'architectury-api'
}
}

curseforge("fabric") {
from curseOptions

file = project(":fabric").tasks.remapJar.archiveFile
modLoaders.add("fabric")

requires {
slug = "fabric-api"
slug = 'ftb-library-fabric'
}
}

github {
repository = "ftbteam/ftb-economy"
accessToken = providers.environmentVariable("GITHUB_TOKEN")
commitish = providers.environmentVariable("GITHUB_SHA").orElse("dryRun")
tagName = providers.environmentVariable("GITHUB_REF_NAME").orElse("dryRun")

// Gradle doesn't like accessing the buildApi task directly so we need to use the provider
file = project.provider { project(":common").tasks.buildApi }.flatMap { it.archiveFile }
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ enabled_platforms=fabric,forge
archives_base_name=ftb-filter-system
mod_version=1.0.1
maven_group=dev.ftb.mods
curseforge_id=943925

architectury_version=9.1.12

Expand Down

0 comments on commit e3cfae2

Please sign in to comment.