Skip to content

Commit

Permalink
build: setup modrinth publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Apr 15, 2023
1 parent d842b5a commit 11fd084
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
title: CarbonChat ${{ steps.vars.outputs.tag }}
pre-release: true
- name: Publish (Pre-)Release to Modrinth
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}"
run: ./gradlew :carbonchat-paper:modrinth :carbonchat-velocity:modrinth
env:
MODRINTH_TOKEN: "${{ secrets.MODRINTH_TOKEN }}"
RELEASE_NOTES: "${{ github.event.release.body }}"
- name: Publish (Pre-)Release to Hangar
if: "${{ env.STATUS == 'release' && (github.event_name == 'release' || (github.event_name == 'push' && contains(github.ref, '+beta.'))) }}"
run: ./gradlew publishAllPublicationsToHangar
Expand Down
1 change: 1 addition & 0 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {
implementation(libs.indraLicenseHeader)
implementation(libs.licenser)
implementation(libs.pluginYml)
implementation(libs.minotaur)
implementation("org.spongepowered:configurate-yaml:4.0.0")
compileOnly("com.fasterxml.jackson.core:jackson-core:2.14.0")
compileOnly("com.fasterxml.jackson.core:jackson-annotations:2.14.0")
Expand Down
13 changes: 13 additions & 0 deletions build-logic/src/main/kotlin/carbon.platform-conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("carbon.base-conventions")
id("com.modrinth.minotaur")
}

val platformExtension = extensions.create<CarbonPlatformExtension>("carbonPlatform")
Expand All @@ -16,6 +17,18 @@ tasks {
}
}

val projectVersion = project.version as String

modrinth {
projectId.set("QzooIsZI")
versionType.set(if (projectVersion.contains("+beta.")) "beta" else "release")
file.set(platformExtension.jarTask.flatMap { it.archiveFile })
changelog.set(releaseNotes)
token.set(providers.environmentVariable("MODRINTH_TOKEN"))
required.project("luckperms")
gameVersions.add("1.19.4")
}

//val projectVersion = version as String
//if (projectVersion.endsWith("-SNAPSHOT")) {
// // Add git commit hash to version for platforms
Expand Down
5 changes: 5 additions & 0 deletions gradle/libs.versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ versions:
rabbitmq: 5.13.1
nats: 2.12.0
pluginYml: 0.5.3
minotaur: 2.7.5

dependencies:
adventureBom:
Expand Down Expand Up @@ -316,6 +317,10 @@ dependencies:
group: net.minecrell
name: plugin-yml
version: { ref: pluginYml }
minotaur:
group: com.modrinth.minotaur
name: Minotaur
version: { ref: minotaur }

luckPermsApi:
group: net.luckperms
Expand Down

0 comments on commit 11fd084

Please sign in to comment.