404 trying to push to Maven repository

I am trying to publish a Scala Maven package to GitHub Packages using sbt publish but I am getting a 404 error.

PUT operation to URL https://maven.pkg.github.com/COMPANY_NAME/com/COMPANY_NAME/common_2.12/e1071929a9658a8bafc7fceed2f0fb9f041e032a-SNAPSHOT/common_2.12-e1071929a9658a8bafc7fceed2f0fb9f041e032a-SNAPSHOT.pom failed with status code 404: Not Found; Response Body: The expected resource was not found.

At first glance the URL looks sensible. But I couldn’t find any documentation on what URL GitHub is expecting.

I was able to publish a package by manually invoking the mvn command.

mvn deploy:deploy-file \
                  -DrepositoryId=github \
                  -Dfile=target/scala-2.12/common_2.12-1.1.0.jar \
                  -Dsources=target/scala-2.12/common_2.12-1.1.0-sources.jar \
                  -Djavadoc=target/scala-2.12/common_2.12-1.1.0-javadoc.jar \
                  -Durl=https://maven.pkg.github.com/COMPANY_NAME/REPO_NAME \
                  -DpomFile=target/scala-2.12/common_2.12-1.1.0.pom \
                  -DgroupId=com.COMPANY_NAME \
                  -DartifactId=common_2.12

But this solution is less than ideal.