Skip to content

Commit 1601561

Browse files
authored
Update packaging: add SourceLink, improve metadata & docs (#82)
- Switch to Microsoft.SourceLink.GitHub for source linking; remove --include-source from dotnet pack. - Add repository/source link metadata and embed untracked sources for better debugging. - Include README.md in NuGet package and update package metadata. - Clarify and update targeted .NET versions in README.
1 parent 75d539c commit 1601561

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

.github/workflows/dotnet-core.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
run: dotnet test -c Release
4343
- name: Pack
4444
if: matrix.os == 'ubuntu-latest'
45-
run: dotnet pack -v normal -c Release --no-restore --include-symbols --include-source -p:SymbolPackageFormat=snupkg -p:PackageVersion=1.0.0-pre.$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj
45+
run: dotnet pack -v normal -c Release --no-restore --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=1.0.0-pre.$GITHUB_RUN_ID src/$PROJECT_NAME/$PROJECT_NAME.*proj
4646
- name: Upload Artifact
4747
if: matrix.os == 'ubuntu-latest'
4848
uses: actions/upload-artifact@v4
@@ -82,7 +82,7 @@ jobs:
8282
echo Version: $VERSION
8383
VERSION="${VERSION//v}"
8484
echo Clean Version: $VERSION
85-
dotnet pack -v normal -c Release --include-symbols --include-source -p:SymbolPackageFormat=snupkg -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.*proj
85+
dotnet pack -v normal -c Release --include-symbols -p:SymbolPackageFormat=snupkg -p:PackageVersion=$VERSION -o nupkg src/$PROJECT_NAME/$PROJECT_NAME.*proj
8686
- name: Publish Nuget to GitHub registry
8787
run: dotnet nuget push ./nupkg/*.nupkg -k ${GITHUB_TOKEN} -s ${GITHUB_FEED} --skip-duplicate
8888
env:

Directory.Build.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
<OverwriteReadOnlyFiles>true</OverwriteReadOnlyFiles>
3535
<RepositoryType>git</RepositoryType>
3636
<RepositoryUrl>https://github.com/synercoder/FileFormats.Pdf/</RepositoryUrl>
37+
<PackageProjectUrl>https://github.com/synercoder/FileFormats.Pdf</PackageProjectUrl>
38+
<PublishRepositoryUrl>true</PublishRepositoryUrl>
39+
<EmbedUntrackedSources>true</EmbedUntrackedSources>
3740
<RestoreSources>
3841
https://api.nuget.org/v3/index.json;
3942
</RestoreSources>

Directory.Packages.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
</RestoreSources>
1313
</PropertyGroup>
1414

15+
<ItemGroup Label="Build packages">
16+
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.102" />
17+
</ItemGroup>
18+
1519
<ItemGroup Label="General packages">
1620
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
1721
<PackageVersion Include="Synercoding.Primitives" Version="1.0.0-rc11" />

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
[nuget-badge]: https://img.shields.io/nuget/v/Synercoding.FileFormats.Pdf.svg?label=Synercoding.FileFormats.Pdf
66

77

8-
This project was created to enable PDF creation on .NETStandard 2.1, .NET 6 & .NET 7. This because multiple libraries did not suit my purpose of working on .NET Core & .NET Framework the same way. Some alternatives supported settings the different boxes (Media, Crop, Bleed & Trim) but did not fully supported images on all platforms. Others supported images but not the different boxes, and again others did not work at all on .NET Core.
8+
This project was created to enable PDF creation on .NET. Multiple libraries did not suit my purpose of working on .NET Core & .NET Framework the same way. Some alternatives supported settings the different boxes (Media, Crop, Bleed & Trim) but did not fully support images on all platforms. Others supported images but not the different boxes, and again others did not work at all on .NET Core.
99

10-
Because of those reasons this libary was created. Since then this project has evolved to keep current with the latest versions. Currently only supporting .NET 8.0 and .NET 10.0.
10+
Because of those reasons this library was created. Since then this project has evolved to keep current with the latest versions. Currently targeting .NET 8.0 and .NET 10.0.
1111

1212
## License
1313
This project is licensed under a dual license. See [LICENSE](LICENSE) for full information. It comes down to: Apache License 2.0 for small and non-profit companies, or contact me for other options.

src/Directory.Build.props

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.props" />
1111

12+
<ItemGroup>
13+
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" />
14+
</ItemGroup>
15+
1216
<PropertyGroup Condition="'$(Configuration)'=='RELEASE'">
1317
<GenerateDocumentationFile>true</GenerateDocumentationFile>
1418
</PropertyGroup>

src/Synercoding.FileFormats.Pdf/PackageDetails.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
<Title>Synercoding.FileFormats.Pdf</Title>
1212
<Description>Contains classes which makes it easy to quickly create a pdf file.</Description>
1313
<PackageReleaseNotes>Complete rewrite to add support for fonts, and with an read/edit future in mind.</PackageReleaseNotes>
14+
<PackageReadmeFile>README.md</PackageReadmeFile>
1415
</PropertyGroup>
1516

17+
<ItemGroup>
18+
<None Include="../../README.md" Pack="true" PackagePath="/" />
19+
</ItemGroup>
20+
1621
</Project>

0 commit comments

Comments
 (0)