Implement Central Package Management - #6
Conversation
4c46912 to
15d6834
Compare
|
@manfred-brands Some notes for reviewing this PR...
@devlead Can you suggest any alternatives to my workaround using |
manfred-brands
left a comment
There was a problem hiding this comment.
I can't tell what you mean by it not building with the the dotnet list package command as I don't see failed builds where you don't have this.
One change request to ensure dotnet cake and cake-action will use the same version of cake.
| - name: 🔨 Build, Test, Package and Publish (Cake script decides) | ||
| run: dotnet cake --target=ContinuousIntegration --configuration=Release #--verbosity=diagnostic | ||
| #run: dotnet cake --target=ContinuousIntegration --configuration=Release #--verbosity=diagnostic | ||
| uses: cake-build/cake-action@v3 |
There was a problem hiding this comment.
Switch to cake-action from dotnet-cake could result in differences between CI and local builds as they could use different versions of cake.
You can fix that by adding:
cake-version: tool-manifestThis should pick the version out of the .config/dotnet-tools.json
There was a problem hiding this comment.
Good point. It's currently working the same because we are using the latest version but that may not always be the case.
| uses: cake-build/cake-action@v3 | ||
| with: | ||
| target: ContinuousIntegration | ||
| configuration: Release |
There was a problem hiding this comment.
I can't find this in cake-action/README
The example shown uses:
arguments: |
name: value
configuration: Release
There was a problem hiding this comment.
You're right. However, I'm dropping use of cake-action anyway.
| run: dotnet tool restore | ||
|
|
||
| # For reasons I don't understand, the Cake script doesn't work in a workflow | ||
| # unless they are restored before the script runs, which this command does. |
There was a problem hiding this comment.
Can you elaborate on what packages are not restored?
Does it work when you call dotnet cake but not with the cake-action?
If cake's add-ins are not restoring, Gemini suggest to the below to the cake-action step:
env:
# Directs Cake/NuGet to cache packages properly in the runner workspace
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
There was a problem hiding this comment.
I had the same failures using dotnet cake directly as with cake-action. I added the extra step after switching to cake-action so I'll retry with dotnet cake plus the extra step since that's much simpler.
We're using two addins, Cake.Git and Cake.MinVer, but neither of them seems to be causing a problem. I can try that, however.
|
Sorry... I prematurely deleted the failing workflow runs. Here's one that I re-created: https://github.com/nunit/nunit.engine.api/actions/runs/31771447194/workflow You can see that none of my feeds listed for central package management are used and virtually none of my dependencies are found. |
|
Next steps... If I can make it work by going back to direct use of
I'll give you a chance to look at the failing run and see if you come up with any ideas. FWIW, there's lots of chatter online that suggests GitHub workflows don't fully support central package management. |
We use it for most of our repositories and never had a problem, but we are not using cake but just plain |
I have one, in your NUnit.Cake.Recipe BuildTasks.cake you explicitly set the NuGetRestoreSettings sources. The build log passes a single source to Nuget: I also think that instead of using the |
|
I think you're right... It may be better, in fact, to try to get rid of all calls calls to the NuGetXxxxx methods as well as direct calls to MSBuild. I'll work on it tomorrow... |
|
@manfred-brands Good call! Switching to |
Fixes #5