Skip to content

Commit

Permalink
Merge pull request #2 from NetLah/dev1
Browse files Browse the repository at this point in the history
Add Azure Verifier and HttpOverride
  • Loading branch information
thohng authored Jul 18, 2022
2 parents 1cf2d90 + af34a92 commit 4de00b7
Show file tree
Hide file tree
Showing 25 changed files with 1,130 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"minver-cli": {
"version": "3.0.0-rc.1",
"version": "4.1.0",
"commands": [
"minver"
]
Expand Down
53 changes: 27 additions & 26 deletions .github/workflows/aspnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,28 @@ jobs:
- name: MinVer
id: minver
run: echo "::set-output name=version::$(dotnet minver)"
- name: Set Docker tag suffix=nanoserver-1809
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Windows' }}
shell: powershell
run: |
echo "TAG_SUFFIX=-nanoserver-1809" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "Set tag suffix to: -nanoserver-1809"
- name: Docker meta
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
if: ${{ success() && github.event_name != 'pull_request' && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ secrets.DOCKER_HUB_REPOS }}
netlah/echo-service-api
tags: |
type=raw,enable=true,priority=999,prefix=,suffix=,value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=600
type=sha,enable=true,priority=500,prefix=sha-,suffix=,format=short
type=match,enable=true,priority=900,prefix=,suffix=,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=true,priority=880,prefix=,suffix=,pattern=^(\d+\.\d+(\.\d+))?(-.+)?$,group=1
type=match,enable=true,priority=870,prefix=,suffix=,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=true,priority=860,prefix=,suffix=,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
type=raw,enable=true,priority=999,prefix=,suffix=${{ env.TAG_SUFFIX }},value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=600,prefix=,suffix=${{ env.TAG_SUFFIX }}
type=sha,enable=true,priority=500,prefix=sha-,suffix=${{ env.TAG_SUFFIX }},format=short
type=match,enable=true,priority=900,prefix=,suffix=${{ env.TAG_SUFFIX }},pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=true,priority=880,prefix=,suffix=${{ env.TAG_SUFFIX }},pattern=^(\d+\.\d+(\.\d+))?(-.+)?$,group=1
type=match,enable=true,priority=870,prefix=,suffix=${{ env.TAG_SUFFIX }},pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=true,priority=860,prefix=,suffix=${{ env.TAG_SUFFIX }},pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
- name: Install dependencies
run: dotnet restore
- name: Build
Expand All @@ -54,28 +60,23 @@ jobs:
run: dotnet test -c Release --no-build --verbosity normal
- name: Publish
run: dotnet publish EchoServiceApi -c Release --no-build -o artifacts/app
- name: Copy Dockerfile
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
run: cp .docker-linux/* artifacts/
- name: Set up Docker Buildx
- name: Copy Dockerfile Linux
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
id: buildx
uses: docker/setup-buildx-action@v1
run: pwsh -c "Copy-Item -Recurse -Force -Path '.docker-linux/*' -Destination artifacts/ -ErrorAction Stop -Verbose"
- name: Copy Dockerfile Windows
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Windows' }}
run: pwsh -c "Copy-Item -Recurse -Force -Path '.docker-windows/*' -Destination artifacts/ -ErrorAction Stop -Verbose"
#- name: Set up Docker Buildx
# if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
# id: buildx
# uses: docker/setup-buildx-action@v1
- name: Login to Docker Hub
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
if: ${{ success() && github.event_name != 'pull_request' && (runner.os == 'Linux' || runner.os == 'Windows') }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./artifacts
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image digest
if: ${{ success() && github.event_name != 'pull_request' && runner.os == 'Linux' }}
run: echo ${{ steps.docker_build.outputs.digest }}
if: ${{ success() && github.event_name != 'pull_request' && (runner.os == 'Linux' || runner.os == 'Windows') }}
shell: pwsh
run: ./docker-build.ps1 -Context ./artifacts -Tags "${{ steps.meta.outputs.tags }}" -Labels "${{ steps.meta.outputs.tags }}"
93 changes: 53 additions & 40 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@

<ItemGroup>
<!--build related-->
<PackageReference Include="MinVer" Version="3.*-*" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.*" PrivateAssets="All" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.*" PrivateAssets="All" />
<PackageReference Update="Microsoft.SourceLink.Gitea" Version="1.*" PrivateAssets="All" />

<!--the helpers -->
<PackageReference Update="NetLah.Abstractions" Version="[0.*,1.0)" />
<PackageReference Update="NetLah.Extensions.Configuration" Version="[0.*,1.0)" />
<PackageReference Update="NetLah.Extensions.EventAggregator" Version="[0.*,1.0)" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog" Version="[0.*,1.0)" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog.AspNetCore" Version="[0.*,1.0)" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog" Version="[0.2.*-*,0.3.0)" />
<PackageReference Update="NetLah.Extensions.Logging.Serilog.AspNetCore" Version="[0.2.*-*,0.3.0)" />
<PackageReference Update="Testing.Dynamic.Json" Version="1.*-*" />

<!--tests-->
Expand All @@ -29,8 +30,8 @@
<PackageReference Update="xunit.runner.visualstudio" Version="2.*" PrivateAssets="All" />

<!--serilog and nlog-->
<PackageReference Update="Serilog" Version="[2.10.*-*,3)" />
<PackageReference Update="Serilog.AspNetCore" Version="[4.*-*,5)" />
<PackageReference Update="Serilog" Version="[2.11.*,3)" />
<PackageReference Update="Serilog.AspNetCore" Version="[5.*-*,6)" />
<PackageReference Update="Serilog.Enrichers.Thread" Version="[3.*-*,4)" />
<PackageReference Update="Serilog.Extensions.Hosting" Version="[4.*-*,5)" />
<PackageReference Update="Serilog.Extensions.Logging" Version="[3.*-*,4)" />
Expand All @@ -42,41 +43,47 @@
<PackageReference Update="Serilog.Sinks.File" Version="[5.*-*,6)" />
<PackageReference Update="Serilog.Sinks.PeriodicBatching" Version="[2.*-*,3)" />
<PackageReference Update="Serilog.Sinks.Seq" Version="[5.*-*,6)" />
<PackageReference Update="NLog" Version="5.*-*" />
<PackageReference Update="NLog.Extensions.Logging" Version="5.*-*" />
<PackageReference Update="NLog.Targets.Seq" Version="2.0.0" />
<PackageReference Update="NLog" Version="5.*" />
<PackageReference Update="NLog.Extensions.Logging" Version="5.*" />
<PackageReference Update="NLog.Targets.Seq" Version="2.*" />

<!--misc-->
<PackageReference Update="AutoMapper" Version="10.*" />
<PackageReference Update="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.*" />
<PackageReference Update="BouncyCastle.NetCore" Version="1.8.*" />
<PackageReference Update="ClosedXML" Version="0.*" />
<PackageReference Update="CsvHelper" Version="27.0.*" />
<PackageReference Update="AutoMapper" Version="[11.*,12)" />
<PackageReference Update="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="[11.*,12)" />
<PackageReference Update="BouncyCastle.NetCore" Version="1.9.*" />
<PackageReference Update="ClosedXML" Version="0.95.*" />
<PackageReference Update="CsvHelper" Version="27.*" />
<PackageReference Update="ExcelDataReader" Version="3.*" />
<PackageReference Update="ExcelDataReader.DataSet" Version="3.*" />
<PackageReference Update="Dapper" Version="2.0.*" />
<PackageReference Update="Docnet.Core" Version="2.3.*" />
<PackageReference Update="DocumentFormat.OpenXml" Version="2.*" />
<PackageReference Update="Docnet.Core" Version="2.*" />
<PackageReference Update="DocumentFormat.OpenXml" Version="2.13.*" />
<PackageReference Update="Humanizer.Core" Version="2.*" />
<PackageReference Update="LazyCache.AspNetCore" Version="2.*" />
<PackageReference Update="LiteDB" Version="5.*" />
<PackageReference Update="MiniProfiler.AspNetCore" Version="4.2.*" />
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.2.*" />
<PackageReference Update="MiniProfiler.Shared" Version="4.2.*" />
<PackageReference Update="Newtonsoft.Json" Version="12.*" />
<PackageReference Update="Newtonsoft.Json.Schema" Version="3.*" />
<PackageReference Update="MiniProfiler.AspNetCore" Version="4.*" />
<PackageReference Update="MiniProfiler.AspNetCore.Mvc" Version="4.*" />
<PackageReference Update="MiniProfiler.Shared" Version="4.*" />
<PackageReference Update="Newtonsoft.Json" Version="13.0.*" />
<PackageReference Update="Newtonsoft.Json.Schema" Version="3.0.*" />
<PackageReference Update="RabbitMQ.Client" Version="6.2.2" />
<PackageReference Update="SkiaSharp" Version="2.88.*" />
<PackageReference Update="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.*" />
<PackageReference Update="SkiaSharp.NativeAssets.NanoServer" Version="2.88.*" />
<PackageReference Update="StackExchange.Redis" Version="2.*" />
<PackageReference Update="TimeZoneConverter" Version="3.*" />
<PackageReference Update="TimeZoneConverter" Version="5.*" />

<!--microsoft other-->
<PackageReference Update="BenchmarkDotNet" Version="0.13.*" />
<PackageReference Update="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Update="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.Extensions.CommandLineUtils" Version="1.*" />
<PackageReference Update="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.*" />
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="17.*" />
<PackageReference Update="SkiaSharp" Version="2.80.*" />
<PackageReference Update="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.80.*" />
<PackageReference Update="System.Memory" Version="4.5.4" />
<PackageReference Update="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Update="System.Runtime.Extensions" Version="4.3.1" />
<PackageReference Update="System.Text.Encoding.CodePages" Version="6.*" />

<!--microsoft extensions-->
<PackageReference Update="Microsoft.Extensions.ApiDescription.Server" Version="$(FrameworkVersion)" />
Expand Down Expand Up @@ -105,7 +112,8 @@
<PackageReference Update="System.DirectoryServices.AccountManagement" Version="$(FrameworkVersion)" />
<PackageReference Update="System.DirectoryServices.Protocols" Version="$(FrameworkVersion)" />
<PackageReference Update="System.Drawing.Common" Version="$(FrameworkVersion)" />
<PackageReference Update="System.Text.Json" Version="$(FrameworkVersion)" />
<PackageReference Update="System.Text.Json" Condition="'$(TargetFramework)' != 'net6.0'" Version="5.*" />
<PackageReference Update="System.Text.Json" Condition="'$(TargetFramework)' == 'net6.0'" Version="$(FrameworkVersion)" />

<!--microsoft asp.net core-->
<PackageReference Update="Microsoft.AspNetCore.Authentication.Facebook" Version="$(FrameworkVersion)" />
Expand All @@ -122,16 +130,16 @@
<PackageReference Update="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(FrameworkVersion)" />

<!--microsoft entity framework and data-->
<PackageReference Update="Microsoft.Data.SqlClient" Version="4 .*" />
<PackageReference Update="Microsoft.Data.SqlClient" Version="4.*" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Cosmos" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(FrameworkVersion)" PrivateAssets="All" />
<PackageReference Update="Microsoft.EntityFrameworkCore.InMemory" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="$(FrameworkVersion)" />
<PackageReference Update="Microsoft.EntityFrameworkCore.Tools" Version="$(FrameworkVersion)" PrivateAssets="All" />
<PackageReference Update="Npgsql" Version="6.*" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="6.*" />
<PackageReference Update="Npgsql" Version="$(FrameworkVersion)" />
<PackageReference Update="Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(FrameworkVersion)" />
<PackageReference Update="EFCore.NamingConventions" Version="$(FrameworkVersion)" />

<!--azure-->
Expand All @@ -143,6 +151,7 @@
<PackageReference Update="Azure.Identity" Version="1.*" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.*" />
<PackageReference Update="Azure.Security.KeyVault.Certificates" Version="4.*" />
<PackageReference Update="Azure.Security.KeyVault.Keys" Version="4.*" />
<PackageReference Update="Azure.Security.KeyVault.Secrets" Version="4.*" />
<PackageReference Update="Azure.Storage.Blobs" Version="12.*" />
<PackageReference Update="Microsoft.ApplicationInsights.AspNetCore" Version="2.*" />
Expand All @@ -151,8 +160,8 @@
<PackageReference Update="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.*" />

<!--azure deprecated-->
<PackageReference Update="Microsoft.Azure.ServiceBus" Version="5.*" />
<PackageReference Update="Microsoft.Azure.Amqp" Version="2.*" />
<!--<PackageReference Update="Microsoft.Azure.ServiceBus" Version="5.*" />-->
<!--<PackageReference Update="Microsoft.Azure.Amqp" Version="2.*" />-->

<!--microsoft identity-->
<PackageReference Update="Microsoft.Identity.Client" Version="4.*" />
Expand All @@ -164,12 +173,12 @@
<PackageReference Update="System.IdentityModel.Tokens.Jwt" Version="6.*" />

<!--grpc-->
<PackageReference Update="Google.Protobuf" Version="3.19.*" />
<PackageReference Update="Grpc.AspNetCore" Version="2.40.*" />
<PackageReference Update="Grpc.Core.Api" Version="2.42.*" />
<PackageReference Update="Grpc.Net.Client" Version="2.40.*" />
<PackageReference Update="Grpc.Net.ClientFactory" Version="2.40.*" />
<PackageReference Update="Grpc.Tools" Version="2.42.*" PrivateAssets="All" />
<PackageReference Update="Google.Protobuf" Version="3.21.*" />
<PackageReference Update="Grpc.AspNetCore" Version="2.*" />
<PackageReference Update="Grpc.Core.Api" Version="2.*" />
<PackageReference Update="Grpc.Net.Client" Version="2.*" />
<PackageReference Update="Grpc.Net.ClientFactory" Version="2.*" />
<PackageReference Update="Grpc.Tools" Version="2.*" PrivateAssets="All" />

<!--open api-->
<PackageReference Update="Microsoft.AspNetCore.Mvc.Versioning" Version="5.*" />
Expand All @@ -189,11 +198,15 @@

<!--reactive-->
<PackageReference Update="Microsoft.Reactive.Testing" Version="5.*" />
<PackageReference Update="System.Interactive" Version="5.*" />
<PackageReference Update="System.Interactive.Async" Version="5.*" />
<PackageReference Update="System.Interactive.Async.Providers" Version="5.*" />
<PackageReference Update="System.Interactive" Version="6.*" />
<PackageReference Update="System.Interactive.Async" Version="6.*" />
<PackageReference Update="System.Interactive.Async.Providers" Version="6.*" />
<PackageReference Update="System.Reactive" Version="5.*" />
<PackageReference Update="System.Linq.Async" Version="5.*" />
<PackageReference Update="System.Linq.Async" Version="6.*" />

<!--sftpclient-->
<PackageReference Update="SSH.NET" Version="2020.0.2" />
<PackageReference Update="PgpCore" Version="5.3.0" />

</ItemGroup>

Expand All @@ -205,4 +218,4 @@
</PropertyGroup>
</Target>

</Project>
</Project>
1 change: 1 addition & 0 deletions EchoServiceApi.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.azure\pipelines\azure-pipelines.yml = .azure\pipelines\azure-pipelines.yml
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
docker-build.ps1 = docker-build.ps1
.docker-linux\Dockerfile = .docker-linux\Dockerfile
README.md = README.md
EndProjectSection
Expand Down
Loading

0 comments on commit 4de00b7

Please sign in to comment.