Merge pull request #8 from thiagocorreanet/feature/change-tests #30
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 and Publish NuGet Package | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build project | |
run: dotnet build --configuration Release --no-restore | |
- name: List all project files | |
run: ls -R | |
- name: Run unit tests | |
run: dotnet test ./Maskfy.Core.Tests/Maskify.Core.Tests.csproj --collect "XPlat Code Coverage" | |
- name: Pack project | |
run: dotnet pack --configuration Release --no-build -o ./nupkg | |
- name: Push NuGet package | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
run: dotnet nuget push ./nupkg/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json |