Skip to content

Commit

Permalink
Fix NuGet MSBuild project (finally)
Browse files Browse the repository at this point in the history
  • Loading branch information
Popax21 committed Apr 22, 2024
1 parent 113fb92 commit a4de388
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
merge-multiple: true

- name: Pack NuGet package
run: dotnet msbuild -p:TreatWarningsAsErrors=true -p:PitonAppHostBinDir=apphost-bin -p:OutputPath=out Piton.NuGet.proj
run: dotnet pack -p:TreatWarningsAsErrors=true -p:PitonAppHostBinDir=apphost-bin --output out Piton.NuGet.proj

- uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 6 additions & 4 deletions Piton.NuGet.proj
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@
</ItemGroup>

<!-- Build + Include custom MSBuild tasks -->
<ItemGroup>
<ProjectReference Include="msbuild/Piton.Tasks.csproj" />
</ItemGroup>

<Target Name="PackTasksAssembly" BeforeTargets="Build">
<!-- Build the MSBuild tasks assembly -->
<MSBuild Projects="msbuild/Piton.Tasks.csproj" Properties="Configuration=$(Configuration)">
<!-- Include it in the packaged .nupkg -->
<MSBuild Projects="msbuild/Piton.Tasks.csproj" Targets="GetTargetPath" Properties="Configuration=$(Configuration)">
<Output TaskParameter="TargetOutputs" ItemName="PitonTasksAssembly" />
</MSBuild>

<!-- Include it in the packaged .nupkg -->
<ItemGroup>
<Content Include="@(PitonTasksAssembly)" PackagePath="tasks" />
</ItemGroup>
Expand Down

0 comments on commit a4de388

Please sign in to comment.