Skip to content

Commit

Permalink
Initial enricher
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesmols committed Jan 16, 2023
1 parent 81b87e6 commit 16ab097
Show file tree
Hide file tree
Showing 11 changed files with 1,208 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Deploy project to NuGet"

on:
push:
tags:
- 'v*'

env:
PROJECT_PATH: 'Serilog.Enrichers.pm4net/Serilog.Enrichers.pm4net.csproj'
PACKAGE_OUTPUT_DIRECTORY: ${{ github.workspace }}\output
NUGET_SOURCE_URL: 'https://api.nuget.org/v3/index.json'

jobs:
deploy:
name: 'Deploy'
runs-on: 'windows-latest'
steps:
- name: 'Checkout'
uses: actions/checkout@v2

- name: 'Restore packages'
run: dotnet restore ${{ env.PROJECT_PATH }}

- name: 'Build project'
run: dotnet build ${{ env.PROJECT_PATH }} --no-restore

- name: 'Get Version'
id: version
uses: battila7/get-version-action@v2

- name: 'Pack project'
run: dotnet pack ${{ env.PROJECT_PATH }} --no-restore --no-build --include-symbols -p:PackageVersion=${{ steps.version.outputs.version-without-v }} --output ${{ env.PACKAGE_OUTPUT_DIRECTORY }}

- name: 'Push package'
run: dotnet nuget push ${{ env.PACKAGE_OUTPUT_DIRECTORY }}\*.nupkg -k ${{ secrets.NUGET_AUTH_TOKEN }} -s ${{ env.NUGET_SOURCE_URL }} --skip-duplicate
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "Build and Run Tests"

on:
push:
pull_request:
branches: [ master ]
paths-ignore:
- '**/README.md'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['6.0.x']
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
- name: Install dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release
- name: Test
run: dotnet test --no-restore --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
- name: Upload dotnet test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results-${{ matrix.dotnet-version }}
path: TestResults-${{ matrix.dotnet-version }}
# Use always() to always run this step to publish test results when there are test failures
if: ${{ always() }}
Loading

0 comments on commit 16ab097

Please sign in to comment.