Skip to content

Commit

Permalink
[net]build(nuget): add MinVer for package versioning (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisInSky authored Dec 13, 2024
1 parent e60ec6a commit 9b38d2d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 5 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/net-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # for MinVer
filter: tree:0 # for MinVer

- name: Download Native Libraries
uses: actions/download-artifact@v4
Expand All @@ -158,13 +161,9 @@ jobs:
- name: Pack NuGet Packages
run: |
dotnet pack ./net/src/Sails.Net/Sails.Net.csproj --no-build --configuration Release --output ./nugets \
-p:Version=${{ needs.prepare.outputs.r_version }} \
-p:PackageVersion=${{ needs.prepare.outputs.r_version }} \
-p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} \
-p:Authors=Gear
dotnet pack ./net/src/Sails.ClientGenerator/Sails.ClientGenerator.csproj --no-build --configuration Release --output ./nugets \
-p:Version=${{ needs.prepare.outputs.r_version }} \
-p:PackageVersion=${{ needs.prepare.outputs.r_version }} \
-p:RepositoryUrl=${{ github.server_url }}/${{ github.repository }} \
-p:Authors=Gear
Expand Down
2 changes: 2 additions & 0 deletions net/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,7 @@
<!-- Examples -->
<PackageVersion Include="Sails.ClientGenerator" Version="$(SailsPackagesVersion)" />
<PackageVersion Include="Sails.Net" Version="$(SailsPackagesVersion)" />
<!-- Build -->
<PackageVersion Include="MinVer" Version="6.0.0" />
</ItemGroup>
</Project>
8 changes: 8 additions & 0 deletions net/src/Sails.ClientGenerator/Sails.ClientGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
<PackageTags>Sails, Vara, Gear, Substrate</PackageTags>
<MinVerTagPrefix>net/v</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis" />
<PackageReference Include="PolySharp" />
Expand Down
10 changes: 9 additions & 1 deletion net/src/Sails.Net/Sails.Net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>MIT OR Apache-2.0</PackageLicenseExpression>
<PackageTags>Sails, Vara, Gear, Substrate</PackageTags>
<MinVerTagPrefix>net/v</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<None Include="README.md" Pack="true" PackagePath="\" />
<None Include="README.md" Pack="true" PackagePath="/" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Substrate.Gear.Api -->
Expand Down

0 comments on commit 9b38d2d

Please sign in to comment.