From c90de383d3b74119ccb64ed643259360ff434c9d Mon Sep 17 00:00:00 2001 From: Tho Ho Date: Thu, 5 Dec 2024 17:53:54 +0800 Subject: [PATCH] Remove .NET 6.0 and .NET 7.0 --- .github/workflows/aspnet-core.yml | 134 +----------------- Directory.Build.props | 1 - Directory.Build.targets | 2 +- .../SampleSpaWebApp/SampleSpaWebApp.csproj | 2 +- src/Hosting/Hosting.csproj | 11 +- src/WebApp/WebApp.csproj | 26 +--- test/Hosting.Test/Hosting.Test.csproj | 12 +- test/WebApp.Test/WebApp.Test.csproj | 2 +- 8 files changed, 15 insertions(+), 175 deletions(-) diff --git a/.github/workflows/aspnet-core.yml b/.github/workflows/aspnet-core.yml index 16ce9bd..4c22bb3 100644 --- a/.github/workflows/aspnet-core.yml +++ b/.github/workflows/aspnet-core.yml @@ -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 @@ -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 @@ -263,7 +165,7 @@ 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 } @@ -271,7 +173,7 @@ jobs: - 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 } @@ -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 } @@ -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 diff --git a/Directory.Build.props b/Directory.Build.props index 203bc14..5f2085d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -22,7 +22,6 @@ 12.0 enable enable - false diff --git a/Directory.Build.targets b/Directory.Build.targets index 78de385..7540056 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -317,7 +317,7 @@ - + diff --git a/samples/SampleSpaWebApp/SampleSpaWebApp.csproj b/samples/SampleSpaWebApp/SampleSpaWebApp.csproj index beb424c..cc3dadf 100644 --- a/samples/SampleSpaWebApp/SampleSpaWebApp.csproj +++ b/samples/SampleSpaWebApp/SampleSpaWebApp.csproj @@ -1,7 +1,7 @@ - net9.0;net8.0;net7.0;net6.0 + net9.0;net8.0 netlah-spaservices-webapp-hp70a false diff --git a/src/Hosting/Hosting.csproj b/src/Hosting/Hosting.csproj index 558e93e..e43dd19 100644 --- a/src/Hosting/Hosting.csproj +++ b/src/Hosting/Hosting.csproj @@ -3,7 +3,7 @@ NetLah.Extensions.SpaServices.$(MSBuildProjectName) spa;single-page-application;host;hosting;configurable;aspnetcore;dotnet;netcore - net9.0;net8.0;net7.0;net6.0 + net9.0;net8.0 The ASP.NET Core hosting the single-page application true ../../NetLah.snk @@ -30,13 +30,4 @@ - - - - - - - - - diff --git a/src/WebApp/WebApp.csproj b/src/WebApp/WebApp.csproj index c1784fa..8265357 100644 --- a/src/WebApp/WebApp.csproj +++ b/src/WebApp/WebApp.csproj @@ -1,7 +1,7 @@  - net9.0;net8.0;net7.0;net6.0 + net9.0;net8.0 netlah-spaservices-webapp-hp70a false false @@ -17,30 +17,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Hosting.Test/Hosting.Test.csproj b/test/Hosting.Test/Hosting.Test.csproj index 48e87ec..3e68738 100644 --- a/test/Hosting.Test/Hosting.Test.csproj +++ b/test/Hosting.Test/Hosting.Test.csproj @@ -1,7 +1,7 @@  - net9.0;net8.0;net7.0;net6.0 + net9.0;net8.0 NetLah.Extensions.SpaServices.$(MSBuildProjectName) NetLah.Extensions.SpaServices.$(MSBuildProjectName.Replace(" ", "_")) false @@ -47,14 +47,14 @@ - - + + --> + --> diff --git a/test/WebApp.Test/WebApp.Test.csproj b/test/WebApp.Test/WebApp.Test.csproj index 5b5a8d6..786ae79 100644 --- a/test/WebApp.Test/WebApp.Test.csproj +++ b/test/WebApp.Test/WebApp.Test.csproj @@ -1,7 +1,7 @@  - net9.0;net8.0;net7.0;net6.0 + net9.0;net8.0 false