Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .NET 8.0 #3

Merged
merged 4 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .azure/pipelines/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ trigger:
branches:
include:
- main
- "dev*"
tags:
include:
- "*.*.*"
Expand All @@ -31,6 +32,11 @@ pool:
vmImage: $(imageName)

steps:
- task: UseDotNet@2
displayName: "Use .NET Core sdk 8.x"
inputs:
version: 8.x

- task: UseDotNet@2
displayName: "Use .NET Core sdk 7.x"
inputs:
Expand All @@ -40,12 +46,7 @@ steps:
displayName: "Use .NET Core sdk 6.x"
inputs:
version: 6.x

- task: UseDotNet@2
displayName: "Use .NET Core sdk 3.1.x"
inputs:
version: 3.1.x


- script: dotnet --info
displayName: "dotnet info"

Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: .NET Core

on:
push:
branches: [main]
branches: ["main", "dev*"]
tags: ["*.*.*"]
pull_request:
branches: [main]
Expand All @@ -19,26 +19,34 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET Core 7.0.x, 6.0.x and 3.1.x

- name: Setup .NET Core 8.0.x, 7.0.x and 6.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x
7.0.x
8.0.x

- name: dotnet info
run: dotnet --info

- name: Install dependencies
run: dotnet restore --verbosity normal

- name: Build
run: dotnet build --configuration Release --no-restore --verbosity normal

- name: Test
run: dotnet test -c Release --no-build --verbosity normal

- name: Pack
run: dotnet pack -c Release -o ./artifacts/packages/ --no-build --verbosity normal

- if: ${{ success() && runner.os == 'Windows' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
name: Push MyGet
run: dotnet nuget push .\artifacts\packages\*.nupkg -s https://www.myget.org/F/netlah/api/v2/package -k ${{ secrets.MYGET }}

- if: ${{ success() && runner.os == 'Windows' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) }}
name: Publish Nuget to GitHub registry
run: dotnet nuget push .\artifacts\packages\*.nupkg -s https://nuget.pkg.github.com/NetLah/index.json --skip-duplicate -k ${{ secrets.PUSH_GITHUB_REGISTRY_TOKEN }}
34 changes: 34 additions & 0 deletions Common.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project>

<PropertyGroup>
<CurrentFrameworkVersion>6.0.20;7.0.9;8.0.0-preview.6</CurrentFrameworkVersion>
<ImportedCommonProps>True</ImportedCommonProps>

<NET_ID>$([MSBuild]::GetTargetFrameworkIdentifier($(TargetFramework)))</NET_ID>
<NET_VER>$([MSBuild]::GetTargetFrameworkVersion($(TargetFramework)))</NET_VER>

<NET_STD_2_0>False</NET_STD_2_0>
<NET_STD_2_1>False</NET_STD_2_1>
<NET_3_1>False</NET_3_1>
<NET_5_0>False</NET_5_0>
<NET_5_0>False</NET_5_0>
<NET_6_0>False</NET_6_0>
<NET_7_0>False</NET_7_0>
<NET_8_0>False</NET_8_0>

<NET_STD_2_0 Condition="'$(NET_VER)' == '2.0' And '$(NET_ID)' == '.NETStandard'">True</NET_STD_2_0>
<NET_STD_2_1 Condition="'$(NET_VER)' == '2.1' And '$(NET_ID)' == '.NETStandard'">True</NET_STD_2_1>
<NET_3_1 Condition="'$(NET_VER)' == '3.1' And '$(NET_ID)' == '.NETCoreApp'">True</NET_3_1>
<NET_5_0 Condition="'$(NET_VER)' == '5.0' And '$(NET_ID)' == '.NETCoreApp'">True</NET_5_0>
<NET_6_0 Condition="'$(NET_VER)' == '6.0' And '$(NET_ID)' == '.NETCoreApp'">True</NET_6_0>
<NET_7_0 Condition="'$(NET_VER)' == '7.0' And '$(NET_ID)' == '.NETCoreApp'">True</NET_7_0>
<NET_8_0 Condition="'$(NET_VER)' == '8.0' And '$(NET_ID)' == '.NETCoreApp'">True</NET_8_0>

<NET_3_1_OR_LESS>False</NET_3_1_OR_LESS>
<NET_5_1_OR_LESS>False</NET_5_1_OR_LESS>
<NET_3_1_OR_LESS Condition="'$(NET_VER)' &lt;= '3.1' And ('$(NET_ID)' == '.NETCoreApp' Or '$(NET_ID)' == '.NETStandard')">True</NET_3_1_OR_LESS>
<NET_5_1_OR_LESS Condition="'$(NET_VER)' &lt;= '5.0' And ('$(NET_ID)' == '.NETCoreApp' Or '$(NET_ID)' == '.NETStandard')">True</NET_5_1_OR_LESS>

</PropertyGroup>

</Project>
252 changes: 191 additions & 61 deletions Directory.Build.targets

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion NetLah.Abstractions.Test/NetLah.Abstractions.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>../NetLah.snk</AssemblyOriginatorKeyFile>
Expand Down
3 changes: 3 additions & 0 deletions NetLah.Abstractions/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<!-- dummy -->
</Project>
3 changes: 3 additions & 0 deletions NetLah.AssemblyInfo.BuildTime.Target/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project>
<!-- dummy -->
</Project>
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ This solution come from the idea of [Gérald Barré on Meziantou's blog Getting
```xml
<ItemGroup>
<PackageReference Include="NetLah.Abstractions" Version="0.2.0" />
<PackageReference Include="NetLah.AssemblyInfo.BuildTime.Target" Version="0.2.0" PrivateAssets="All" />
<PackageReference Include="NetLah.AssemblyInfo.BuildTime.Target" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
```

Expand Down Expand Up @@ -82,7 +82,7 @@ Version:0.2.0-rc2.2 BuildTime:2021-11-08T21:26:56+08:00; Framework:.NETCoreApp,V
```xml
<ItemGroup>
<PackageReference Update="NetLah.Abstractions" Version="0.2.0" />
<PackageReference Update="NetLah.AssemblyInfo.BuildTime.Target" Version="0.2.0" PrivateAssets="All" />
<PackageReference Update="NetLah.AssemblyInfo.BuildTime.Target" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
```

Expand All @@ -91,6 +91,6 @@ Version:0.2.0-rc2.2 BuildTime:2021-11-08T21:26:56+08:00; Framework:.NETCoreApp,V
```xml
<ItemGroup>
<PackageReference Update="NetLah.Abstractions" Version="0.2.0" />
<PackageReference Include="NetLah.AssemblyInfo.BuildTime.Target" Version="0.2.0" PrivateAssets="All" />
<PackageReference Include="NetLah.AssemblyInfo.BuildTime.Target" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
```
2 changes: 1 addition & 1 deletion samples/SampleApp/SampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net7.0;net6.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net8.0;net7.0;net6.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down