Can't publish artifact to Github

I want to exploit github as private maven repo for personal use. However, when publishing packaged artifact sbt complains Access to URL ... was refused by the server: Forbidden

My build.sbt content

publishTo := Some("Github Repo" at "")
credentials += Credentials("Github Repo Manager", "host", "user", "pass")

Searching on the internet and scala user forum do not find solution. How can I publish artifact jar file to github using SBT?


Could that be because GitHub is not an artefact repository?

I think so. But seemingly it’s doable because I find some people use it that way

But it’s not clear how it’s done as the article only mentions local repos which always works without a problem.

If following that article to use github’s githubusercontent

publishTo := Some("Githut Release" at "<account>/<project-name>/release")

sbt complains PUT operation to URL ... failed with status code 400: Bad Request

They just make remote copies of their local artefact repo by putting it
inside a Git repo and then make remote copies of the Git repo with the
artefact repo inside to be used locally.

This is different from having a remote artefact server.

Easiest is to use bintray but if you need private, you can use Amazon S3
(needs an sbt plugin)