Skip to content

Commit

Permalink
Update to .NET 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emgarten committed Feb 17, 2024
1 parent 247eb4f commit 157e43b
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 13 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET test

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-linux:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
run: ./build.sh
shell: bash
build-win:

runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
run: ./build.ps1
shell: pwsh
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 4.2.0
* Add net8.0 support, remove net7.0 support
* Update NuGet.* packages to 6.9.1

## 4.1.0
* Add net7.0 support

Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Remove-Artifacts $RepoRoot
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Clean;WriteGitInfo", "/p:Configuration=$Configuration")

# Build Exe
Invoke-DotnetExe $RepoRoot ("publish", "--force", "-r", "win-x64", "-p:PublishSingleFile=true", "-p:PublishTrimmed=false", "--self-contained", "true", "-f", "net6.0", "-o", (Join-Path $RepoRoot "artifacts\publish"), (Join-Path $RepoRoot "\src\NupkgWrench\NupkgWrench.csproj"))
Invoke-DotnetExe $RepoRoot ("publish", "--force", "-r", "win-x64", "-p:PublishSingleFile=true", "-p:PublishTrimmed=false", "--self-contained", "true", "-f", "net8.0", "-o", (Join-Path $RepoRoot "artifacts\publish"), (Join-Path $RepoRoot "\src\NupkgWrench\NupkgWrench.csproj"))

# Restore
Invoke-DotnetMSBuild $RepoRoot ("build\build.proj", "/t:Restore", "/p:Configuration=$Configuration")
Expand Down
6 changes: 3 additions & 3 deletions build/common/common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Function Install-DotnetCLI {

Write-Host "Fetching $installDotnet"

wget https://dot.net/v1/dotnet-install.ps1 -OutFile $installDotnet
Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile $installDotnet

& $installDotnet -Channel 6.0 -i $CLIRoot
& $installDotnet -Channel 7.0 -i $CLIRoot
& $installDotnet -Channel 8.0 -i $CLIRoot

if (-not (Test-Path $DotnetExe)) {
Write-Log "Missing $DotnetExe"
Expand Down Expand Up @@ -72,7 +72,7 @@ Function Install-NuGetExe {
$nugetDir = Split-Path $nugetExe
New-Item -ItemType Directory -Force -Path $nugetDir

wget https://dist.nuget.org/win-x86-commandline/v6.0.0/nuget.exe -OutFile $nugetExe
Invoke-WebRequest https://dist.nuget.org/win-x86-commandline/v6.9.1/nuget.exe -OutFile $nugetExe
}
}

Expand Down
2 changes: 1 addition & 1 deletion build/common/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ run_standard_tests()
# Run install.sh
chmod +x .cli/dotnet-install.sh
.cli/dotnet-install.sh -i .cli --channel 6.0
.cli/dotnet-install.sh -i .cli --channel 7.0
.cli/dotnet-install.sh -i .cli --channel 8.0
fi

# Display info
Expand Down
1 change: 1 addition & 0 deletions build/common/common.shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<PropertyGroup>
<RepositoryRootDirectory>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'README.md'))\</RepositoryRootDirectory>
<RepositoryBuildDirectory>$(RepositoryRootDirectory)build\</RepositoryBuildDirectory>
<RepositoryBuildIconsDirectory>$(RepositoryBuildDirectory)icons\</RepositoryBuildIconsDirectory>
<BuildCommonDirectory>$(RepositoryRootDirectory)build\common\</BuildCommonDirectory>
<SolutionFile>$(RepositoryRootDirectory)$(RepositoryName).sln</SolutionFile>
<ArtifactsDirectory>$(RepositoryRootDirectory)artifacts\</ArtifactsDirectory>
Expand Down
2 changes: 1 addition & 1 deletion build/common/common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<IsDesktop>true</IsDesktop>
</PropertyGroup>
</When>
<When Condition="$(TargetFramework.Contains('netstandard')) OR $(TargetFramework.Contains('netcoreapp')) OR $(TargetFramework.Contains('net5')) OR $(TargetFramework.Contains('net6')) OR $(TargetFramework.Contains('net7'))">
<When Condition="$(TargetFramework.Contains('netstandard')) OR $(TargetFramework.Contains('netcoreapp')) OR $(TargetFramework.Contains('net5')) OR $(TargetFramework.Contains('net6')) OR $(TargetFramework.Contains('net7')) OR $(TargetFramework.Contains('net8'))">
<PropertyGroup>
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
<IsCore>true</IsCore>
Expand Down
4 changes: 2 additions & 2 deletions build/config.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project ToolsVersion="15.0">
<!-- Dependency versions -->
<PropertyGroup>
<NuGetPackageVersion>6.2.1</NuGetPackageVersion>
<NuGetTestHelpersVersion>2.1.23</NuGetTestHelpersVersion>
<NuGetPackageVersion>6.9.1</NuGetPackageVersion>
<NuGetTestHelpersVersion>2.1.26</NuGetTestHelpersVersion>
<CommandLineUtilsVersion>2.0.0</CommandLineUtilsVersion>
<FileSystemGlobbingVersion>2.0.0</FileSystemGlobbingVersion>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/NupkgWrench/NupkgWrench.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>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition=" '$(PackProjectDotnetTool)' == 'true' ">
Expand Down
2 changes: 1 addition & 1 deletion test/NupkgWrench.CliTool.Tests/BasicTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public async Task RunToolVerifySuccess()
var result = await CmdRunner.RunAsync(dotnetExe, testContext.Root, $"tool install nupkgwrench --version {version} --add-source {nupkgsFolder} --tool-path {dir}");
result.Success.Should().BeTrue(result.AllOutput);

var dllPath = Path.Combine(dir, ".store", "nupkgwrench", version, "nupkgwrench", version, "tools", "net6.0", "any", "NupkgWrench.dll");
var dllPath = Path.Combine(dir, ".store", "nupkgwrench", version, "nupkgwrench", version, "tools", "net8.0", "any", "NupkgWrench.dll");

if (!File.Exists(dllPath))
{
Expand Down
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>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
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>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/NupkgWrench.Tests/NupkgWrench.Tests.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>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 157e43b

Please sign in to comment.