setup-dotnet
setup-dotnet copied to clipboard
Multiple Package Sources
Description: Opening this as per https://github.com/actions/setup-dotnet/issues/75#issuecomment-776603763.
Justification: Configuring a package source shouldn't preclude me from consuming packages from any other sources. For example, GitHub and Azure Devops are popular for private organization packages. Whereas MyGet is often used for pre-release feeds. Then of course you have Nuget, which while people should be able to disable it, is usually the root-most fallback.
As such, multiple sources should be supported.
Are you willing to submit a PR? Maybe?
@adamralph any update on this? Would be much appreciated.
wrong username?
Yep, my bad lol
By the way, for anyone struggling with this; you could use the following workaround:
- name: Setup .NET Core (without a source-url, so default NuGet source is used)
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Add Azure Source
shell: bash
run: dotnet nuget add source ${{ env.azure-feed }} --name ${{env.azure-source}} --username az --password ${{ env.azure-api-key }} --store-password-in-clear-text
- name: Push Example
shell: bash
run: dotnet nuget push -s ${{ env.azure-source }} --api-key AzureArtifacts ${{env.package-name}}.${{env.software-version}}.nupkg
Things to note:
- Shell bash might be because my example is based of off a composite action
- This is for Azure specifcally. Other package sources might require modifications
- +8801783217877
Any traction on this one? 2+ years now
Hi, all 👋 Sorry for delayed feedback, we will take a look at this issue!
Any update on this? We have a use case with multiple sources which require authentication.
Something like this config would meet our needs.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
nuget-sources:
- url: ''
token: ''
- url: ''
token: ''
I worked around the issue like this:
- name: dotnet
run: dotnet ...
env:
# https://github.com/actions/setup-dotnet/issues/167
NuGetPackageSourceCredentials_github: Username=${{ github.actor }};Password=${{ secrets.GITHUB_TOKEN }}