Skip to content

Commit

Permalink
Modernized build with GitHub actions (#13)
Browse files Browse the repository at this point in the history
* Modernized build with GitHub actions

* Fixed xplat builds

* Update deps

* Fixed build errors

* Changed license file extension so dotnet pack works

* skip packaging
  • Loading branch information
niemyjski authored Nov 4, 2021
1 parent ee28d4a commit a0319f8
Show file tree
Hide file tree
Showing 14 changed files with 178 additions and 95 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build Linux
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.x
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
- name: Build Version
shell: bash
run: |
dotnet tool install --global minver-cli --version 2.5.0
version=$(minver --tag-prefix v)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release Serilog.Sinks.Exceptionless.sln
- name: Run Tests
run: dotnet test --configuration Release --no-build Serilog.Sinks.Exceptionless.sln
28 changes: 28 additions & 0 deletions .github/workflows/build-osx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build OSX
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: macOS-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.x
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
- name: Build Version
shell: bash
run: |
dotnet tool install --global minver-cli --version 2.5.0
version=$(minver --tag-prefix v)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release Serilog.Sinks.Exceptionless.sln
- name: Run Tests
run: dotnet test --configuration Release --no-build Serilog.Sinks.Exceptionless.sln
52 changes: 52 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Windows
on: [push, pull_request]
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.x
- name: Build Reason
run: "echo ref: ${{github.ref}} event: ${{github.event_name}}"
- name: Build Version
shell: bash
run: |
dotnet tool install --global minver-cli --version 2.5.0
version=$(minver --tag-prefix v)
echo "MINVERVERSIONOVERRIDE=$version" >> $GITHUB_ENV
- name: Build
run: dotnet build --configuration Release Serilog.Sinks.Exceptionless.sln
- name: Run Tests
run: dotnet test --configuration Release --no-build Serilog.Sinks.Exceptionless.sln
- name: Package
if: github.event_name != 'pull_request'
run: dotnet pack --configuration Release --no-build Serilog.Sinks.Exceptionless.sln
- name: Install GitHub Package Tool
if: github.event_name != 'pull_request'
run: dotnet tool install gpr -g
- name: Publish CI Packages
shell: bash
if: github.event_name != 'pull_request'
run: |
for package in $(find -name "*.nupkg" | grep "minver" -v); do
echo "${0##*/}": Pushing $package...
# GitHub
gpr push $package -k ${{ secrets.GITHUB_TOKEN }} || true
done
- name: Publish Release Packages
shell: bash
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg" | grep "minver" -v); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_KEY }} --skip-duplicate
done
33 changes: 0 additions & 33 deletions Build.ps1

This file was deleted.

7 changes: 0 additions & 7 deletions CHANGES.md

This file was deleted.

File renamed without changes.
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# Serilog.Sinks.Exceptionless

[![Build status](https://ci.appveyor.com/api/projects/status/bvmfe8muijhgkb9j?svg=true)](https://ci.appveyor.com/project/serilog/serilog-sinks-exceptionless)
[![Build Windows](https://github.com/exceptionless/serilog-sinks-exceptionless/workflows/Build%20Windows/badge.svg?branch=master)](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[![Build OSX](https://github.com/exceptionless/serilog-sinks-exceptionless/workflows/Build%20OSX/badge.svg)](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[![Build Linux](https://github.com/exceptionless/serilog-sinks-exceptionless/workflows/Build%20Linux/badge.svg)](https://github.com/Exceptionless/serilog-sinks-exceptionless/actions)
[![NuGet Version](http://img.shields.io/nuget/v/Serilog.Sinks.Exceptionless.svg?style=flat)](https://www.nuget.org/packages/Serilog.Sinks.Exceptionless/)


### Getting started
## Getting started

To use the Exceptionless sink, first install the [NuGet package](https://www.nuget.org/packages/Serilog.Sinks.Exceptionless/):

```powershell
Install-Package Serilog.Sinks.Exceptionless
```
```

Next, we need to ensure that Exceptionless is configured with an API Key. If you are
already using Exceptionless you can skip this step.

The Exceptionless sink will use the default `ExceptionlessClient` client instance. This ensures
that all of your Exceptionless configuration is shared with the sink and also enables logging
of unhandled exceptions to Exceptionless.
of unhandled exceptions to Exceptionless.

> For advanced users who wish to configure the sink to use custom `ExceptionlessClient` instance
> For advanced users who wish to configure the sink to use custom `ExceptionlessClient` instance
> you can provide an API Key or `ExceptionlessClient` instance to `WriteTo.Exceptionless()`.
```csharp
Expand Down
16 changes: 10 additions & 6 deletions Serilog.Sinks.Exceptionless.sln
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.6
# Visual Studio Version 17
VisualStudioVersion = 17.0.31825.309
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5E1-DEB9-4A04-8BAB-24EC7240ADAF}"
ProjectSection(SolutionItems) = preProject
appveyor.yml = appveyor.yml
Build.ps1 = Build.ps1
.github\workflows\build-linux.yml = .github\workflows\build-linux.yml
.github\workflows\build-osx.yml = .github\workflows\build-osx.yml
.github\workflows\build-windows.yml = .github\workflows\build-windows.yml
README.md = README.md
assets\Serilog.snk = assets\Serilog.snk
EndProjectSection
Expand All @@ -17,9 +18,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Serilog.Sinks.Exceptionless
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "sample", "sample", "{C63B899E-A823-48E4-B29D-A26014911A9D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleDemo", "sample\ConsoleDemo\ConsoleDemo.csproj", "{411E131D-34F5-4B51-A217-B4FD6E2E01B4}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleDemo", "sample\ConsoleDemo\ConsoleDemo.csproj", "{411E131D-34F5-4B51-A217-B4FD6E2E01B4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleWeb", "sample\SampleWeb\SampleWeb.csproj", "{2637C70D-5166-473F-91FD-C5312310466D}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleWeb", "sample\SampleWeb\SampleWeb.csproj", "{2637C70D-5166-473F-91FD-C5312310466D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -48,4 +49,7 @@ Global
{411E131D-34F5-4B51-A217-B4FD6E2E01B4} = {C63B899E-A823-48E4-B29D-A26014911A9D}
{2637C70D-5166-473F-91FD-C5312310466D} = {C63B899E-A823-48E4-B29D-A26014911A9D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06A5E1C8-641C-4535-8C60-7DE51819B7B1}
EndGlobalSection
EndGlobal
23 changes: 0 additions & 23 deletions appveyor.yml

This file was deleted.

Binary file added assets/serilog-sink-nuget.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions sample/ConsoleDemo/ConsoleDemo.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net452;net50</TargetFrameworks>
<TargetFrameworks>net50</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Exceptionless\Serilog.Sinks.Exceptionless.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0" />
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions sample/SampleWeb/SampleWeb.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Exceptionless.AspNetCore" Version="4.6.2" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Serilog.Sinks.Exceptionless\Serilog.Sinks.Exceptionless.csproj" />
</ItemGroup>
Expand Down
1 change: 0 additions & 1 deletion src/Serilog.Sinks.Exceptionless/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Reflection;

[assembly: CLSCompliant(true)]
61 changes: 46 additions & 15 deletions src/Serilog.Sinks.Exceptionless/Serilog.Sinks.Exceptionless.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,53 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Authors>Serilog Contributors,Exceptionless</Authors>
<Description>Exceptionless sink for Serilog</Description>
<VersionPrefix>3.1.4</VersionPrefix>
<Authors>Serilog Contributors</Authors>
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<AssemblyName>Serilog.Sinks.Exceptionless</AssemblyName>

<MinVerSkip Condition="'$(Configuration)' == 'Debug'">true</MinVerSkip>
<MinVerTagPrefix>v</MinVerTagPrefix>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>Serilog.Sinks.Exceptionless</AssemblyName>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>

<PackageId>Serilog.Sinks.Exceptionless</PackageId>
<PackageTags>serilog;Exceptionless;logging</PackageTags>
<PackageReleaseNotes>https://github.com/serilog/serilog-sinks-exceptionless/releases</PackageReleaseNotes>
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl>
<PackageProjectUrl>http://serilog.net</PackageProjectUrl>
<PackageLicenseUrl>http://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl>
<PackageReleaseNotes>https://github.com/exceptionless/serilog-sinks-exceptionless/releases</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/exceptionless/serilog-sinks-exceptionless</PackageProjectUrl>
<PackageIcon>serilog-sink-nuget.png</PackageIcon>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageOutputPath>$(SolutionDir)artifacts</PackageOutputPath>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>

<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/serilog/serilog-sinks-exceptionless</RepositoryUrl>
<RepositoryUrl>https://github.com/exceptionless/serilog-sinks-exceptionless</RepositoryUrl>

<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyProductAttribute>true</GenerateAssemblyProductAttribute>
<GenerateAssemblyCompanyAttribute>true</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyCopyrightAttribute>true</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyConfigurationAttribute>true</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyVersionAttribute>true</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>true</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>

<ItemGroup>
<None Remove="project.lock.json" />
</ItemGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Label="Signing">
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Update="readme.txt">
Expand All @@ -36,10 +58,19 @@
<ItemGroup>
<PackageReference Include="Exceptionless" Version="4.6.2" />
<PackageReference Include="Serilog" Version="2.10.0" />

<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="AsyncFixer" Version="1.5.1" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="2.5.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net45' ">
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup>
<None Include="$(SolutionDir)LICENSE.txt" Pack="true" Visible="false" PackagePath="$(PackageLicenseFile)" />
<None Include="$(SolutionDir)assets/serilog-sink-nuget.png" Pack="true" PackagePath="$(PackageIcon)" />
</ItemGroup>
</Project>

0 comments on commit a0319f8

Please sign in to comment.