Skip to content

Update dotnetcore.yml #469

Update dotnetcore.yml

Update dotnetcore.yml #469

Workflow file for this run

name: .NET Core build
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [published]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4.2.2
- name: Setup .NET Core
uses: actions/setup-dotnet@v4.3.1
with:
dotnet-version: 3.1.101
- name: Install dependencies
working-directory: ./PreMailer.Net
run: dotnet restore
- name: Build
working-directory: ./PreMailer.Net
run: dotnet build --configuration Release --no-restore
- name: Test
working-directory: ./PreMailer.Net
run: dotnet test --no-restore --verbosity normal --collect "Code coverage"
- name: Package
if: ${{ github.event_name == 'release' }}
run: dotnet pack -c Release -o . PreMailer.Net/PreMailer.Net/PreMailer.Net.csproj
- name: Publish
if: ${{ github.event_name == 'release' }}
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_APIKEY }} -s https://api.nuget.org/v3/index.json