Skip to content

Commit

Permalink
Determine assembly, nuget versions based on git tags. (#366)
Browse files Browse the repository at this point in the history
* Use MinVer for assembly, nuget versioning based on git tags.
* restricting nuget push on certain tags
  • Loading branch information
amanbha authored Aug 10, 2020
1 parent 845a982 commit 3b5065f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/sdk_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:
--prerelease true \
${RELEASE_ARTIFACT[*]}
- name: Publish nuget packages to nuget.org
if: startswith(github.ref, 'refs/tags/v')
if: startswith(github.ref, 'refs/tags/v') && !(endsWith(github.ref, '-rc') || endsWith(github.ref, '-dev') || endsWith(github.ref, '-prerelease'))
run: |
dotnet nuget push ${{ env.NUPKG_OUTDIR }}/DApr*.nupkg --skip-duplicate --api-key ${{ secrets.NUGETORG_DAPR_API_KEY }} --source https://api.nuget.org/v3/index.json
dotnet nuget push ${{ env.NUPKG_OUTDIR }}/Dapr*.nupkg --skip-duplicate --api-key ${{ secrets.NUGETORG_DAPR_API_KEY }} --source https://api.nuget.org/v3/index.json
18 changes: 0 additions & 18 deletions properties/dapr_common.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,5 @@
<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)..\</RepoRoot>
<RequestedVerbosity Condition=" '$(RequestedVerbosity)' == '' ">minimal</RequestedVerbosity>

<!-- Version for binaries, nuget packages generated from this repo. -->
<MajorVersion>1</MajorVersion>
<MinorVersion>0</MinorVersion>
<BuildVersion>0</BuildVersion>
<Revision>0</Revision>
<Version>$(MajorVersion).$(MinorVersion).$(BuildVersion).$(Revision)</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<AssemblyFileVersion>$(Version)</AssemblyFileVersion>
<FileVersion>$(Version)</FileVersion>

<!-- Nuget package versions -->
<NupkgMajorVersion>0</NupkgMajorVersion>
<NupkgMinorVersion>10</NupkgMinorVersion>
<NupkgPatchVersion>0</NupkgPatchVersion>
<NupkgPreviewTag>-preview01</NupkgPreviewTag>
<NupkgVersion>$(NupkgMajorVersion).$(NupkgMinorVersion).$(NupkgPatchVersion)$(NupkgPreviewTag)</NupkgVersion>
</PropertyGroup>

</Project>
14 changes: 14 additions & 0 deletions properties/dapr_managed_netcore.props
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,18 @@
<DefineConstants>$(DefineConstants);DotNetCoreClr</DefineConstants>
</PropertyGroup>

<!-- Use MinVer for assembly, nuget versioning based on git tags -->
<ItemGroup>
<PackageReference Include="MinVer" Version="2.3.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<!-- Configure properties for MinVer -->
<PropertyGroup>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerDefaultPreReleasePhase>preview</MinVerDefaultPreReleasePhase>
<!-- <MinVerVerbosity>detailed</MinVerVerbosity>-->
</PropertyGroup>
</Project>
1 change: 0 additions & 1 deletion properties/dapr_nuget.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project>
<!-- Nuget package properties when packed using dotnet pack. -->
<PropertyGroup>
<PackageVersion>$(NupkgVersion)</PackageVersion>
<Authors>dapr.io</Authors>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down

0 comments on commit 3b5065f

Please sign in to comment.