Skip to content

Commit

Permalink
chore: prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Searles committed Jan 26, 2024
1 parent 9d405db commit dc91957
Show file tree
Hide file tree
Showing 17 changed files with 86 additions and 79 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/build.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
name: Build
name: CI

on:
workflow_dispatch:
push:
branches:
- '**'
paths-ignore:
- '**.md'

jobs:
build:

runs-on: ubuntu-latest

steps:
Expand All @@ -35,11 +36,32 @@ jobs:

- uses: actions/setup-dotnet@v3

- name: Restore
- name: Dotnet Restore
run: dotnet restore

- name: Build
- name: Dotnet Build
run: dotnet build --configuration Release --no-restore

- name: Test
- name: Dotnet Test
run: dotnet test --no-restore --verbosity normal

- name: Upload nuget packages
uses: actions/upload-artifact@v4
with:
name: packages
path: artifacts/

publish:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' }}

steps:
- name: Download packages
uses: actions/download-artifact@v4
with:
name: packages

- name: Nuget Push
run: |
dotnet nuget push "*.nupkg" --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
44 changes: 0 additions & 44 deletions .github/workflows/publish.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<PackageReference Include="MinVer" PrivateAssets="All" />
<PackageReference Include="Nerdbank.GitVersioning" PrivateAssets="All" />
</ItemGroup>

<PropertyGroup Condition="'$(IsPackable)' != 'false'">
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.4" />
<PackageVersion Include="Microsoft.Extensions.DiagnosticAdapter" Version="3.1.32" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="MinVer" Version="4.3.0" />
<PackageVersion Include="MySql.Data" Version="8.2.0" />
<PackageVersion Include="Nerdbank.GitVersioning" Version="3.6.133" />
<PackageVersion Include="Npgsql" Version="8.0.1" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Serilog" Version="3.1.1" />
Expand Down
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore.Common/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "3.0",
"pathFilters": ["."],
"inherit": true
}
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore.MsSql/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"pathFilters": ["."],
"inherit": true
}
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore.MySql/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"pathFilters": ["."],
"inherit": true
}
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore.Postgresql/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"pathFilters": ["."],
"inherit": true
}
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore.StackExchange.Redis/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"pathFilters": ["."],
"inherit": true
}
13 changes: 1 addition & 12 deletions src/Elmah.AspNetCore/ElmahFeature.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,4 @@

namespace Elmah.AspNetCore;

internal class ElmahFeature : IElmahFeature
{
public ElmahFeature(Guid id, string location)
{
Id = id;
Location = location;
}

public Guid Id { get; }

public string Location { get; }
}
internal record ElmahFeature(Guid Id, string Location) : IElmahFeature;
8 changes: 0 additions & 8 deletions src/Elmah.AspNetCore/ErrorFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Net.Mime;
using System.Security;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
Expand All @@ -19,13 +18,6 @@ namespace Elmah.AspNetCore;

internal sealed class ErrorFactory : IErrorFactory
{
private static readonly JsonSerializerOptions SerializerOptions = new()
{
DictionaryKeyPolicy = JsonNamingPolicy.CamelCase,
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
MaxDepth = 0
};

private static readonly string[] SupportedContentTypes =
{
MediaTypeNames.Application.Json,
Expand Down
2 changes: 0 additions & 2 deletions src/Elmah.AspNetCore/ErrorLogMiddleware.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Net;
using System.Net.Http;
using System.Runtime.ExceptionServices;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
Expand Down
2 changes: 1 addition & 1 deletion src/Elmah.AspNetCore/HttpContextExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static bool RequestAcceptsHtml(this HttpContext context)
return false;
}

if ("XMLHttpRequest".Equals(context.Request.Headers.XRequestedWith, StringComparison.OrdinalIgnoreCase))
if (string.Equals("XMLHttpRequest", context.Request.Headers.XRequestedWith, StringComparison.OrdinalIgnoreCase))
{
return false;
}
Expand Down
6 changes: 1 addition & 5 deletions src/Elmah.AspNetCore/TestException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@

namespace Elmah.AspNetCore;

#region Imports

#endregion

/// <summary>
/// The exception that is thrown when to test the error logging
/// subsystem. This exception is used for testing purposes only and
Expand All @@ -33,7 +29,7 @@ public TestException(string message) :
}

/// <summary>
/// ializes a new instance of the <see cref="TestException" />
/// Initializes a new instance of the <see cref="TestException" />
/// class with a specified error message and a reference to the
/// inner exception that is the cause of this exception.
/// </summary>
Expand Down
6 changes: 6 additions & 0 deletions src/Elmah.AspNetCore/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "3.0",
"pathFilters": [".", "../Elmah.AspNetCore.Common"],
"inherit": true
}
6 changes: 6 additions & 0 deletions src/Serilog.Sinks.Elmah.AspNetCore/version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"pathFilters": ["."],
"inherit": true
}
12 changes: 12 additions & 0 deletions version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.0",
"versionHeightOffset": -1,
"assemblyVersion": {
"precision": "revision"
},
"publicReleaseRefSpec": [
"^refs/heads/main$"
],
"inherit": false
}

0 comments on commit dc91957

Please sign in to comment.