Skip to content

Commit

Permalink
Automate publishing to NuGet.org
Browse files Browse the repository at this point in the history
- Include README in package
  • Loading branch information
flcdrg committed Mar 30, 2022
1 parent 6acf70b commit 270c4c4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ jobs:
run: dotnet nuget push "Verify.MongoDB/bin/Release/*.nupkg" --source ${{ env.source-url }} -k ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/main'

- name: Publish the package to nuget.org
run: dotnet nuget push "Verify.MongoDB/bin/Release/*.nupkg" --source https://api.nuget.org/v3/index.json -k $NUGET_AUTH_TOKEN
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_API_KEY }}

- name: Build logs
uses: actions/upload-artifact@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Verify.MongoDB

[![.NET](https://github.com/flcdrg/Verify.MongoDB/actions/workflows/dotnet.yml/badge.svg)](https://github.com/flcdrg/Verify.MongoDB/actions/workflows/dotnet.yml)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.MongoDB.svg?label=Verify.MongoDB)](https://www.nuget.org/packages/Verify.MongoDB/)

Extends [Verify](https://github.com/VerifyTests/Verify) to allow verification of MongoDB bits.

Expand Down Expand Up @@ -36,7 +37,7 @@ clientSettings.EnableRecording(MongoDbEvents.Succeeded | MongoDbEvents.Failed);

### Usage

To start recording call `MongoDbRecording.StartRecording()`. The results will be automatically included in verified file.
To start recording call `MongoDbRecording.StartRecording()`. The results will be automatically included in the verified file.

```csharp
MongoDBRecording.StartRecording();
Expand Down
7 changes: 6 additions & 1 deletion Verify.MongoDB/Verify.MongoDB.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
<DebugType>embedded</DebugType>
<Authors>https://github.com/flcdrg/Verify.MongoDB/graphs/contributors</Authors>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>

<PackageReadmeFile>README.md</PackageReadmeFile>

<!-- SourceLink -->
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
Expand All @@ -23,4 +24,8 @@
<PackageReference Include="Verify" Version="14.14.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" />
</ItemGroup>

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

0 comments on commit 270c4c4

Please sign in to comment.