Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Commit

Permalink
Upgrade to .net8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
patriksvensson committed Nov 14, 2023
1 parent 28161a6 commit 8d12f9f
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 102 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Continuous Integration
on: pull_request

Expand All @@ -16,20 +17,10 @@ jobs:
build:
name: Build
if: "!contains(github.event.head_commit.message, 'skip-ci')"
strategy:
matrix:
kind: ['linux', 'windows', 'macOS']
include:
- kind: linux
os: ubuntu-latest
- kind: windows
os: windows-latest
- kind: macOS
os: macos-latest
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -38,9 +29,7 @@ jobs:
shell: bash

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
uses: actions/setup-dotnet@v3

- name: Build
shell: bash
Expand Down
49 changes: 3 additions & 46 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish

on:
Expand All @@ -6,8 +7,6 @@ on:
- '*'
branches:
- main
paths:
- 'src/**'

env:
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
Expand All @@ -17,57 +16,17 @@ env:

jobs:

###################################################
# BUILD
###################################################

build:
name: Build
if: "!contains(github.event.head_commit.message, 'skip-ci')"
strategy:
matrix:
kind: ['linux', 'windows', 'macOS']
include:
- kind: linux
os: ubuntu-latest
- kind: windows
os: windows-latest
- kind: macOS
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: 'Get Git tags'
run: git fetch --tags
shell: bash

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100

- name: Build
shell: bash
run: |
dotnet tool restore
dotnet cake
###################################################
# PUBLISH
###################################################

publish:
name: Publish
needs: [build]
if: "!contains(github.event.head_commit.message, 'skip-ci')"
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -76,9 +35,7 @@ jobs:
shell: bash

- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
uses: actions/setup-dotnet@v3

- name: Publish
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var configuration = Argument("configuration", "Release");
Task("Build")
.Does(context =>
{
DotNetCoreBuild("./src/TermInfo.sln", new DotNetCoreBuildSettings {
DotNetBuild("./src/TermInfo.sln", new DotNetBuildSettings {
Configuration = configuration,
NoIncremental = context.HasArgument("rebuild"),
MSBuildSettings = new DotNetCoreMSBuildSettings()
MSBuildSettings = new DotNetMSBuildSettings()
.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error)
});
});
Expand All @@ -19,7 +19,7 @@ Task("Test")
.IsDependentOn("Build")
.Does(context =>
{
DotNetCoreTest("./src/TermInfo.sln", new DotNetCoreTestSettings {
DotNetTest("./src/TermInfo.sln", new DotNetTestSettings {
Configuration = configuration,
NoRestore = true,
NoBuild = true,
Expand All @@ -32,12 +32,12 @@ Task("Package")
{
context.CleanDirectory("./.artifacts");

context.DotNetCorePack($"./src/TermInfo.sln", new DotNetCorePackSettings {
context.DotNetPack($"./src/TermInfo.sln", new DotNetPackSettings {
Configuration = configuration,
NoRestore = true,
NoBuild = true,
OutputDirectory = "./.artifacts",
MSBuildSettings = new DotNetCoreMSBuildSettings()
MSBuildSettings = new DotNetMSBuildSettings()
.TreatAllWarningsAs(MSBuildTreatAllWarningsAs.Error)
});
});
Expand All @@ -56,7 +56,7 @@ Task("Publish-NuGet")
foreach(var file in context.GetFiles("./.artifacts/*.nupkg"))
{
context.Information("Publishing {0}...", file.GetFilename().FullPath);
DotNetCoreNuGetPush(file.FullPath, new DotNetCoreNuGetPushSettings
DotNetNuGetPush(file.FullPath, new DotNetNuGetPushSettings
{
Source = "https://api.nuget.org/v3/index.json",
ApiKey = apiKey,
Expand Down
10 changes: 2 additions & 8 deletions dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "1.1.0",
"version": "3.2.0",
"commands": [
"dotnet-cake"
]
},
"gpr": {
"version": "0.1.224",
"commands": [
"gpr"
]
},
"dotnet-example": {
"version": "1.2.0",
"version": "1.6.0",
"commands": [
"dotnet-example"
]
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"projects": [ "src" ],
"sdk": {
"version": "5.0.100",
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
12 changes: 4 additions & 8 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Include="MinVer" PrivateAssets="All" Version="2.5.0" />
<PackageReference Include="MinVer" PrivateAssets="All" Version="4.3.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Version="1.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.333">
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.507">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Roslynator.Analyzers" Version="3.1.0">
<PackageReference Include="Roslynator.Analyzers" Version="4.6.2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Target Name="Versioning" BeforeTargets="MinVer">
<PropertyGroup Label="Build">
<MinVerDefaultPreReleasePhase>preview</MinVerDefaultPreReleasePhase>
<MinVerDefaultPreReleaseIdentifiers>preview.0</MinVerDefaultPreReleaseIdentifiers>
<MinVerVerbosity>normal</MinVerVerbosity>
</PropertyGroup>
</Target>
Expand Down
4 changes: 2 additions & 2 deletions src/TermInfo.Cli/Commands/Inspect/InspectCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ private static void RenderCapabilitiesTable(TermInfoDesc desc)
}
}

AnsiConsole.Render(table);
AnsiConsole.Write(table);
}

private static void RenderExtendedCapabilitiesTable(TermInfoDesc desc)
Expand Down Expand Up @@ -149,7 +149,7 @@ private static void RenderExtendedCapabilitiesTable(TermInfoDesc desc)
}
}

AnsiConsole.Render(table);
AnsiConsole.Write(table);
}

private static TermInfoDesc LoadTermInfoDesc(Settings settings)
Expand Down
14 changes: 8 additions & 6 deletions src/TermInfo.Cli/TermInfo.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer" Version="2.8.26" />
<PackageReference Include="Scriban" Version="3.6.0" />
<PackageReference Include="SharpCompress" Version="0.28.1" />
<PackageReference Include="Spectre.Console" Version="0.38.1-preview.0.21" />
<PackageReference Include="Spectre.IO" Version="0.2.0" />
<PackageReference Include="Humanizer" Version="2.14.1" />
<PackageReference Include="Scriban" Version="5.9.0" />
<PackageReference Include="SharpCompress" Version="0.34.1" />
<PackageReference Include="Spectre.Console.Cli" Version="0.47.0" />
<PackageReference Include="Spectre.IO" Version="0.14.0" />
<PackageReference Update="MinVer" Version="4.3.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
14 changes: 8 additions & 6 deletions src/TermInfo.Tests/TermInfo.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand All @@ -26,17 +26,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="Shouldly" Version="4.0.3" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.6.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.3.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Update="MinVer" Version="4.3.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 5 additions & 3 deletions src/TermInfo/TermInfo.csproj
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net5.0;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Memory" Version="4.5.0" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Include="System.Memory" Version="4.5.5" Condition="'$(TargetFramework)' == 'netstandard2.0'" />
<PackageReference Update="MinVer" Version="4.3.0" />
<PackageReference Update="Microsoft.SourceLink.GitHub" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand All @@ -16,7 +18,7 @@
<ItemGroup>
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" />
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[$(AnnotatedReferenceAssemblyVersion)]" />
<PackageReference Include="Nullable" Version="1.3.0">
<PackageReference Include="Nullable" Version="1.3.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down

0 comments on commit 8d12f9f

Please sign in to comment.