diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..835b438 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +name: Publish to Nuget + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 7.0.x + - name: Build + run: dotnet build Ardalis.SharedKernel.sln --configuration Release + - name: Test + run: dotnet test Ardalis.SharedKernel.sln --configuration Release --no-build --no-restore + - name: Pack + run: dotnet pack Ardalis.SharedKernel.sln --configuration Release --no-build --no-restore --output . + - name: Push to NuGet + run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json