setup-dotnet icon indicating copy to clipboard operation
setup-dotnet copied to clipboard

Multiple Package Sources

Open atrauzzi opened this issue 4 years ago • 9 comments

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?

atrauzzi avatar Feb 10 '21 15:02 atrauzzi

@adamralph any update on this? Would be much appreciated.

auriorx avatar Feb 21 '22 20:02 auriorx

wrong username?

adamralph avatar Feb 21 '22 20:02 adamralph

Yep, my bad lol

auriorx avatar Feb 21 '22 20:02 auriorx

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

auriorx avatar Feb 21 '22 20:02 auriorx

  1. +8801783217877

rabbi978 avatar Feb 21 '23 05:02 rabbi978

Any traction on this one? 2+ years now

SlyckLizzie avatar Jun 04 '23 12:06 SlyckLizzie

Hi, all 👋 Sorry for delayed feedback, we will take a look at this issue!

IvanZosimov avatar Jun 05 '23 09:06 IvanZosimov

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: ''

jblazek avatar Mar 26 '24 20:03 jblazek

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 }}

CoenraadS avatar Aug 14 '24 00:08 CoenraadS