Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push to Github package registry with Gradle

Trying to push the Gradle project to Github package registry, but not working as expected.

Using io.freefair.github.package-registry-maven-publish plugin for Gradle.

Configure GitHub in build.gradle with data needed to publish - code below. And run the publishing task publishAllPublicationsToGutHub. Getting no error but I can't see my package in GitHub package registry.

github {
    slug
    username = "myGitUserName"
    token = "myTokenWithRightAccess"
    tag = "HEAD"
    travis = true
}

Expecting some examples of how to publish to Github package registry with Gradle or what I'm doing wrong when publishing

like image 786
Serhii Zadorozhnyi Avatar asked Aug 02 '19 09:08

Serhii Zadorozhnyi


People also ask

How do I use gradle packages in GitHub?

To use a published package from GitHub Packages, add the package as a dependency and add the repository to your project. For more information, see "Declaring dependencies" in the Gradle documentation. Authenticate to GitHub Packages.


1 Answers

Complete those properties correctly

  1. OWNER
  2. REPOSITORY
  3. USERNAME (or gradle property gpr.user)
  4. PASSWORD (or gradle property gpr.key)

@See demo

  1. https://github.com/youngerier/packagesdemo

  2. https://help.github.com/en/github/managing-packages-with-github-packages/configuring-gradle-for-use-with-github-packages

like image 53
yue mu Avatar answered Sep 20 '22 15:09

yue mu