version increased #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@v3 | |
- name: Setup .NET 8.0 | |
uses: actions/setup-dotnet@v3 | |
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: Create NuGet packages | |
run: | | |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/Nager.Authentication/Nager.Authentication.csproj | |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/Nager.Authentication.Abstraction/Nager.Authentication.Abstraction.csproj | |
dotnet pack --configuration Release --output $GITHUB_WORKSPACE/out src/Nager.Authentication.AspNet/Nager.Authentication.AspNet.csproj | |
- name: Push NuGet packages | |
if: github.event_name != 'pull_request' | |
run: | | |
cd $GITHUB_WORKSPACE/out | |
dotnet nuget push *.nupkg --source https://www.nuget.org/api/v2/package --api-key ${{secrets.NUGET_TOKEN}} --skip-duplicate --no-symbols |