Skip to content

Update Nager.LongWeekend.csproj #4

Update Nager.LongWeekend.csproj

Update Nager.LongWeekend.csproj #4

Workflow file for this run

name: Build, Test & Publish
on:
push:
paths:
- 'src/**'
- '.github/workflows/**'
branches: [ main ]
pull_request:
paths:
- 'src/**'
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
working-directory: ./src
run: dotnet restore
- name: Build
working-directory: ./src
run: dotnet build --configuration Release --no-restore
- name: Test
working-directory: ./src
run: |
dotnet test --configuration Release --no-restore --no-build --verbosity normal
- name: Build project and generate NuGet package
run: |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/Nager.LongWeekend/Nager.LongWeekend.csproj
- name: Push NuGet package
if: github.event_name != 'pull_request'
run: |
cd $GITHUB_WORKSPACE/out
dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate