Skip to content

Commit

Permalink
Remove .NET 6.0 and .NET 7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
thohng committed Dec 5, 2024
1 parent adf191a commit c90de38
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 175 deletions.
134 changes: 4 additions & 130 deletions .github/workflows/aspnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
7.0.x
8.0.x
9.0.x
Expand Down Expand Up @@ -66,103 +64,7 @@ jobs:
$tagSuffix = if ($Env:RUNNER_OS -eq 'Linux') { '-alpine' } else { if ($Env:RUNNER_OS -eq 'Windows') { '-nanoserver-1809' } }
Write-Output "TAG_SUFFIX=$tagSuffix" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
Write-Host "Set tag suffix to: $tagSuffix"
- name: Docker meta 6.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta60
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_HUB_REPOS }}
name=netlah/spa-host,enable=${{ startsWith(github.ref, 'refs/tags/') }}
flavor: |
latest=auto
suffix=${{ env.TAG_SUFFIX }}
tags: |
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=999,value=${{ steps.minver.outputs.version }}
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=900,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=880,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=870,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=860,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=699,prefix=6.0-,value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=500,prefix=6.0-
type=ref,event=pr,priority=500,prefix=6.0-pr-
type=sha,enable=${{ github.event_name != 'pull_request' }},priority=400,prefix=6.0-sha-,format=short
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=600,prefix=6.0-,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=580,prefix=6.0-,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=570,prefix=6.0-,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=560,prefix=6.0-,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
- name: Docker meta sample 6.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta_sample60
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_HUB_SAMPLE_REPOS }}
name=netlah/spa-host-sample,enable=${{ startsWith(github.ref, 'refs/tags/') }}
flavor: |
latest=auto
suffix=${{ env.TAG_SUFFIX }}
tags: |
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=999,value=${{ steps.minver.outputs.version }}
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=900,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=880,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=870,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=860,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=699,prefix=6.0-,value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=500,prefix=6.0-
type=ref,event=pr,priority=500,prefix=6.0-pr-
type=sha,enable=${{ github.event_name != 'pull_request' }},priority=400,prefix=6.0-sha-,format=short
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=600,prefix=6.0-,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=580,prefix=6.0-,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=570,prefix=6.0-,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=560,prefix=6.0-,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
- name: Docker meta 7.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta70
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_HUB_REPOS }}
name=netlah/spa-host,enable=${{ startsWith(github.ref, 'refs/tags/') }}
flavor: |
latest=auto
suffix=${{ env.TAG_SUFFIX }}
prefix=7.0-
tags: |
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=699,value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=500
type=ref,event=pr,priority=500,prefix=7.0-pr-
type=sha,enable=${{ github.event_name != 'pull_request' }},priority=400,prefix=7.0-sha-,format=short
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=600,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=580,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=570,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=560,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
- name: Docker meta sample 7.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta_sample70
uses: docker/metadata-action@v5
with:
images: |
${{ secrets.DOCKER_HUB_SAMPLE_REPOS }}
name=netlah/spa-host-sample,enable=${{ startsWith(github.ref, 'refs/tags/') }}
flavor: |
latest=auto
suffix=${{ env.TAG_SUFFIX }}
prefix=7.0-
tags: |
type=raw,enable=${{ github.event_name != 'pull_request' }},priority=699,value=${{ steps.minver.outputs.version }}
type=ref,event=branch,priority=500
type=ref,event=pr,priority=500,prefix=7.0-pr-
type=sha,enable=${{ github.event_name != 'pull_request' }},priority=400,prefix=7.0-sha-,format=short
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=600,pattern=^(\d+\.\d+(\.\d+)?(-.+)?)$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=580,pattern=^(\d+\.\d+(\.\d+)?)(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=570,pattern=^(\d+\.\d+)(\.\d+)?(-.+)?$,group=1
type=match,enable=${{ startsWith(github.ref, 'refs/tags/') }},priority=560,pattern=^(\d+)\.\d+(\.\d+)?(-.+)?$,group=1
- name: Docker meta 8.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: meta80
Expand Down Expand Up @@ -263,15 +165,15 @@ jobs:
- name: Publish
shell: pwsh
run: |
foreach ($framework in @('net6.0', 'net7.0', 'net8.0', 'net9.0')) {
foreach ($framework in @('net8.0', 'net9.0')) {
dotnet publish src/WebApp -c Release -f $framework --no-build -o "artifacts/$($framework)/app"
Copy-Item -Force -Path shared/appsettings.Development.json -Destination "artifacts/$($framework)/app/" -ErrorAction Stop -Verbose
}
- name: Split sample wwwroot
shell: pwsh
run: |
foreach ($framework in @('net6.0', 'net7.0', 'net8.0', 'net9.0')) {
foreach ($framework in @('net8.0', 'net9.0')) {
$webFolder = New-Item -Name "artifacts/$($framework)/wwwroot" -ItemType 'Directory' -ErrorAction Stop
Move-Item -Force -Path "artifacts/$($framework)/app/wwwroot/*" -Destination "$webFolder/" -Exclude favicon.ico -ErrorAction Stop -Verbose
}
Expand All @@ -280,7 +182,7 @@ jobs:
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
shell: pwsh
run: |
foreach ($framework in @('net6.0', 'net7.0', 'net8.0', 'net9.0')) {
foreach ($framework in @('net8.0', 'net9.0')) {
Copy-Item -Recurse -Force -Path '.dockerignore',".docker-$( if ($Env:RUNNER_OS -eq 'Linux') { 'linux' } else { 'windows' } )/*" -Destination "artifacts/$($framework)/" -ErrorAction Stop -Verbose
}
Expand All @@ -305,34 +207,6 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Build and Push 6.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: build60
shell: pwsh
run: ./docker-build.ps1 -Context ./artifacts/net6.0 -Squash -Tags "${{ steps.meta60.outputs.tags }}" -Labels "${{ steps.meta60.outputs.labels }}"

- name: Build and Push Sample 6.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
shell: pwsh
run: ./docker-build.ps1 -Context ./artifacts/net6.0 -NoPull -Dockerfile ./artifacts/net6.0/Dockerfile-sample -Tags "${{ steps.meta_sample60.outputs.tags }}" -Labels "${{ steps.meta_sample60.outputs.labels }}" -BuildArgs "SPAHOST_IMAGE=$Env:SPAHOST_IMAGE"
env:
SPAHOST_IMAGE: ${{ steps.build60.outputs.image }}

- name: Build and Push 7.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: build70
shell: pwsh
run: |
$aspnetImageTag70 = if ($Env:RUNNER_OS -eq 'Linux') { '7.0-alpine' } else { '7.0-nanoserver-1809' }
./docker-build.ps1 -Context ./artifacts/net7.0 -Squash -Tags "${{ steps.meta70.outputs.tags }}" -Labels "${{ steps.meta70.outputs.labels }}" -BuildArgs "ASPNET_IMAGE_TAG=$aspnetImageTag70"
- name: Build and Push Sample 7.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
shell: pwsh
run: ./docker-build.ps1 -Context ./artifacts/net7.0 -NoPull -Dockerfile ./artifacts/net7.0/Dockerfile-sample -Tags "${{ steps.meta_sample70.outputs.tags }}" -Labels "${{ steps.meta_sample70.outputs.labels }}" -BuildArgs "SPAHOST_IMAGE=$Env:SPAHOST_IMAGE"
env:
SPAHOST_IMAGE: ${{ steps.build70.outputs.image }}

- name: Build and Push 8.0
if: ${{ success() && (runner.os == 'Linux' || runner.os == 'Windows') }}
id: build80
Expand Down
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<LangVersion>12.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
</PropertyGroup>

<PropertyGroup Condition=" '$(TEAMCITY_VERSION)' != '' OR '$(CI)' == 'true' OR '$(TF_BUILD)' == 'true' OR '$(GITHUB_ACTIONS)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@
<PackageReference Update="IdentityModel.AspNetCore.OAuth2Introspection" Version="6.*" />

<!--azure-->
<PackageReference Update="Azure.Communication.Email" Version="1.*" />
<PackageReference Update="Azure.Communication.Email" Version="1.*-*" />
<PackageReference Update="Azure.Containers.ContainerRegistry" Version="1.*-*" />
<PackageReference Update="Azure.Core" Version="1.*" />
<PackageReference Update="Azure.Core.Amqp" Version="1.*" />
Expand Down
2 changes: 1 addition & 1 deletion samples/SampleSpaWebApp/SampleSpaWebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<UserSecretsId>netlah-spaservices-webapp-hp70a</UserSecretsId>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
11 changes: 1 addition & 10 deletions src/Hosting/Hosting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<PackageId>NetLah.Extensions.SpaServices.$(MSBuildProjectName)</PackageId>
<PackageTags>spa;single-page-application;host;hosting;configurable;aspnetcore;dotnet;netcore</PackageTags>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<Description>The ASP.NET Core hosting the single-page application</Description>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../../NetLah.snk</AssemblyOriginatorKeyFile>
Expand All @@ -30,13 +30,4 @@
<PackageReference Include="NetLah.Extensions.HttpOverrides" />
</ItemGroup>

<ItemGroup>
<!-- Newtonsoft.Json 11.0.2 -->
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-5crp-9r3c-p9vr" />
<!-- System.Drawing.Common 4.7.0 -->
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-rxg9-xrhp-64gj" />
<!-- System.Text.RegularExpressions 4.3.0 -->
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-cmhx-cq75-c4mj" />
</ItemGroup>

</Project>
26 changes: 1 addition & 25 deletions src/WebApp/WebApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<UserSecretsId>netlah-spaservices-webapp-hp70a</UserSecretsId>
<IsPackable>false</IsPackable>
<ServerGarbageCollection>false</ServerGarbageCollection>
Expand All @@ -17,30 +17,6 @@
<PackageReference Include="NetLah.Extensions.Logging.Serilog.AspNetCore" />
</ItemGroup>

<ItemGroup Condition="'$(NET_6_0)' == true">
</ItemGroup>

<ItemGroup Condition="'$(NET_7_0)' == true">
<PackageReference Include="System.Diagnostics.EventLog" />
</ItemGroup>

<ItemGroup Condition="'$(NET_6_0)' == true Or '$(NET_7_0)' == true">
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Microsoft.Extensions.Options" />
<PackageReference Include="Microsoft.Extensions.Primitives" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
<PackageReference Include="System.Text.Encodings.Web" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup Condition="'$(NET_8_0)' == true">
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions test/Hosting.Test/Hosting.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<AssemblyName>NetLah.Extensions.SpaServices.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>NetLah.Extensions.SpaServices.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -47,14 +47,14 @@
<ProjectReference Include="..\..\src\Hosting\Hosting.csproj" />
</ItemGroup>

<ItemGroup>
<!-- System.Text.Json 6.0.0/7.0.0/8.0.0 -->
<!--<ItemGroup>
--><!-- System.Text.Json 6.0.0/7.0.0/8.0.0 --><!--
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-8g4q-xg66-9fp4" />
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-hh2w-p6rv-4g7w" />
<!-- System.Drawing.Common 4.7.0 -->
--><!-- System.Drawing.Common 4.7.0 --><!--
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-rxg9-xrhp-64gj" />
<!-- System.Text.RegularExpressions 4.3.0 -->
--><!-- System.Text.RegularExpressions 4.3.0 --><!--
<NuGetAuditSuppress Include="https://github.com/advisories/GHSA-cmhx-cq75-c4mj" />
</ItemGroup>
</ItemGroup>-->

</Project>
2 changes: 1 addition & 1 deletion test/WebApp.Test/WebApp.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net9.0;net8.0;net7.0;net6.0</TargetFrameworks>
<TargetFrameworks>net9.0;net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down

0 comments on commit c90de38

Please sign in to comment.