-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Programmatically Download a Package Binary from GitHub Packages | josh-ops #22
Comments
Thanks for this useful tip. I expect you will find that the GraphQL no longer works once they move the maven packages under the newer package infrastructure that both npm and Nuget are under. It brings other benefits, but it broke a script I was using to download nuget packages. I switched the script to use the REST API but then found the same as you, I couldn't use that to download the package anymore. Your post inspired me to look into other ways and I found that the URL for downloading NuGet packages is: |
Ahh, fantastic, thank you for providing this @mungojam! 🎉 |
I'll have to update the post, but here are additional examples of downloading packages in packages v2.
Maven
NuGet
npmnpm must work a bit differently; the download URL is different # get package versions
version="0.0.3"
token="ghp_xyz"
org="joshjohanning-org"
package_name="npm-package-example"
# get url
url=$(curl -H "Authorization: token $token" -Ls https://npm.pkg.github.com/@$org/$package_name | jq --arg version $version -r '.versions[$version].dist.tarball')
# download
curl -H "Authorization: token $token" -L -o $package_name-$version.tgz $url RubyGems
|
I finally got around to updating the post! And added Rubygems as well 😄 |
Very helpful. Thanks Josh. |
Saved my day. Thank you |
I had my github packed pushed to remote and now I am trying to use it in my application and added it under dependencies in my build.gradle file but however after giving the github username and pswd details when doing build it says that the username is null. Is there a way to resolve this. |
something like this |
I'm certainly not a gradle expert! But Did you end up figuring this out @niharikaganji29? |
Programmatically Download a Package Binary from GitHub Packages | josh-ops
Programmatically download a package binary (such as NuGet, Maven) from GitHub Packages
https://josh-ops.com/posts/github-download-from-github-packages/
The text was updated successfully, but these errors were encountered: