Skip to content

Commit

Permalink
Hangar Publishing implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
Dawsson committed Jul 1, 2024
1 parent a8e40a9 commit f9537a9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to Modrinth
name: Publish to Modrinth and Hangar
on:
push:
branches:
Expand All @@ -22,5 +22,6 @@ jobs:
check-latest: true
- name: Publish
env:
HANGAR_API_KEY: ${{ secrets.HANGAR_API_KEY }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew build modrinth --stacktrace
run: ./gradlew build modrinth publishAllPublicationsToHangar --stacktrace
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
projectVersion=2.0.4-SNAPSHOT

mcVersions=1.21,1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9
mcVersions=1.21,1.20.6,1.20.5,1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10, 1.9.4, 1.9.3, 1.9.2, 1.9.1, 1.9, 1.8.9,1.8.8,1.8.7,1.8.6,1.8.5,1.8.4,1.8.3,1.8.2,1.8.1,1.8
mcVersionRange=1.8-1.21
35 changes: 16 additions & 19 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ plugins {

id("xyz.jpenilla.run-paper") version "2.3.0"
id("com.modrinth.minotaur") version "2.+"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
}

repositories {
Expand Down Expand Up @@ -84,23 +85,19 @@ if (!isRelease || isMainBranch) { // Only publish releases from the main branch
detectLoaders.set(false)
}

// hangarPublish {
// publications.register("plugin") {
// version.set(suffixedVersion)
// id.set("PluginPortal")
// channel.set(if (isRelease) "Release" else if (isMainBranch) "Snapshot" else "Alpha")
// changelog.set(changelogContent)
// apiKey.set(System.getenv("HANGAR_TOKEN"))
// platforms {
// paper {
// jar.set(tasks.shadowJar.flatMap { it.archiveFile })
// platformVersions.set(listOf(property("mcVersionRange") as String))
// }
// velocity {
// jar.set(tasks.shadowJar.flatMap { it.archiveFile })
// platformVersions.set(listOf(property("velocityVersion") as String))
// }
// }
// }
// }
hangarPublish {
publications.register("plugin") {
version.set(suffixedVersion)
id.set("PluginPortal")
channel.set(if (isRelease) "Release" else if (isMainBranch) "Snapshot" else "Alpha")
changelog.set(changelogContent)
apiKey.set(System.getenv("HANGAR_API_KEY"))
platforms {
paper {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(listOf(property("mcVersionRange") as String))
}
}
}
}
}

0 comments on commit f9537a9

Please sign in to comment.