Publish NuGet Packages #1
This file contains hidden or 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 Packages | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' # Trigger on version tags like v1.0.0 | |
| workflow_dispatch: # Allow manual triggering | |
| env: | |
| DOTNET_VERSION: '10.0.x' # Use .NET 10.0 for building | |
| jobs: | |
| build-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: ${{ env.DOTNET_VERSION }} | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build solution | |
| run: dotnet build --configuration Release --no-restore | |
| - name: Run tests | |
| run: dotnet test --configuration Release --no-build --verbosity normal | |
| - name: Pack NuGet packages | |
| run: dotnet pack --configuration Release --no-build --output ./nupkgs | |
| - name: Publish Dapper.Unnest package to NuGet | |
| run: dotnet nuget push "./nupkgs/Dapper.Unnest.*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate | |
| - name: Create GitHub Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| body: | | |
| ## What's Changed | |
| ### NuGet Package | |
| - `Dapper.Unnest` - Complete package with attributes and source generator | |
| ### Installation | |
| ```bash | |
| dotnet add package Dapper.Unnest | |
| ``` | |
| ### Documentation | |
| See [README.md](https://github.com/abakumovoleg/dapper.unnested/blob/main/README.md) for usage instructions. | |
| draft: false | |
| prerelease: false |