Closed anders-wind closed 7 months ago
And we should have plenty of space etc
I think this might be a thing: To save an API Key for a source use the 'setApiKey' command.
https://docs.microsoft.com/de-de/nuget/reference/cli-reference/cli-ref-setapikey
- name: "Setup NuGet apikey"
shell: "bash"
run: >
`./vcpkg/vcpkg fetch nuget | tail -n 1`
setapikey "<NUGET_REGISTRY_PAT>" -Source "<NUGET_REGISTRY>"
But why would it be required for pushing python3 but not the 17 other packages which are successfully pushed?
cc @BillyONeal
For helping investigation: python3 is 106MB, and ~35MB zipped.
Unfortunately it is blowing up inside the command
/usr/bin/mono /home/runner/work/EPEXcpp/EPEXcpp/vcpkg/downloads/tools/nuget-5.11.0-linux/nuget.exe push /home/runner/work/EPEXcpp/EPEXcpp/vcpkg/buildtrees/python3_x64-linux.3.10.1-vcpkgc87aa8919988de817c495b22160d65c4accc42bdcfffbd763e4566758c070e28.nupkg -ForceEnglishOutput -Timeout 100 -Source GitHub -NonInteractive 2>&1
meaning our options for direct diagnosis are limited.
Is there anything I can do to provide more input? I am not sure what the requires:discussion
label entails
https://github.com/NuGet/Home/issues/9775#issuecomment-714509211 ^seems relevant, apparently using api key is more stable than username/password. Is this something we could get for vcpkg?
https://docs.microsoft.com/de-de/nuget/reference/cli-reference/cli-ref-setapikey
- name: "Setup NuGet apikey" shell: "bash" run: > `./vcpkg/vcpkg fetch nuget | tail -n 1` setapikey "<NUGET_REGISTRY_PAT>" -Source "<NUGET_REGISTRY>"
@anders-wind have you tried this?
Related, maybe: https://github.com/microsoft/vcpkg/pull/22191
Hi guys, can anyone test whether https://github.com/microsoft/vcpkg/pull/22191 works?
Thanks.
Im trying out the setapikey setup. Im getting Your request could not be authenticated by the GitHub Packages service. Please ensure your access token is valid and has the appropriate scopes configured.
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` sources add -source "https://nuget.pkg.github.com/twig-energy/index.json" -name "GitHub";
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` setapikey "${{ secrets.PACKAGES_ACCESS_TOKEN }}" -source "https://nuget.pkg.github.com/twig-energy/index.json";
The secrets.PACKAGES_ACCESS_TOKEN is a personal access token from my account. I also tried with secrets.GITHUB_TOKEN
If the packages are stored in a different repo, your PAT need to have the read and write packages persmissions.
If it is the same repo, github token works,but might fail if multiple repos are using binary caching if there isnt a global repo to store the build packages
These are the permissions I gave the key.
The path I'm pointing to is just the organization url and not the entire repo url. Should I change that?
Yeah, you need a repo as a location. I recommend just to create a new repo e.g. vcpkg-cache
and use that repo everywhere. That works quite well with GHA.
Permissions are looking good.
Okay ill try that :)
Okay, I got the setapikey working - it actually enables consistent pushes, but for whatever reason it does not provide neccesary permissions to download from the registry. So I need to input both username/password and the apikey
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` sources add -source "https://nuget.pkg.github.com/twig-energy/index.json" -storepasswordincleartext -name "GitHub" -username "twig-energy" -password "${{ secrets.GITHUB_TOKEN }}"
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` setapikey "${{ secrets.PACKAGES_ACCESS_TOKEN }}" -source "https://nuget.pkg.github.com/twig-energy/index.json"
@mathisloge I tried adding a new repo but got a bunch of other errors so I returned to the org setup
yeah username + password + apikey. IIRC the first one is for github basic auth to get access to the package manifests and the second one for uploading
I need to try if the GITHUB_TOKEN can also be used for the setapikey :) But yea hope the documentation will be updated - but this issue can be closed I guess :) Thanks for the help!
Describe the bug I'm trying to use the github nuget binary caching integration and while it works for most of our package it fails for python (dependency of pybind11)
I ran cmake with: -DVCPKG_INSTALL_OPTIONS=--debug
Here's our manifest
and I have the following in my github action:
VCPKG_BINARY_SOURCES: 'default;nuget,GitHub,readwrite'
Again it works for most packages, but not for python3.
Environment
To Reproduce setup nuget credentials in github actions and configure vcpkg to use it. add pybind11 as vcpkg dependency in manifest. run cmake and see cache pushing fails.
Expected behavior python3 dependency would be correctly pushed to the binary cache
Failure logs