Skip to content

Enable Nullable (#4) #8

Enable Nullable (#4)

Enable Nullable (#4) #8

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: Publish Package to NuGet
on:
push:
branches:
- master
paths:
- 'Collections.Pooled/**'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-publish:
runs-on: ubuntu-latest
environment: production
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Get version info
uses: dotnet/nbgv@master
id: nbgv
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5
with:
dotnet-version: "10.0.x"
- name: Run Tests
run: dotnet test ./Collections.Pooled.Tests/Collections.Pooled.Tests.csproj
- name: Pack NuGet (Release)
run: |
dotnet pack Collections.Pooled/Collections.Pooled.csproj \
-c Release \
-p:ContinuousIntegrationBuild=true \
-p:Version=${{ steps.nbgv.outputs.NuGetPackageVersion }} \
-p:AssemblyVersion=${{ steps.nbgv.outputs.AssemblyVersion }} \
-p:FileVersion=${{ steps.nbgv.outputs.AssemblyFileVersion }} \
-o artifacts
- name: NuGet login
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: NuGet Push
run: dotnet nuget push artifacts/*.nupkg --api-key ${{steps.login.outputs.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json