Skip to content

Commit

Permalink
feat(publish): publish github package to user namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Silthus committed May 19, 2020
1 parent 63a0708 commit ac38c81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ plugins {
id 'kr.entree.spigradle' version '1.2.1'
id 'java'
id 'jacoco'
id "org.hibernate.build.maven-repo-auth" version "3.0.2"
}

apply from: "$rootDir/gradle/jacoco.gradle"
Expand All @@ -23,10 +22,6 @@ ext {
//Define one of the supported mc versions
mcVersion = project.property("mcVersion")
packageName = project.property("packageName")
junitVersion = '5.6.2'
guavaVersion = '29.0-jre'
immutablesVersion = '2.8.7'
errorproneVersion = '2.3.4'
}

group project.property("group")
Expand Down Expand Up @@ -65,6 +60,10 @@ repositories {
maven {
name = 'github'
url = 'https://maven.pkg.github.com/Silthus'
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}

maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
Expand Down
4 changes: 3 additions & 1 deletion gradle/publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ publishing {
}
repositories {
maven {
def repo = project.findProperty("GITHUB_REPOSITORY")?: System.getenv("GITHUB_REPOSITORY")
def githubOwner, repository = repo != null ? repo.toLowerCase().tokenize("/") : project.findProperty("author")
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${project.findProperty("GITHUB_REPOSITORY")?: System.getenv("GITHUB_REPOSITORY")}")
url = uri("https://maven.pkg.github.com/${githubOwner}")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
Expand Down

0 comments on commit ac38c81

Please sign in to comment.