Added unit-tests, changed folder structure #10
This file contains hidden or 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: Publish Packages | |
on: | |
pull_request: | |
branches: [master] | |
types: [closed] | |
jobs: | |
build-publish: | |
if: github.event.pull_request.merged == true | |
runs-on: ubuntu-latest | |
env: | |
SOLUTION_FILE: Mediator.Lite.sln | |
PROJECT_PATH: ./src/Mediator.Lite/Mediator.Lite.csproj | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.* | |
- name: Install dependencies | |
run: dotnet restore ${{ env.SOLUTION_FILE }} | |
- name: Build | |
run: | | |
dotnet build ${{ env.SOLUTION_FILE }} \ | |
--configuration Release \ | |
--no-restore | |
- name: Test | |
run: | | |
dotnet test ${{ env.SOLUTION_FILE }} \ | |
--configuration Release \ | |
--no-build \ | |
--no-restore \ | |
--verbosity normal | |
- name: Pack | |
run: | | |
mkdir nupkgs | |
dotnet pack ${{ env.PROJECT_PATH }} \ | |
--configuration Release \ | |
--no-build \ | |
--output ./nupkgs | |
- name: Push | |
run: | | |
dotnet nuget push "./nupkgs/*.nupkg" \ | |
--api-key ${{ secrets.NUGET_API_KEY }} \ | |
--source https://api.nuget.org/v3/index.json |