diff --git a/README.md b/README.md index 028e486..a46582e 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,12 @@ You can add the library by inserting the following in your `build.gradle` : ```gradle repositories { maven { - name = "Ladysnake Libs" - url = "https://dl.bintray.com/ladysnake/libs" + name = 'Ladysnake Mods' + url = 'https://ladysnake.jfrog.io/artifactory/mods' + content { + includeGroup 'io.github.ladysnake' + includeGroupByRegex 'io\\.github\\.onyxstudios.*' + } } } diff --git a/build.gradle b/build.gradle index ca404a9..4a772f2 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id 'fabric-loom' version '0.5-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.21.0' id 'org.ajoberstar.grgit' version '3.1.1' id 'com.github.breadmoirai.github-release' version '2.2.9' id 'java-library' diff --git a/release.gradle b/release.gradle index c023c4c..f4b2d36 100644 --- a/release.gradle +++ b/release.gradle @@ -9,7 +9,7 @@ task checkGitStatus() { throw new RuntimeException("Git repository not ready for release (${grgit.status()})") } def currentBranch = grgit.branch.current().getName() - if (currentBranch != 'master' && !currentBranch.matches(/\d\.\d{2}/)) { + if (currentBranch != 'main' && !currentBranch.matches(/\d+\.\d+(?>\.\d+)?/)) { throw new RuntimeException("Need to be on a stable branch to release (currently on ${currentBranch})") } grgit.fetch() @@ -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 { @@ -156,7 +161,7 @@ curseforge { tasks.curseforge.dependsOn(checkGitStatus) -task release(dependsOn: [tasks.publish, tasks.githubRelease, tasks.bintrayUpload, tasks.curseforge]) { +task release(dependsOn: [tasks.publish, tasks.githubRelease, tasks.artifactoryPublish, tasks.curseforge]) { group = 'publishing' description = 'Releases a new version to Maven, Github and Curseforge' }