Skip to content

Commit 6fa5126

Browse files
committed
Enable Modrinth deployment
1 parent 5340a8b commit 6fa5126

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ jobs:
5959
env:
6060
CURSEFORGE_KEY_SECRET: ${{ secrets.CURSEFORGE_KEY_SECRET }}
6161
run: ./gradlew curseforge
62+
- name: 'Deploy to Modrinth'
63+
if: startsWith(github.ref, 'refs/tags/')
64+
env:
65+
MODRINTH_KEY_SECRET: ${{ secrets.MODRINTH_KEY_SECRET }}
66+
run: ./gradlew modrinth
6267
- name: 'Create GitHub release'
6368
id: create_release
6469
if: startsWith(github.ref, 'refs/tags/')

build.gradle

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ buildscript {
1212
plugins {
1313
id 'com.matthewprenger.cursegradle' version '1.4.0'
1414
id 'com.diffplug.spotless' version '5.14.3'
15+
id 'com.modrinth.minotaur' version '2.+'
1516
}
1617

1718
apply plugin: 'net.minecraftforge.gradle'
@@ -248,6 +249,28 @@ curseforge {
248249
}
249250
}
250251

252+
modrinth {
253+
if(secrets.modrinth_key) {
254+
token = secrets.modrinth_key
255+
} else if(System.getenv().GITHUB_ACTIONS && System.getenv().MODRINTH_KEY_SECRET) {
256+
token = System.getenv().MODRINTH_KEY_SECRET
257+
} else {
258+
token = "DUMMY"
259+
}
260+
projectId = "GTi2kHAW"
261+
versionNumber = project.mod_version
262+
versionType = project.release_type
263+
uploadFile = jar
264+
gameVersions = [ project.minecraft_version ]
265+
changelog = ""
266+
if (new File("resources/changelog/${project.version}.txt").exists()) {
267+
changelog = new File("resources/changelog/${project.version}.txt").text
268+
}
269+
dependencies { // A special DSL for creating dependencies
270+
required.project "Z9DM0LJ4" // Cyclops Core
271+
}
272+
}
273+
251274
publishing {
252275
repositories {
253276
if (project.hasProperty("filesmaven_url")) {

0 commit comments

Comments
 (0)