Skip to content

Commit

Permalink
Update Mac and Linux targets to .NET 8 LTS (#1579)
Browse files Browse the repository at this point in the history
Update the target framework version for Mac and Linux to .NET 8, which
is the latest LTS. .NET 7 is [leaving support on
2024-05-14](https://dotnet.microsoft.com/en-us/platform/support/policy/dotnet-core)
so we need to do this.

Windows is not being updated at this time due our courtesy to Visual
Studio (that bundle the same GCM version across all their versions) who
need Windows 8.x support until.. 2029... 😢
and Windows 10 is required for .NET (Core) 8.

I plan to revisit the .NET Framework to Core on Windows effort after a
discussion with the VS team at Microsoft.
  • Loading branch information
mjcheetham authored Apr 15, 2024
2 parents fd05865 + 6144b5f commit 064c6c4
Show file tree
Hide file tree
Showing 27 changed files with 49 additions and 44 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 8.0.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down Expand Up @@ -102,7 +102,7 @@ jobs:
- name: Setup .NET
uses: actions/[email protected]
with:
dotnet-version: 6.0.201
dotnet-version: 8.0.x

- name: Install dependencies
run: dotnet restore
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: |
Expand Down Expand Up @@ -152,7 +152,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: |
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build with signed payload
run: |
Expand Down Expand Up @@ -238,7 +238,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build
run: dotnet build --configuration=LinuxRelease
Expand Down Expand Up @@ -316,7 +316,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Build .NET tool
run: |
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Package tool
run: |
Expand Down Expand Up @@ -508,7 +508,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -578,7 +578,7 @@ jobs:
- name: Set up .NET
uses: actions/[email protected]
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Download artifacts
uses: actions/download-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net7.0/git-credential-manager.dll",
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
"args": ["get"],
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
"console": "integratedTerminal",
Expand All @@ -22,7 +22,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net7.0/git-credential-manager.dll",
"program": "${workspaceFolder}/out/shared/Git-Credential-Manager/bin/Debug/net8.0/git-credential-manager.dll",
"args": ["store"],
"cwd": "${workspaceFolder}/out/shared/Git-Credential-Manager",
"console": "integratedTerminal",
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"type": "shell",
"group": "test",
"args": [
"~/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll",
"~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
"-targetdir:${workspaceFolder}/out/code-coverage"
],
Expand All @@ -71,7 +71,7 @@
"type": "shell",
"group": "test",
"args": [
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll",
"${env:USERROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll",
"-reports:${workspaceFolder}/**/TestResults/**/coverage.cobertura.xml",
"-targetdir:${workspaceFolder}/out/code-coverage"
],
Expand Down
2 changes: 1 addition & 1 deletion build/GCM.MSBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
</PropertyGroup>

Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,13 @@ HTML reports can be generated using ReportGenerator, this should be installed
during the build process, from the command line:

```shell
dotnet ~/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
dotnet ~/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
```

or

```shell
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net7.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
dotnet {$env:USERPROFILE}/.nuget/packages/reportgenerator/*/*/net8.0/ReportGenerator.dll -reports:./**/TestResults/**/coverage.cobertura.xml -targetdir:./out/code-coverage
```

Or via VSCode Terminal/Run Task:
Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/Packaging.Linux.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/install-from-source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ case "$distribution" in
# Install dotnet packages and dependencies if needed.
if [ -z "$(verify_existing_dotnet_installation)" ]; then
# First try to use native feeds (Ubuntu 22.04 and later).
if ! apt_install dotnet7; then
if ! apt_install dotnet8; then
# If the native feeds fail, we fall back to
# packages.microsoft.com. We begin by adding the dotnet package
# repository/signing key.
Expand Down
2 changes: 1 addition & 1 deletion src/linux/Packaging.Linux/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ GCM_SRC="$SRC/shared/Git-Credential-Manager"
PROJ_OUT="$OUT/linux/Packaging.Linux"

# Build parameters
FRAMEWORK=net7.0
FRAMEWORK=net8.0
RUNTIME=linux-x64

# Perform pre-execution checks
Expand Down
2 changes: 1 addition & 1 deletion src/osx/Installer.Mac/Installer.Mac.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/osx/Installer.Mac/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ GCM_SRC="$SRC/shared/Git-Credential-Manager"
GCM_UI_SRC="$SRC/shared/Git-Credential-Manager.UI.Avalonia"

# Build parameters
FRAMEWORK=net7.0
FRAMEWORK=net8.0

# Parse script arguments
for i in "$@"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Atlassian.Bitbucket/Atlassian.Bitbucket.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net8.0;net472</TargetFrameworks>
<AssemblyName>Atlassian.Bitbucket</AssemblyName>
<RootNamespace>Atlassian.Bitbucket</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/Core.Tests/Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Core/Core.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net8.0;net472</TargetFrameworks>
<AssemblyName>gcmcore</AssemblyName>
<RootNamespace>GitCredentialManager</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/DotnetTool/DotnetTool.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.Build.NoTargets/3.5.6">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PackAsTool>true</PackAsTool>
<NuSpecFile>dotnet-tool.nuspec</NuSpecFile>
<!-- Inject correct properties into NuSpec -->
Expand Down
2 changes: 1 addition & 1 deletion src/shared/DotnetTool/dotnet-tool.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</packageTypes>
</metadata>
<files>
<file src="$publishdir$payload/" target="tools/net7.0/any" />
<file src="$publishdir$payload/" target="tools/net8.0/any" />
<file src="$publishdir$images/icon.png" target="images" />
</files>
</package>
2 changes: 1 addition & 1 deletion src/shared/DotnetTool/layout.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ PROJ_OUT="$OUT/$DOTNET_TOOL"
CONFIGURATION="${CONFIGURATION:=Debug}"

# Build parameters
FRAMEWORK=net7.0
FRAMEWORK=net8.0

# Outputs
OUTDIR="$PROJ_OUT/nupkg/$CONFIGURATION"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net472;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net472;net8.0</TargetFrameworks>
<RuntimeIdentifiers>win-x86;osx-x64;linux-x64;osx-arm64</RuntimeIdentifiers>
<PlatformTarget Condition="'$(OSPlatform)'=='windows'">x86</PlatformTarget>
<AssemblyName>git-credential-manager</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/GitHub.Tests/GitHub.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/GitHub/GitHub.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net8.0;net472</TargetFrameworks>
<AssemblyName>GitHub</AssemblyName>
<RootNamespace>GitHub</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/GitLab.Tests/GitLab.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/GitLab/GitLab.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net8.0;net472</TargetFrameworks>
<AssemblyName>GitLab</AssemblyName>
<RootNamespace>GitLab</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions src/shared/Microsoft.AzureRepos/Microsoft.AzureRepos.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net7.0;net472</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OSPlatform)'=='windows'">net8.0;net472</TargetFrameworks>
<AssemblyName>Microsoft.AzureRepos</AssemblyName>
<RootNamespace>Microsoft.AzureRepos</RootNamespace>
<IsTestProject>false</IsTestProject>
Expand Down
2 changes: 1 addition & 1 deletion src/shared/TestInfrastructure/TestInfrastructure.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>GitCredentialManager.Tests</RootNamespace>
<IsPackable>false</IsPackable>
<IsTestProject>false</IsTestProject>
Expand Down

0 comments on commit 064c6c4

Please sign in to comment.