Skip to content

docs: add GitHub Sponsors FUNDING.yml and consulting CTA #7

docs: add GitHub Sponsors FUNDING.yml and consulting CTA

docs: add GitHub Sponsors FUNDING.yml and consulting CTA #7

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/PollyRateLimiter/PollyRateLimiter.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')
run: >
dotnet nuget push nupkgs/*.nupkg
--api-key ${{ secrets.NUGET_API_KEY }}
--source https://api.nuget.org/v3/index.json
--skip-duplicate