Skip to content

Commit

Permalink
Fix NuGet packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
yugabe committed Jul 15, 2024
1 parent 29bd0ad commit a6fdc29
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v3
- run: |
dotnet build src/EmbeddedTexts -c debug
dotnet test
dotnet pack ./src/EmbeddedTexts/PodNet.EmbeddedTexts.csproj -c debug
dotnet test
- run: dotnet pack -p:Version=$(echo ${{ github.ref_name }} | sed 's/^v//') -p:RepositoryCommit=${{ github.sha }}
- run: dotnet nuget push ./artifacts/package/release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
7 changes: 3 additions & 4 deletions src/EmbeddedTexts/PodNet.EmbeddedTexts.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
<PackageId>PodNet.EmbeddedTexts</PackageId>
<Description>A simple C# code generator that allows for embedding text file content into your code.</Description>
<PackageTags>EmbeddedTexts, PodNet, generator, embedded, texts, resx, resource, awesome</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
</PropertyGroup>

<ItemGroup>
<InternalsVisibleTo Include="PodNet.EmbeddedTexts.Tests" />
<PackageReference Include="PodNet.Analyzers.Core" Version="1.0.9" PrivateAssets="all" />

<PackageReference Include="PodNet.Analyzers.Core" Version="1.0.10" PrivateAssets="all" />
<PackageReference Include="PodNet.NuGet.Core" Version="1.0.4" PrivateAssets="all" />

<Content Include="build/*" PackagePath="build" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,17 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RestoreAdditionalProjectSources>$(ArtifactsPath)/package</RestoreAdditionalProjectSources>
<PodNetEnableAnalyzerConfigSnapshot>true</PodNetEnableAnalyzerConfigSnapshot>
<RestoreAdditionalProjectSources>$(ArtifactsPath)\package</RestoreAdditionalProjectSources>
</PropertyGroup>

<Target Name="PackEmbeddedTexts" BeforeTargets="Restore; Compile; Test">
<MSBuild Projects="..\..\src\EmbeddedTexts\PodNet.EmbeddedTexts.csproj" Targets="Pack" />
</Target>

<ItemGroup>

<PackageReference Include="MSTest" Version="3.4.3" />

<PackageReference Include="PodNet.Analyzers.ConfigSnapshotGenerator" Version="1.0.3" />

<PackageReference Include="PodNet.Analyzers.Testing" Version="1.0.3" />

<ProjectReference Include="..\..\src\EmbeddedTexts\PodNet.EmbeddedTexts.csproj" ReferenceOutputAssembly="false" />

<!-- Take note that the NuGet package has to be packed before the integration tests are executed. -->
<!-- Take care to empty the package from the local and global caches as needed. -->
<PackageReference Include="PodNet.EmbeddedTexts" Version="[0.0.0-debug]" />

<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
Expand All @@ -30,7 +25,7 @@
<AdditionalFiles Update="Files\CustomNamespace.txt" PodNet_EmbedTextNamespace="TestNamespace.TestSubNamespace" />
<AdditionalFiles Update="Files\CustomClassAndNamespace.txt" PodNet_EmbedTextNamespace="TestNamespace.TestSubNamespace" PodNet_EmbedTextClassName="TestClass" />
<AdditionalFiles Update="Files\Ignored\Unignored.txt" PodNet_EmbedText="true" />

</ItemGroup>

</Project>

0 comments on commit a6fdc29

Please sign in to comment.