Publish on Modrinth
This commit is contained in:
parent
0b87fec8b4
commit
b32bdf4d19
2 changed files with 33 additions and 0 deletions
20
.github/workflows/modrinth.yml
vendored
Normal file
20
.github/workflows/modrinth.yml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
name: Publish on Modrinth
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ created ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Build with Gradle and publish on Modrinth
|
||||
run: ./gradlew publish
|
13
build.gradle
13
build.gradle
|
@ -1,4 +1,5 @@
|
|||
import net.fabricmc.loom.task.RemapJarTask
|
||||
import com.modrinth.minotaur.TaskModrinthUpload
|
||||
|
||||
buildscript {
|
||||
dependencies {
|
||||
|
@ -8,6 +9,7 @@ buildscript {
|
|||
|
||||
plugins {
|
||||
id 'com.github.johnrengelman.shadow' version '6.1.0'
|
||||
id "com.modrinth.minotaur" version "1.1.0"
|
||||
id 'fabric-loom' version '0.6-SNAPSHOT'
|
||||
id 'maven-publish'
|
||||
}
|
||||
|
@ -94,3 +96,14 @@ task remapShadowJar(type: RemapJarTask, dependsOn: shadowJar) {
|
|||
}
|
||||
|
||||
assemble.dependsOn(remapShadowJar)
|
||||
|
||||
task publishModrinth(type: TaskModrinthUpload, dependsOn: remapShadowJar) {
|
||||
onlyIf { System.getenv("MODRINTH_TOKEN") }
|
||||
|
||||
token = System.getenv("MODRINTH_TOKEN")
|
||||
projectId = 'dbVXHSlv'
|
||||
versionNumber = project.mod_version
|
||||
uploadFile = remapShadowJar
|
||||
addGameVersion(project.minecraft_version)
|
||||
addLoader('fabric')
|
||||
}
|
Loading…
Reference in a new issue