fix(ci): support NuGet package fallback for CI builds
Add conditional reference logic to use ProjectReference when available locally, falling back to PackageReference in CI environments. Pass NuGet credentials as environment variables during restore to enable authentication for private package feeds.
This commit is contained in:
@@ -24,6 +24,9 @@ jobs:
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore GitCaddy.AI.sln
|
||||
env:
|
||||
NUGET_USER: ${{ github.actor }}
|
||||
NUGET_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Build
|
||||
run: dotnet build GitCaddy.AI.sln -c Release --no-restore
|
||||
|
||||
@@ -27,6 +27,9 @@ jobs:
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore GitCaddy.AI.sln
|
||||
env:
|
||||
NUGET_USER: ${{ github.actor }}
|
||||
NUGET_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Build
|
||||
run: dotnet build GitCaddy.AI.sln -c Release --no-restore -p:Version=${{ steps.version.outputs.VERSION }}
|
||||
|
||||
@@ -27,8 +27,12 @@
|
||||
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!-- Use ProjectReference for local dev, PackageReference for CI -->
|
||||
<ItemGroup Condition="Exists('..\..\..\marketally.aiplugin\MarketAlly.AIPlugin\MarketAlly.AIPlugin.csproj')">
|
||||
<ProjectReference Include="..\..\..\marketally.aiplugin\MarketAlly.AIPlugin\MarketAlly.AIPlugin.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup Condition="!Exists('..\..\..\marketally.aiplugin\MarketAlly.AIPlugin\MarketAlly.AIPlugin.csproj')">
|
||||
<PackageReference Include="MarketAlly.AIPlugin" Version="*" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user