Skip to content

Commit

Permalink
Switch maven to artifactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed May 1, 2021
1 parent aac650f commit d9f4631
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 39 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ You can add the library by inserting the following in your `build.gradle` :
repositories {
jcenter()
maven {
name = "Ladysnake Libs"
url = 'https://dl.bintray.com/ladysnake/libs' }
name = "Ladysnake Mods"
url = "https://ladysnake.jfrog.io/artifactory/mods"
}
}
Expand Down
27 changes: 5 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id 'fabric-loom' version '0.7-SNAPSHOT'
id "net.minecrell.licenser" version "0.4.1"
id 'com.matthewprenger.cursegradle' version '1.4.0'
id "com.jfrog.bintray" version '1.8.4'
id 'com.jfrog.artifactory' version '4.20.0'
id 'org.ajoberstar.grgit' version '3.1.1'
id 'com.github.breadmoirai.github-release' version '2.2.9'
id 'com.modrinth.minotaur' version '1.1.0'
Expand Down Expand Up @@ -139,26 +139,9 @@ license {
}
}

apply from: 'release.gradle'

task modrinth (type: TaskModrinthUpload, dependsOn: checkGitStatus){
if (project.hasProperty('modrinth_key') != null) {
token = project.findProperty('modrinth_key')
}
projectId = findProperty("modrinth_id")
versionNumber = project.version
uploadFile = remapJar
subprojects {
addFile(remapJar)
}
changelog = project.getChangelogText()
"${project.curseforge_versions}".split('; ').each {
addGameVersion it
}
addLoader('fabric')
ext {
// no idea how else to import TaskModrinthUpload from release.gradle
ModrinthUpload = TaskModrinthUpload
}

task release(dependsOn: [tasks.publish, tasks.githubRelease, tasks.bintrayUpload, tasks.curseforge, tasks.modrinth]) {
group = 'publishing'
description = 'Releases a new version to Maven, Github and Curseforge'
}
apply from: 'release.gradle'
57 changes: 42 additions & 15 deletions release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,30 @@ githubRelease {
}
tasks.githubRelease.dependsOn(checkGitStatus)

bintray {
user = project.findProperty('bintray_user')
key = project.findProperty('bintray_api_key')
publications = ['mavenJava']
publish = true //[Default: false] Whether version should be auto published after an upload
pkg {
repo = 'libs'
name = project.name
userOrg = 'ladysnake'
version {
name = project.version
vcsTag = project.version
released = new Date()
artifactory {
if (project.hasProperty("artifactory_user")) {
contextUrl = "https://ladysnake.jfrog.io/artifactory/"
publish {
repository {
repoKey = "mods"

username = artifactory_user
password = artifactory_api_key
}
defaults {
publications("mavenJava")

publishArtifacts = true
publishPom = true
}
}
} else {
println "Cannot configure artifactory; please define ext.artifactory_user and ext.artifactory_api_key before running artifactoryPublish"
}
}

bintrayUpload.dependsOn(checkGitStatus)
bintrayUpload.dependsOn build
artifactoryPublish.dependsOn(checkGitStatus)
artifactoryPublish.dependsOn build

// configure the maven publication
publishing {
Expand Down Expand Up @@ -154,3 +159,25 @@ curseforge {
}

tasks.curseforge.dependsOn(checkGitStatus)

task modrinth (type: ModrinthUpload, dependsOn: checkGitStatus){
if (project.hasProperty('modrinth_key') != null) {
token = project.findProperty('modrinth_key')
}
projectId = findProperty("modrinth_id")
versionNumber = project.version
uploadFile = remapJar
subprojects {
addFile(remapJar)
}
changelog = project.getChangelogText()
"${project.curseforge_versions}".split('; ').each {
addGameVersion it
}
addLoader('fabric')
}

task release(dependsOn: [tasks.publish, tasks.githubRelease, tasks.artifactoryPublish, tasks.curseforge, tasks.modrinth]) {
group = 'publishing'
description = 'Releases a new version to Maven, Github and Curseforge'
}

0 comments on commit d9f4631

Please sign in to comment.