Skip to content

Commit

Permalink
first progress
Browse files Browse the repository at this point in the history
  • Loading branch information
pwelter34 committed Mar 21, 2024
1 parent 8aa8ba7 commit e4c7a1a
Show file tree
Hide file tree
Showing 59 changed files with 1,436 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# EditorConfig: https://EditorConfig.org

root = true

# All Files
[*]
charset = utf-8
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

# XML Configuration Files
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct,refactorlog,runsettings}]
indent_size = 2

# JSON Files
[*.{json,json5,webmanifest}]
indent_size = 2

# Project Files
[*.{csproj,sqlproj}]
indent_size = 2

# YAML Files
[*.{yml,yaml}]
indent_size = 2

# Markdown Files
[*.md]
trim_trailing_whitespace = false

# Web Files
[*.{htm,html,js,jsm,ts,tsx,css,sass,scss,less,pcss,svg,vue}]
indent_size = 2

# Batch Files
[*.{cmd,bat}]
end_of_line = crlf

# Bash Files
[*.sh]
end_of_line = lf

[*.{cs,vb}]
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = true
dotnet_style_namespace_match_folder = true

[*.cs]
csharp_using_directive_placement = outside_namespace
csharp_style_namespace_declarations = file_scoped:warning
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
time: "01:00"
open-pull-requests-limit: 10

- package-ecosystem: nuget
directory: "/"
schedule:
interval: daily
time: "11:00"
open-pull-requests-limit: 10
99 changes: 99 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Build

env:
DOTNET_NOLOGO: true
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_ENVIRONMENT: github
ASPNETCORE_ENVIRONMENT: github
BUILD_PATH: "${{github.workspace}}/artifacts"
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}

on:
push:
branches:
- main
- develop
tags:
- "v*"
pull_request:
branches:
- main
- develop

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
- name: Restore Dependencies
run: dotnet restore

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

- name: Run Test
run: dotnet test --no-build --configuration Release --collect:"XPlat Code Coverage" --settings coverlet.runsettings

- name: Report Coverage
if: success()
uses: coverallsapp/github-action@v2
with:
file: "${{github.workspace}}/test/*/TestResults/*/coverage.info"
format: lcov

- name: Create Packages
if: success() && github.event_name != 'pull_request'
run: dotnet pack --configuration Release --include-symbols --include-source --no-build --output "${{env.BUILD_PATH}}"

- name: Upload Packages
if: success() && github.event_name != 'pull_request'
uses: actions/upload-artifact@v4
with:
name: packages
path: "${{env.BUILD_PATH}}"

deploy:
runs-on: ubuntu-latest
needs: build
if: success() && github.event_name != 'pull_request' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))

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

