Skip to content

Commit

Permalink
chore: drop net6 support
Browse files Browse the repository at this point in the history
  • Loading branch information
sant11h committed Dec 9, 2024
1 parent d66d209 commit 5685d3d
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 90 deletions.
142 changes: 71 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
name: Build .NET
on:
workflow_call:
inputs:
os_matrix:
description: 'A JSON string array of OS matrix to build against'
default: "[\"macos-latest\", \"ubuntu-latest\", \"windows-latest\"]"
required: false
type: string
workflow_call:
inputs:
os_matrix:
description: "A JSON string array of OS matrix to build against"
default: '["macos-latest", "ubuntu-latest", "windows-latest"]'
required: false
type: string

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os_matrix)}}
env:
# https://www.donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: '1'
DOTNET_NOLOGO: '1'
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
# See more here: https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#how-do-i-debug-the-probing-properties-construction.
COREHOST_TRACE: '0'
# See more here: https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables.
NUGET_XMLDOC_MODE: 'skip'
DOTNET_MULTILEVEL_LOOKUP: 0
CI_BUILD: 'true'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
./eng/install-sdk.sh
echo "DOTNET_ROOT=$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_PATH
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ${{fromJson(inputs.os_matrix)}}
env:
# https://www.donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: "1"
DOTNET_NOLOGO: "1"
DOTNET_CLI_TELEMETRY_OPTOUT: "1"
# See more here: https://docs.microsoft.com/en-us/dotnet/core/dependency-loading/default-probing#how-do-i-debug-the-probing-properties-construction.
COREHOST_TRACE: "0"
# See more here: https://docs.microsoft.com/en-us/nuget/reference/cli-reference/cli-ref-environment-variables.
NUGET_XMLDOC_MODE: "skip"
DOTNET_MULTILEVEL_LOOKUP: 0
CI_BUILD: "true"
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
run: |
./eng/install-sdk.sh
echo "DOTNET_ROOT=$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_PATH
- name: Install .NET
if: matrix.os == 'windows-latest'
run: |
./eng/install-sdk.ps1
echo "DOTNET_ROOT=$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append
- name: Install .NET
if: matrix.os == 'windows-latest'
run: |
./eng/install-sdk.ps1
echo "DOTNET_ROOT=$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
echo "$Env:GITHUB_WORKSPACE/eng/.dotnet" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append
- name: Print host info
run: printenv && dotnet --info
- name: Print host info
run: printenv && dotnet --info

- name: Restore dependencies
run: dotnet restore
- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore --no-incremental /WarnAsError
- name: Build
run: dotnet build --no-restore --no-incremental /WarnAsError

- name: Test
run: dotnet test --no-build
- name: Test
run: dotnet test --no-build

- name: Run Tool PowerShell
if: matrix.os == 'windows-latest'
shell: pwsh
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v
- name: Run Tool PowerShell
if: matrix.os == 'windows-latest'
shell: pwsh
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $Env:GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Run Tool Bash
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
shell: bash
run: ./src/dotnet-affected/bin/Debug/net6.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v
- name: Run Tool Bash
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
shell: bash
run: ./src/dotnet-affected/bin/Debug/net9.0/dotnet-affected -p $GITHUB_WORKSPACE --assume-changes dotnet-affected -v

- name: Pack
if: success() && matrix.os == 'ubuntu-latest'
run: dotnet pack --no-restore --no-build --configuration Debug --include-symbols -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/packages
- name: Pack
if: success() && matrix.os == 'ubuntu-latest'
run: dotnet pack --no-restore --no-build --configuration Debug --include-symbols -p:SymbolPackageFormat=snupkg -o $GITHUB_WORKSPACE/packages

- uses: actions/upload-artifact@v3
name: 'Upload Packages'
if: success() && matrix.os == 'ubuntu-latest'
with:
name: packages
path: ${{ github.workspace }}/packages/**/*
- uses: actions/upload-artifact@v3
name: "Upload Packages"
if: success() && matrix.os == 'ubuntu-latest'
with:
name: packages
path: ${{ github.workspace }}/packages/**/*

- uses: actions/upload-artifact@v3
name: 'Upload Artifacts'
if: success() && matrix.os == 'ubuntu-latest'
with:
name: artifacts
path: src/dotnet-affected/bin/Debug/net8.0/
- uses: actions/upload-artifact@v3
name: "Upload Artifacts"
if: success() && matrix.os == 'ubuntu-latest'
with:
name: artifacts
path: src/dotnet-affected/bin/Debug/net9.0/
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<TargetFrameworks>net6.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>

<LangVersion>9.0</LangVersion>

Expand Down
18 changes: 4 additions & 14 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,26 @@
<PackageVersion Include="Microsoft.Build.Prediction" Version="1.2.18" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.7.8" />

<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.12.1" Condition="'$(OS)' == 'Windows_NT'"/>

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.0.0" Condition="'$(ContinuousIntegrationBuild)' == 'true'"/>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.Build" Version="17.3.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.3.2" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.3.2" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="6.0.2" />
<PackageVersion Include="System.CodeDom" Version="6.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.Build" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.11.4" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.1" />
<PackageVersion Include="System.CodeDom" Version="8.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.Build" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageVersion Include="System.CodeDom" Version="9.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

</Project>
3 changes: 0 additions & 3 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,5 @@
"sdk": {
"version": "9.0.101",
"allowPrerelease": true
},
"msbuild-sdks": {
"Microsoft.Build.Traversal": "4.1.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public static ProjectRootElement CreateMsBuildProject(
// Directory.Build.Props / Directory.Packages.props
project.Sdk = "Microsoft.NET.Sdk";
// Required for net8.0 MSBuild Project Creation
project.AddProperty("TargetFrameworks", "net6.0,net8.0,net9.0");
project.AddProperty("TargetFrameworks", "net8.0;net9.0");
customizer?.Invoke(project);

project.Save();
Expand Down

0 comments on commit 5685d3d

Please sign in to comment.