This commit is contained in:
JFronny 2020-12-29 16:46:22 +01:00
parent 9beed53d0b
commit c6c77ed97a
3 changed files with 40 additions and 17 deletions

27
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,27 @@
image: gradle:alpine
variables:
GRADLE_OPTS: "-Dorg.gradle.daemon=false"
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
build_test:
stage: deploy
script:
- gradle --build-cache assemble
- cp build/libs/* ./
- rm *-dev.jar
- mv *.jar latest.jar
artifacts:
paths:
- build/libs
- latest.jar
only:
- master
deploy:
stage: deploy
when: manual
script:
- gradle --build-cache publishModrinth

View File

@ -1,6 +1,7 @@
plugins { plugins {
id 'fabric-loom' version '0.5-SNAPSHOT' id 'fabric-loom' version '0.5-SNAPSHOT'
id 'maven-publish' id 'maven-publish'
id "com.modrinth.minotaur" version "1.1.0"
} }
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
@ -56,23 +57,18 @@ jar {
from "LICENSE" from "LICENSE"
} }
// configure the maven publication import com.modrinth.minotaur.TaskModrinthUpload
publishing {
publications {
mavenJava(MavenPublication) {
// add all the jars that should be included when publishing to maven
artifact(remapJar) {
builtBy remapJar
}
artifact(sourcesJar) {
builtBy remapSourcesJar
}
}
}
// select the repositories you want to publish to task publishModrinth (type: TaskModrinthUpload){
repositories { token = System.getenv("MODRINTH_API_TOKEN") // Use an environment property!
// uncomment to publish to the local maven projectId = 'kVAQyCLX'
// mavenLocal() versionNumber = "${project.mod_version}"
uploadFile = remapJar // This is the java jar task
addGameVersion("${project.minecraft_version}")
addLoader('fabric')
versionName = "[${project.minecraft_version}] ${project.mod_version}"
afterEvaluate {
tasks.publishModrinth.dependsOn(remapJar)
tasks.publishModrinth.dependsOn(sourcesJar)
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB