Skip to content

Move transaction commit logic outside the try-finally block (#13) #22

Move transaction commit logic outside the try-finally block (#13)

Move transaction commit logic outside the try-finally block (#13) #22

Workflow file for this run

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