Skip to content

.NET 10, new samples in favor of old ones, nuget updated, newest elma… #64

.NET 10, new samples in favor of old ones, nuget updated, newest elma…

.NET 10, new samples in favor of old ones, nuget updated, newest elma… #64

Workflow file for this run

name: build
on:
push:
branches: [ main, apiv4 ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-2025
steps:
- uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Install dependencies
run: dotnet restore
- name: Check for vulnerable packages
shell: bash
run: |
set -e # This will cause the script to exit on the first error
OUTPUT=$(dotnet list src/Elmah.Io.NLog/Elmah.Io.Nlog.csproj package --vulnerable)
echo "$OUTPUT"
if echo "$OUTPUT" | grep -q 'no vulnerable packages'; then
echo "No vulnerable packages found"
else
if echo "$OUTPUT" | grep -q 'vulnerable'; then
echo "Vulnerable packages found"
exit 1
fi
fi
- name: Build
run: dotnet build --configuration Release --no-restore
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Pack
run: dotnet pack --configuration Release src/Elmah.Io.NLog/Elmah.Io.Nlog.csproj /p:Version=6.0.${{ github.run_number }}-pre
- name: Install dotnet-validate
run: dotnet tool install --global dotnet-validate --version 0.0.1-preview.537
- name: Validate
run: dotnet-validate package local src/Elmah.Io.NLog/bin/Release/Elmah.Io.NLog.6.0.${{ github.run_number }}-pre.nupkg
- name: Push
run: dotnet nuget push src/Elmah.Io.NLog/bin/Release/Elmah.Io.NLog.6.0.${{ github.run_number }}-pre.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
if: ${{ github.event_name == 'push' }}
# - name: Refresh Bugster
# shell: pwsh
# env:
# FUNCTION_APP_URL: ${{ secrets.FUNCTION_APP_URL }}
# run: |
# $repoName = ($env:GITHUB_REPOSITORY -split '/')[1]
# $json = @{ repository = 'Elmah.Io.NLog' } | ConvertTo-Json -Compress
# curl --fail-with-body -X POST `
# -H "Content-Type: application/json" `
# -d "$json" `
# $env:FUNCTION_APP_URL
# if: ${{ github.event_name == 'push' }}