Create deployDebug and deployRelease tasks that automatically depend on relevant steps
This commit is contained in:
parent
28a8d15398
commit
be3db8824d
27
jfmod.gradle
27
jfmod.gradle
|
@ -309,6 +309,19 @@ dependencies {
|
|||
}
|
||||
}
|
||||
|
||||
def readmeFile = rootProject.file("README.md")
|
||||
|
||||
task deployDebug() {
|
||||
}
|
||||
|
||||
task deployRelease() {
|
||||
}
|
||||
|
||||
tasks.publish.dependsOn(tasks.build)
|
||||
tasks.deployDebug.dependsOn(tasks.publish)
|
||||
|
||||
tasks.deployRelease.dependsOn(tasks.deployDebug)
|
||||
|
||||
if (ext.modrinthAvailable) {
|
||||
modrinth {
|
||||
token = System.getenv().MODRINTH_API_TOKEN
|
||||
|
@ -329,10 +342,13 @@ if (ext.modrinthAvailable) {
|
|||
String dep -> dependencies.add(new com.modrinth.minotaur.dependencies.ModDependency(dep, "optional"))
|
||||
}
|
||||
}
|
||||
if (readmeFile.exists()) {
|
||||
syncBodyFrom = readmeFile.text
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
task modrinth() {
|
||||
tasks.deployRelease.dependsOn(tasks.modrinth)
|
||||
if (readmeFile.exists()) {
|
||||
tasks.deployRelease.dependsOn(tasks.modrinthSyncBody)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -374,8 +390,5 @@ if (ext.curseforgeAvailable) {
|
|||
forgeGradleIntegration = false
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
task curseforge() {
|
||||
}
|
||||
tasks.deployRelease.dependsOn(tasks.curseforge)
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ stages:
|
|||
build_test:
|
||||
stage: build
|
||||
script:
|
||||
- gradle --build-cache build publish -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- gradle --build-cache deployDebug -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- cp build/libs/* ./
|
||||
- cp build/devlibs/*-dev.jar ./
|
||||
- rm *-maven.jar *-sources.jar
|
||||
|
@ -31,4 +31,4 @@ deploy:
|
|||
- if: $CI_COMMIT_TAG && '$CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ /^master/'
|
||||
stage: deploy
|
||||
script:
|
||||
- gradle --build-cache build publish curseforge modrinth -Prelease -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
- gradle --build-cache deployRelease -Prelease -Pmaven="$CI_API_V4_URL/projects/$CI_PROJECT_ID/packages/maven"
|
||||
|
|
Loading…
Reference in New Issue