- name: Publish Packages GitHub
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://nuget.pkg.github.com/loresoft/index.json --api-key ${{ secrets.GITHUB_TOKEN }} --skip-duplicate
done
- name: Publish Packages feedz
run: |
for package in $(find -name "*.nupkg"); do
echo "${0##*/}": Pushing $package...
dotnet nuget push $package --source https://f.feedz.io/loresoft/open/nuget/index.json --api-key ${{ secrets.FEEDDZ_KEY }} --skip-duplicate
done
- name: Publish Packages Nuget
if: startsWith(github.ref, 'refs/tags/v')
run: |
for package in $(find -name "*.nupkg"); 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
92 changes: 92 additions & 0 deletions AspNetCore.Extensions.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Extensions.SecurityKey", "src\AspNetCore.Extensions.SecurityKey\AspNetCore.Extensions.SecurityKey.csproj", "{B6EAF1BD-410D-44F2-B909-448E37BC0748}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Extensions.Diagnostics", "src\AspNetCore.Extensions.Diagnostics\AspNetCore.Extensions.Diagnostics.csproj", "{D556675A-4D8F-4F7B-A82C-7DC8CC255FE3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{8F6AF28D-3302-4CD2-93F8-FEDFF40DA284}"
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Extensions.SecurityKey.Tests", "test\AspNetCore.Extensions.SecurityKey.Tests\AspNetCore.Extensions.SecurityKey.Tests.csproj", "{524DA054-BB33-46BC-B906-1781DA92816D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Extensions.Diagnostics.Tests", "test\AspNetCore.Extensions.Diagnostics.Tests\AspNetCore.Extensions.Diagnostics.Tests.csproj", "{2CF093CB-B64C-4735-BC63-B37DA06B0247}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{8FF17A69-FF3C-4F04-9F5A-1C58B0498D0D}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.props = src\Directory.Build.props
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{8A309522-314D-4C40-9D0E-C42E88CB64E5}"
ProjectSection(SolutionItems) = preProject
samples\Directory.Build.props = samples\Directory.Build.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Controllers", "samples\Sample.Controllers\Sample.Controllers.csproj", "{24245841-8372-442D-8212-A357138445D9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.MinimalApi", "samples\Sample.MinimalApi\Sample.MinimalApi.csproj", "{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Middleware", "samples\Sample.Middleware\Sample.Middleware.csproj", "{53460F71-F58D-4BEF-9441-2CCA82FA9415}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample.Shared", "samples\Sample.Shared\Sample.Shared.csproj", "{CF5ED041-2229-4481-8DCC-8BB4438B222C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B6EAF1BD-410D-44F2-B909-448E37BC0748}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B6EAF1BD-410D-44F2-B909-448E37BC0748}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B6EAF1BD-410D-44F2-B909-448E37BC0748}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B6EAF1BD-410D-44F2-B909-448E37BC0748}.Release|Any CPU.Build.0 = Release|Any CPU
{D556675A-4D8F-4F7B-A82C-7DC8CC255FE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D556675A-4D8F-4F7B-A82C-7DC8CC255FE3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D556675A-4D8F-4F7B-A82C-7DC8CC255FE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D556675A-4D8F-4F7B-A82C-7DC8CC255FE3}.Release|Any CPU.Build.0 = Release|Any CPU
{524DA054-BB33-46BC-B906-1781DA92816D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{524DA054-BB33-46BC-B906-1781DA92816D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{524DA054-BB33-46BC-B906-1781DA92816D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{524DA054-BB33-46BC-B906-1781DA92816D}.Release|Any CPU.Build.0 = Release|Any CPU
{2CF093CB-B64C-4735-BC63-B37DA06B0247}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2CF093CB-B64C-4735-BC63-B37DA06B0247}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2CF093CB-B64C-4735-BC63-B37DA06B0247}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2CF093CB-B64C-4735-BC63-B37DA06B0247}.Release|Any CPU.Build.0 = Release|Any CPU
{24245841-8372-442D-8212-A357138445D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{24245841-8372-442D-8212-A357138445D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{24245841-8372-442D-8212-A357138445D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{24245841-8372-442D-8212-A357138445D9}.Release|Any CPU.Build.0 = Release|Any CPU
{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2}.Release|Any CPU.Build.0 = Release|Any CPU
{53460F71-F58D-4BEF-9441-2CCA82FA9415}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{53460F71-F58D-4BEF-9441-2CCA82FA9415}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53460F71-F58D-4BEF-9441-2CCA82FA9415}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53460F71-F58D-4BEF-9441-2CCA82FA9415}.Release|Any CPU.Build.0 = Release|Any CPU
{CF5ED041-2229-4481-8DCC-8BB4438B222C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CF5ED041-2229-4481-8DCC-8BB4438B222C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CF5ED041-2229-4481-8DCC-8BB4438B222C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CF5ED041-2229-4481-8DCC-8BB4438B222C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{524DA054-BB33-46BC-B906-1781DA92816D} = {8F6AF28D-3302-4CD2-93F8-FEDFF40DA284}
{2CF093CB-B64C-4735-BC63-B37DA06B0247} = {8F6AF28D-3302-4CD2-93F8-FEDFF40DA284}
{24245841-8372-442D-8212-A357138445D9} = {8A309522-314D-4C40-9D0E-C42E88CB64E5}
{21060613-AFA4-4C8E-B0C9-2CE4368DA6F2} = {8A309522-314D-4C40-9D0E-C42E88CB64E5}
{53460F71-F58D-4BEF-9441-2CCA82FA9415} = {8A309522-314D-4C40-9D0E-C42E88CB64E5}
{CF5ED041-2229-4481-8DCC-8BB4438B222C} = {8A309522-314D-4C40-9D0E-C42E88CB64E5}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E757B21F-53C0-43CE-94E6-65ADEC81158F}
EndGlobalSection
EndGlobal
14 changes: 14 additions & 0 deletions coverlet.runsettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat code coverage">
<Configuration>
<Format>lcov</Format>
<ExcludeByAttribute>Obsolete,GeneratedCodeAttribute,CompilerGeneratedAttribute,TestSDKAutoGeneratedCode</ExcludeByAttribute>
<SkipAutoProps>true</SkipAutoProps>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions samples/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>

<PropertyGroup>
<Description>Sample Project</Description>
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) LoreSoft</Copyright>
<Authors>LoreSoft</Authors>
<NeutralLanguage>en-US</NeutralLanguage>
<IsPackable>false</IsPackable>
</PropertyGroup>

<PropertyGroup>
<DebugType>portable</DebugType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<PropertyGroup>
<LangVersion>latest</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<NoWarn>1591</NoWarn>
</PropertyGroup>

<PropertyGroup>
<MinVerTagPrefix>v</MinVerTagPrefix>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AssemblyMetadata.Generators" Version="2.0.0" PrivateAssets="All" />
<PackageReference Include="Bogus" Version="35.5.0" />
<PackageReference Include="MinVer" Version="5.0.0" PrivateAssets="All" />
</ItemGroup>

<ItemGroup>
<Using Include="Bogus" />
</ItemGroup>

</Project>
18 changes: 18 additions & 0 deletions samples/Sample.Controllers/Controllers.http
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@HostAddress = http://localhost:5154

###

GET {{HostAddress}}/weather/
Accept: application/json

###

GET {{HostAddress}}/user/
Accept: application/json
X-API-KEY: 01HSGVAYZSP9ZY219BCB7B7DA1

###

GET {{HostAddress}}/address?X-API-KEY=01HSGVAYZSP9ZY219BCB7B7DA1
Accept: application/json

Loading

0 comments on commit e4c7a1a

Please sign in to comment.