Upgrade MongoDB.Driver package to V3 (#8) #12
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish NuGet Package | |
on: | |
push: | |
tags: | |
- 'v*' | |
env: | |
PROJECT_PATH: 'src/Core/MongoFlow.csproj' | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Required to get the commit hash | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
- name: Get version from tag | |
id: get_version | |
run: echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT | |
- name: Restore dependencies | |
run: dotnet restore ${{ env.PROJECT_PATH }} | |
- name: Build | |
run: dotnet build ${{ env.PROJECT_PATH }} --configuration Release --no-restore | |
- name: Run tests | |
run: dotnet test --no-restore --verbosity normal | |
- name: Pack | |
run: > | |
dotnet pack ${{ env.PROJECT_PATH }} | |
--configuration Release | |
--no-build | |
-p:PackageVersion=${{ steps.get_version.outputs.version }} | |
- name: Push to NuGet | |
run: dotnet nuget push **/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate |