Skip to content
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
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This workflow will build a .NET project
# 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: Build
Expand All @@ -16,11 +16,12 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
uses: prozolic/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/nuget-pack-push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Pack and Push NuGet Package

on:
push:
tags:
- 'v*.*.*' # v1.1.0, v1.2.3, etc.

jobs:
pack:
permissions:
contents: read
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v6.pre.beta
- name: Setup .NET
uses: prozolic/Actions/.github/actions/setup-dotnet@main
with:
dotnet-version: |
8.0.x
9.0.x
10.0.x
- name: Build
run: dotnet build -c Release
- name: Pack
run: dotnet pack -c Release -o ./publish
- uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: nuget
path: ./publish/
retention-days: 1
if-no-files-found: error

publish:
needs: [pack]
permissions:
contents: write
id-token: write # for NuGet Trusted Publish
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: prozolic/Actions/.github/actions/setup-dotnet@main
# nuget
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0
id: login
with:
user: ${{ secrets.TARGET_NUGET_USER }}
- uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
name: nuget
path: ./nuget
- name: List Nuget
run: ls -al ./nuget
- name: Create Release
shell: bash
run: gh release create ${{github.ref_name}} --title ${{github.ref_name}} --generate-notes --draft
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# upload nuget
- run: dotnet nuget push "./nuget/*.nupkg" --skip-duplicate -s https://api.nuget.org/v3/index.json -k "${NUGET_KEY}"
env:

NUGET_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
3 changes: 3 additions & 0 deletions CsToml.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
<File Path="LICENSE" />
<File Path="exclusion.dic" />
<File Path="CLAUDE.md" />
<File Path="src/Directory.Build.props" />
<File Path="src/NuGet.props" />
<File Path=".github/workflows/build.yml" />
<File Path=".github/workflows/nuget-pack-push.yml" />
</Folder>
<Folder Name="/sandbox/">
<Project Path="sandbox/Benchmark/Benchmark.csproj" />
Expand Down
4 changes: 2 additions & 2 deletions sandbox/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>13.0</LangVersion>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>14.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
14 changes: 10 additions & 4 deletions sandbox/Benchmark/Config/BenchmarkConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace Benchmark;


internal class BenchmarkConfig : ManualConfig
{
public BenchmarkConfig()
Expand All @@ -29,12 +28,12 @@ public BenchmarkConfig()
AddValidator(DefaultConfig.Instance.GetValidators().ToArray());
AddLogger(ConsoleLogger.Default);

// .NET 9.0 as default.
// .NET 10.0 as default.
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
.DontEnforcePowerPlan()
.WithToolchain(CsProjCoreToolchain.NetCoreApp90)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp90.Name}"));
.WithToolchain(CsProjCoreToolchain.NetCoreApp10_0)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp10_0.Name}"));
}

public BenchmarkConfig AddTargetFramework()
Expand All @@ -46,6 +45,13 @@ public BenchmarkConfig AddTargetFramework()
.WithToolchain(CsProjCoreToolchain.NetCoreApp80)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp80.Name}"));

// Add .NET 9.0
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
.DontEnforcePowerPlan()
.WithToolchain(CsProjCoreToolchain.NetCoreApp90)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp90.Name}"));

return this;
}

Expand Down
4 changes: 2 additions & 2 deletions sandbox/Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
return;
#else

var config = new BenchmarkConfig();
//var config = new BenchmarkConfig().AddTargetFramework();
//var config = new BenchmarkConfig();
var config = new BenchmarkConfig().AddTargetFramework();
var summaries = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config).ToArray();
if (summaries.Length == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion sandbox/ConsoleApp/ConsoleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<Project>
<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<LangVersion>13.0</LangVersion>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<LangVersion>14.0</LangVersion>
<Nullable>enable</Nullable>
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion tests/CsToml.Generator.Tests/CsToml.Generator.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
2 changes: 1 addition & 1 deletion tests/CsToml.Tests/CsToml.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

Expand Down
Loading