Add CurseForge plugin

This commit is contained in:
raoulvdberge
2021-12-12 23:28:43 +01:00
parent 0906b51b99
commit 548c77252f
2 changed files with 47 additions and 21 deletions

View File

@@ -57,6 +57,12 @@ jobs:
name: ${{ steps.tagName.outputs.tag }} name: ${{ steps.tagName.outputs.tag }}
files: | files: |
build/libs/*.jar build/libs/*.jar
- name: Release on CurseForge
run: ./gradlew curseforge
env:
RELEASE: ${{ steps.tagName.outputs.tag }}
CHANGELOG: ${{ steps.changelog_reader.outputs.changes }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
# This is necessary because the Discord action doesn't support GH actions variable expansion? # This is necessary because the Discord action doesn't support GH actions variable expansion?
- name: Set release URL - name: Set release URL
run: | run: |

View File

@@ -8,6 +8,10 @@ buildscript {
} }
} }
plugins {
id 'com.matthewprenger.cursegradle' version '1.4.0'
}
repositories { repositories {
maven { maven {
url = "https://dvs1.progwml6.com/files/maven/" url = "https://dvs1.progwml6.com/files/maven/"
@@ -125,6 +129,22 @@ jar {
} }
} }
if (System.getenv("CURSEFORGE_TOKEN") != null) {
curseforge {
apiKey = System.getenv("CURSEFORGE_TOKEN")
project {
id = '243076'
changelog = System.getenv("CHANGELOG")
changelogType = 'markdown'
releaseType = project.version.toString().contains('beta') ? 'beta' : (project.version.toString().contains('alpha') ? 'alpha' : 'release')
mainArtifact(jar) {
displayName = "v$project.version"
}
}
}
}
jar.finalizedBy('reobfJar') jar.finalizedBy('reobfJar')
publishing { publishing {