Pushing Private package in Github Packages Nuget error

238 Views Asked by At

I am having a weird exception during publishing my nuget packages with Github actions

Run dotnet nuget push ./package/*.nupkg --api-key *** --skip-duplicate --no-symbols true
Pushing WayStation_Models.1.0.0.nupkg to 'https://nuget.pkg.github.com/<Organization>'...
  PUT https://nuget.pkg.github.com/<Organization>/
  OK https://nuget.pkg.github.com/<Organization>/ 2209ms
Your package was pushed.
error: File does not exist (true).

Using nuget push successfully pushed the package (it exists on the repo!) but it still returns the File does not exist error and the pipeline shows failed.

Is this just a limitation of private repositories?

This is my auth and release job flow:

release:
    runs-on: ubuntu-latest    
    needs: build
    permissions: 
      packages: write
    if: github.ref == 'refs/heads/main' # only run job if on the main branch   
    
    steps:  
    #Push NuGet package to GitHub packages
    - name: Download nuget package artifact
      uses: actions/download-artifact@v3
      with:
        name: nugetPackage
        path: ./package
    - name: Setup .NET Core @ Latest
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: 7.0.x
        source-url: ${{ secrets.GHPACKAGESURL }}
      env:
        NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}   
    - name: Push package to GitHub packages 
      run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols true

1

There are 1 best solutions below

0
On

The error was caused by the parameter:

--no-symbols true

in

- name: Push package to GitHub packages        
  run: dotnet nuget push ./package/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate --no-symbols true