mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Add rudimentary support for modrinth publishing (#263)
(cherry picked from commit 4da029729c)
Signed-off-by: Max <maxh2709@gmail.com>
This commit is contained in:
3
.github/workflows/1.19_push.yml
vendored
3
.github/workflows/1.19_push.yml
vendored
@@ -71,5 +71,6 @@ jobs:
|
|||||||
# GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
|
# GIT_PREVIOUS_COMMIT: ${{ github.event.before }}
|
||||||
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
|
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
|
||||||
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
|
CURSE_API_KEY: ${{ secrets.CURSE_API_KEY }}
|
||||||
|
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
|
||||||
with:
|
with:
|
||||||
arguments: publish curseforge --stacktrace --no-daemon
|
arguments: publish curseforge modrinth --stacktrace --no-daemon
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.text.SimpleDateFormat
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
configurations.classpath {
|
configurations.classpath {
|
||||||
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
|
||||||
@@ -9,6 +11,7 @@ plugins {
|
|||||||
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
|
id "dev.architectury.loom" version "0.12.0-SNAPSHOT" apply false
|
||||||
id "org.cadixdev.licenser" version "0.6.1"
|
id "org.cadixdev.licenser" version "0.6.1"
|
||||||
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
|
id "com.matthewprenger.cursegradle" version "1.4.0" apply false
|
||||||
|
id "com.modrinth.minotaur" version "2.2.0" apply false
|
||||||
id "maven-publish"
|
id "maven-publish"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +84,7 @@ allprojects {
|
|||||||
|
|
||||||
ext {
|
ext {
|
||||||
releaseChangelog = {
|
releaseChangelog = {
|
||||||
def dateFormat = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm")
|
def dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm")
|
||||||
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
|
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"))
|
||||||
def branch
|
def branch
|
||||||
if (System.env.BRANCH_NAME) {
|
if (System.env.BRANCH_NAME) {
|
||||||
@@ -115,5 +118,3 @@ allprojects {
|
|||||||
|
|
||||||
task licenseFormatAll
|
task licenseFormatAll
|
||||||
subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
|
subprojects { p -> licenseFormatAll.dependsOn("${p.path}:licenseFormat") }
|
||||||
|
|
||||||
task curseforgePublish
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||||
id "com.matthewprenger.cursegradle"
|
id "com.matthewprenger.cursegradle"
|
||||||
|
id "com.modrinth.minotaur"
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
@@ -99,11 +100,12 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
curseforge {
|
curseforge {
|
||||||
if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
|
var CURSE_API_KEY = project.findProperty("CURSE_API_KEY") ?: System.getenv("CURSE_API_KEY")
|
||||||
apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
|
if (CURSE_API_KEY != null) {
|
||||||
|
apiKey = CURSE_API_KEY
|
||||||
project {
|
project {
|
||||||
id = "419699"
|
id = rootProject.curseforge_id
|
||||||
releaseType = "$rootProject.cf_type"
|
releaseType = "$rootProject.artifact_type"
|
||||||
changelogType = "html"
|
changelogType = "html"
|
||||||
changelog = releaseChangelog()
|
changelog = releaseChangelog()
|
||||||
addGameVersion "1.19-Snapshot"
|
addGameVersion "1.19-Snapshot"
|
||||||
@@ -126,4 +128,21 @@ curseforge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
|
modrinth {
|
||||||
|
var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN")
|
||||||
|
if (MODRINTH_TOKEN != null) {
|
||||||
|
token = MODRINTH_TOKEN
|
||||||
|
projectId = rootProject.modrinth_id
|
||||||
|
versionType = "$rootProject.artifact_type"
|
||||||
|
versionNumber = "$project.version+$project.name"
|
||||||
|
versionName = "[Fabric $rootProject.supported_version] v$project.version"
|
||||||
|
changelog = releaseChangelog()
|
||||||
|
uploadFile = remapJar
|
||||||
|
gameVersions = ["1.19-pre1"]
|
||||||
|
loaders = ["fabric"]
|
||||||
|
dependencies {
|
||||||
|
// TODO: move to slugs if that functionality becomes available in minotaur
|
||||||
|
required.project("P7dR8mSH") // Fabric API
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id "com.github.johnrengelman.shadow" version "7.1.2"
|
id "com.github.johnrengelman.shadow" version "7.1.2"
|
||||||
id "com.matthewprenger.cursegradle"
|
id "com.matthewprenger.cursegradle"
|
||||||
|
id "com.modrinth.minotaur"
|
||||||
}
|
}
|
||||||
|
|
||||||
loom {
|
loom {
|
||||||
@@ -112,14 +113,15 @@ publishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
curseforge {
|
curseforge {
|
||||||
if (project.hasProperty("CURSE_API_KEY") || System.getenv("CURSE_API_KEY") != null) {
|
var CURSE_API_KEY = project.findProperty("CURSE_API_KEY") ?: System.getenv("CURSE_API_KEY")
|
||||||
apiKey = project.hasProperty("CURSE_API_KEY") ? project.property("CURSE_API_KEY") : System.getenv("CURSE_API_KEY")
|
if (CURSE_API_KEY != null) {
|
||||||
|
apiKey = CURSE_API_KEY
|
||||||
project {
|
project {
|
||||||
id = "419699"
|
id = rootProject.curseforge_id
|
||||||
releaseType = "$rootProject.cf_type"
|
releaseType = "$rootProject.artifact_type"
|
||||||
changelogType = "html"
|
changelogType = "html"
|
||||||
changelog = releaseChangelog()
|
changelog = releaseChangelog()
|
||||||
addGameVersion "1.18.2"
|
addGameVersion "1.19-Snapshot"
|
||||||
addGameVersion "Java 17"
|
addGameVersion "Java 17"
|
||||||
addGameVersion "Forge"
|
addGameVersion "Forge"
|
||||||
mainArtifact(remapJar.archivePath) {
|
mainArtifact(remapJar.archivePath) {
|
||||||
@@ -136,4 +138,19 @@ curseforge {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootProject.tasks.getByName("curseforgePublish").dependsOn tasks.getByName("curseforge")
|
modrinth {
|
||||||
|
var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN")
|
||||||
|
if (MODRINTH_TOKEN != null) {
|
||||||
|
token = MODRINTH_TOKEN
|
||||||
|
projectId = rootProject.modrinth_id
|
||||||
|
versionType = "$rootProject.artifact_type"
|
||||||
|
versionNumber = "$project.version+$project.name"
|
||||||
|
versionName = "[Forge $rootProject.supported_version] v$project.version"
|
||||||
|
changelog = releaseChangelog()
|
||||||
|
uploadFile = remapJar
|
||||||
|
gameVersions = ["1.19-pre1"]
|
||||||
|
loaders = ["forge"]
|
||||||
|
dependencies {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ platforms=fabric
|
|||||||
minecraft_version=1.19-pre1
|
minecraft_version=1.19-pre1
|
||||||
supported_version=1.19-pre1
|
supported_version=1.19-pre1
|
||||||
|
|
||||||
cf_type=beta
|
artifact_type=beta
|
||||||
|
|
||||||
archives_base_name=architectury
|
archives_base_name=architectury
|
||||||
archives_base_name_snapshot=architectury-snapshot
|
archives_base_name_snapshot=architectury-snapshot
|
||||||
@@ -18,3 +18,6 @@ fabric_api_version=0.52.4+1.19
|
|||||||
mod_menu_version=3.1.0
|
mod_menu_version=3.1.0
|
||||||
|
|
||||||
forge_version=40.1.14
|
forge_version=40.1.14
|
||||||
|
|
||||||
|
curseforge_id=419699
|
||||||
|
modrinth_id=lhGA9TYQ
|
||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
Reference in New Issue
Block a user