Skip to content

Merge branch 'main' of https://github.com/djesusnet/Maskify.Core.Libray #28

Merge branch 'main' of https://github.com/djesusnet/Maskify.Core.Libray

Merge branch 'main' of https://github.com/djesusnet/Maskify.Core.Libray #28

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