Skip to content

docs(release): sync the 1.8.0 docs with the completed release blockers #1

docs(release): sync the 1.8.0 docs with the completed release blockers

docs(release): sync the 1.8.0 docs with the completed release blockers #1

Workflow file for this run

name: Publish NuGet packages
on:
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
jobs:
build-test-pack:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore SafeWebCore.slnx
- name: Build
run: dotnet build SafeWebCore.slnx --configuration Release --no-restore
- name: Test
run: dotnet test SafeWebCore.slnx --configuration Release --no-build
- name: Pack core package
run: dotnet pack src/SafeWebCore/SafeWebCore.csproj --configuration Release --no-build --output artifacts/nuget
- name: Pack companion packages
run: |
dotnet pack src/SafeWebCore.Analyzers/SafeWebCore.Analyzers.csproj --configuration Release --no-build --output artifacts/nuget || echo "Analyzers pack skipped"
dotnet pack src/SafeWebCore.Testing/SafeWebCore.Testing.csproj --configuration Release --no-build --output artifacts/nuget || echo "Testing pack skipped"
dotnet pack src/SafeWebCore.FraudDetection/SafeWebCore.FraudDetection.csproj --configuration Release --no-build --output artifacts/nuget || echo "FraudDetection pack skipped"
dotnet pack src/SafeWebCore.JwtBearer/SafeWebCore.JwtBearer.csproj --configuration Release --no-build --output artifacts/nuget || echo "JwtBearer pack skipped"
- name: Upload NuGet artifacts
uses: actions/upload-artifact@v7
with:
name: nuget-packages
path: |
artifacts/nuget/*.nupkg
artifacts/nuget/*.snupkg
- 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 NuGet publish."
exit 0
fi
dotnet nuget push "artifacts/nuget/*.nupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
if ls artifacts/nuget/*.snupkg >/dev/null 2>&1; then
dotnet nuget push "artifacts/nuget/*.snupkg" \
--api-key "$NUGET_API_KEY" \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
else
echo "::notice::No .snupkg symbol package was produced."
fi