diff --git a/build.gradle b/build.gradle index 18fedd355e..2ec9a2ebac 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -//version: 928ecf7feb33a1149538b0e2cd17e3bc5f281428 +//version: be36e1399d5622c152db7c530c48e17cde0ce1bb /* DO NOT CHANGE THIS FILE! @@ -42,6 +42,7 @@ plugins { id("org.ajoberstar.grgit") version("3.1.1") id("com.github.johnrengelman.shadow") version("4.0.4") id("com.palantir.git-version") version("0.12.3") + id("maven-publish") } apply plugin: 'forge' @@ -460,6 +461,38 @@ artifacts { } } +// publishing +publishing { + publications { + maven(MavenPublication) { + artifact source: jar + artifact source: sourcesJar, classifier: "src" + artifact source: devJar, classifier: "dev" + if (apiPackage) { + archives source: apiJar, classifier: "api" + } + + groupId = System.getenv("ARTIFACT_GROUP_ID") ?: group + artifactId = System.getenv("ARTIFACT_ID") ?: project.name + version = System.getenv("ARTIFACT_VERSION") ?: project.version + } + } + + repositories { + maven { + String owner = System.getenv("REPOSITORY_OWNER") ?: "Unknown" + String repositoryName = System.getenv("REPOSITORY_NAME") ?: "Unknown" + String githubRepositoryUrl = "https://maven.pkg.github.com/$owner/$repositoryName" + name = "GitHubPackages" + url = githubRepositoryUrl + credentials { + username = System.getenv("GITHUB_ACTOR") ?: "NONE" + password = System.getenv("GITHUB_TOKEN") ?: "NONE" + } + } + } +} + // Updating task updateBuildScript { doLast {