Skip to content

Instantly share code, notes, and snippets.

@prasad79
Last active December 17, 2019 15:49
Show Gist options
  • Save prasad79/dfa0a41f104436e6204c2cbac8d8b303 to your computer and use it in GitHub Desktop.
Save prasad79/dfa0a41f104436e6204c2cbac8d8b303 to your computer and use it in GitHub Desktop.
Publishing Android library to Github Packages using Kotlin DSL - configure repositories details
publishing {
repositories {
maven {
name = "GitHubPackages"
/** Configure path of your package repository on Github
* Replace GITHUB_USERID with your/organisation Github userID and REPOSITORY with the repository name on GitHub
*/
url = uri("https://maven.pkg.github.com/GITHUB_USERID/REPOSITORY") // Github Package
credentials {
//Fetch these details from the properties file or from Environment variables
username = githubProperties.get("gpr.usr") as String? ?: System.getenv("GPR_USER")
password = githubProperties.get("gpr.key") as String? ?: System.getenv("GPR_API_KEY")
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment