Skip to content

Add PollySignalR to Related packages table #35

Add PollySignalR to Related packages table

Add PollySignalR to Related packages table #35

Workflow file for this run

name: CI
on:
push:
branches: [ main, master ]
tags: [ 'v*' ]
pull_request:
branches: [ main, master ]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_NOLOGO: true
jobs:
build:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=results.trx" --results-directory ./test-results
- name: Publish test results
uses: dorny/test-reporter@v1
if: always()
with:
name: Test Results
path: test-results/*.trx
reporter: dotnet-trx
pack:
name: Pack & Publish
runs-on: ubuntu-latest
needs: build
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.x
- name: Restore
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Determine version
id: version
run: |
if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then
VERSION="${GITHUB_REF#refs/tags/v}"
else
VERSION="0.0.0-ci.${GITHUB_RUN_NUMBER}"
fi
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Pack
run: >
dotnet pack src/PollyBackoff/PollyBackoff.csproj
--configuration Release
--no-build
--output nupkgs
/p:Version=${{ steps.version.outputs.version }}
- name: Upload package artifact
uses: actions/upload-artifact@v4
with:
name: nuget-package
path: nupkgs/*.nupkg
retention-days: 30
- name: Publish to NuGet.org
if: startsWith(github.ref, 'refs/tags/v')
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
if [ -z "$NUGET_API_KEY" ]; then
echo "::warning::NUGET_API_KEY secret is not set - skipping publish"
exit 0
fi
dotnet nuget push nupkgs/*.nupkg \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate