Updated the csproj file. #12
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 & Deploy | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
buildAndPack: | |
name: build, test & pack | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v2 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore | |
- name: Test | |
run: dotnet test --no-build --verbosity normal | |
- name: Create Nuget package | |
run: dotnet pack -c Release -o output | |
- name: Create artifact of the package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: filevalidator | |
path: output/*.nupkg | |
deploynugetpackage: | |
name: deploy to nuget | |
runs-on: ubuntu-latest | |
needs: buildAndPack | |
steps: | |
- name: Download the artifact | |
uses: actions/download-artifact@v3 | |
with: | |
name: filevalidator | |
- name: Display the downloaded file | |
run: ls -R | |
- name: Push package | |
run: dotnet nuget push *.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate --no-symbols |