I created a nuget repository in bintray and I'd like to publish a Powershell module. I've created a package in Bintray and added a version.
First, I added the repository:
Register-PSRepository -Name "Bintray" -SourceLocation "https://api.bintray.com/nuget/{organization}/{repository}" -PublishLocation "https://api.bintray.com/nuget/{organization}/{repository}" -InstallationPolicy Trusted
Then, I try to publish:
Publish-Module -Path . -Repository "Bintray" -NugetApiKey {MyApiKey}
Publish-PSArtifactUtility : Failed to publish module 'MyModule': 'Response status code does not indicate success: 401 (Unauthorized)'
I've checked my API key, my user is a "member" and members have "Publish" rights on the repository. There are no restrictions on the repository. The name of the package in Bintray matches the name of the module I'm trying to publish.
I've also tried appending -Credential {UserName}
to the publish command, and entering my password when prompted. The result is always the same.
What did I miss? How can I publish a Powershell module to a Bintray nuget repo?
Editing to update: when I try with the bintry account admin, I instead get error 405 "Not Allowed". This is true using PowerShell Publish-Module
and calling nuget directly. curl
gives me a 400 error: "Error occurred while uploading", as does bintray-cli. The web UI gives a generic error message.
This article says it works with Artifactory; and jfrog calls bintray a "full fledged nuget repository". So why doesn't this work?