0

I want to create an Android library and publish it in GitHub packages so that I can use it in multiple projects. When I create a project I have not choice to create an individual library and all the examples I have seen involve adding an Android library as a module to a project. If I do that how do I publish the library separately in GitHub to a package? I was thinking the library would be a standalone GitHub repo and I would use GitHub actions so that every release would publish a new package. Without creating a library as a standalone package, I will need to find a way to only push the aar file to GitHub packages and not the whole project.

Is there a standard way to do this?

lcj
  • 1,355
  • 16
  • 37

1 Answers1

0

You need to host repo on github to publish your artifact. You can do 2 things if you want to expose your code base.

  1. Create a private repo to host your code.
  2. Create an empty repo to publish your artifacts.

In your private repo publish gradle file to publish to package, setURL of empty repo. In this way, you will have a separate codebase and separate artifacts published to serve.

Nauman Ash
  • 957
  • 1
  • 8
  • 19