Publish on Modrinth

This commit is contained in:
RuscalWorld 2021-05-26 00:27:30 +03:00
parent 0b87fec8b4
commit b32bdf4d19
No known key found for this signature in database
GPG key ID: 4F53776031D128ED
2 changed files with 33 additions and 0 deletions

20
.github/workflows/modrinth.yml vendored Normal file
View 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

View file

@ -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')
}