Skip to content

FOSSA Scan - Do Not Merge #108

FOSSA Scan - Do Not Merge

FOSSA Scan - Do Not Merge #108

Workflow file for this run

name: New Relic Log Enrichers for .NET
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags:
- refs/tags/v*.*.* # v1.0.0
- refs/tags/v*.*.*-* # v1.0.0-alpha
- refs/tags/*_v*.*.* # SomePrefix_v1.0.0
- refs/tags/*_v*.*.*-* # SomePrefix_v1.0.0-alpha
workflow_dispatch: # Allows team members to manually kick off a build
jobs:
build-test:
name: Build Test Deploy
runs-on: windows-2022
env:
artifact_staging_path: ${{ github.workspace }}\artifactstaging
solution_file_path: ${{ github.workspace }}\NewRelic.LogEnrichers.sln
log4net_path: ${{ github.workspace }}\src\NewRelic.LogEnrichers.Log4Net\bin\Release\
nlog_path: ${{ github.workspace }}\src\NewRelic.LogEnrichers.NLog\bin\Release\
serilog_path: ${{ github.workspace }}\src\NewRelic.LogEnrichers.Serilog\bin\Release\
DOTNET_NOLOGO: true
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Setup Nuget Add to Path
uses: nuget/setup-nuget@v1
with:
nuget-version: '5.x'
- name: Restore
run: dotnet restore ${{ env.solution_file_path }}
shell: powershell
- name: Build
run: dotnet build ${{ env.solution_file_path }} --configuration Release
shell: powershell
- name: Unit Tests - Log4Net
run: dotnet test ${{ github.workspace }}\tests\NewRelic.LogEnrichers.Log4Net.Tests --no-build --no-restore --configuration Release --logger trx
shell: powershell
- name: Unit Tests - NLog
run: dotnet test ${{ github.workspace }}\tests\NewRelic.LogEnrichers.NLog.Tests --no-build --no-restore --configuration Release --logger trx
shell: powershell
- name: Unit Tests - Serilog
run: dotnet test ${{ github.workspace }}\tests\NewRelic.LogEnrichers.Serilog.Tests --no-build --no-restore --configuration Release --logger trx
shell: powershell
- name: Archive the artifacts
uses: actions/upload-artifact@v2
with:
name: my-artifact-${{ github.run_id }}
path: |
${{ env.log4net_path }}
${{ env.nlog_path }}
${{ env.serilog_path }}
# This step will only run on a build of master or a tag is created.
- name: Publish Packages to MyGet
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags') }}
run: |
foreach ($file in Get-ChildItem -Path "${{ env.log4net_path }}\*" -File -Include *.nupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v2/package -NoSymbols }
foreach ($file in Get-ChildItem -Path "${{ env.nlog_path }}\*" -File -Include *.nupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v2/package -NoSymbols }
foreach ($file in Get-ChildItem -Path "${{ env.serilog_path }}\*" -File -Include *.nupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v2/package -NoSymbols }
foreach ($file in Get-ChildItem -Path "${{ env.log4net_path }}\*" -File -Include *.snupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v3/index.json }
foreach ($file in Get-ChildItem -Path "${{ env.nlog_path }}\*" -File -Include *.snupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v3/index.json }
foreach ($file in Get-ChildItem -Path "${{ env.serilog_path }}\*" -File -Include *.snupkg) {
nuget push $file.fullname -ApiKey ${{ secrets.MYGET_APIKEY }} -Source https://www.myget.org/F/newrelic/api/v3/index.json }
shell: powershell