From b7ed1426c13192cf7e709d3f0d36c318357004c0 Mon Sep 17 00:00:00 2001 From: Sergey Tihon Date: Fri, 15 Nov 2024 16:04:38 +0100 Subject: [PATCH] feat: build with net9 (#88) * feat: build with net9 * feat: package without packet * feat: add symbols * fix: typo --- .config/dotnet-tools.json | 26 +++---- .github/workflows/main.yml | 107 ++++++++++++++--------------- CHANGELOG.md | 5 ++ Clippit.Tests/Clippit.Tests.csproj | 22 +++--- Clippit.Tests/paket.references | 7 -- Clippit.sln | 2 +- Clippit/Clippit.csproj | 21 ++++-- Clippit/paket.references | 4 -- Clippit/paket.template | 30 -------- Directory.Build.props | 24 +++++++ build.fsx | 18 ++--- global.json | 2 +- paket.dependencies | 21 ------ paket.lock | 45 ------------ 14 files changed, 126 insertions(+), 208 deletions(-) delete mode 100644 Clippit.Tests/paket.references delete mode 100644 Clippit/paket.references delete mode 100644 Clippit/paket.template create mode 100644 Directory.Build.props delete mode 100644 paket.dependencies delete mode 100644 paket.lock diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index bc2a0f10..f6609eb7 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,26 +2,20 @@ "version": 1, "isRoot": true, "tools": { - "paket": { - "version": "8.0.3", - "commands": [ - "paket" - ], - "rollForward": false - }, "csharpier": { "version": "0.29.2", - "commands": [ - "dotnet-csharpier" - ], - "rollForward": false + "commands": ["dotnet-csharpier"], + "rollForward": true }, "husky": { "version": "0.7.1", - "commands": [ - "husky" - ], - "rollForward": false + "commands": ["husky"], + "rollForward": true + }, + "dotnet-outdated-tool": { + "version": "4.6.4", + "commands": ["dotnet-outdated"], + "rollForward": true } } -} \ No newline at end of file +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 55f133f5..8ba0e4fa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,62 +1,61 @@ name: Build and Test on: - push: - branches: - - master - pull_request: - branches: - - master + push: + branches: + - master + pull_request: + branches: + - master jobs: - build: - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - runs-on: ${{ matrix.os }} + build: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + runs-on: ${{ matrix.os }} - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup .NET 8.0 SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "8.0.x" - - name: Build and Test - run: dotnet fsi build.fsx -- -p build - - name: Upload Artifacts - uses: actions/upload-artifact@v4 - with: - name: bin-${{matrix.os}} - path: bin/*.nupkg + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup .NET 9.0 SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "9.0.x" + - name: Build and Test + run: dotnet fsi build.fsx -- -p build + - name: Upload Artifacts + uses: actions/upload-artifact@v4 + with: + name: bin-${{matrix.os}} + path: bin/*.nupkg - generate-docs: - runs-on: windows-latest - needs: build - - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Setup .NET 8.0 SDK - uses: actions/setup-dotnet@v4 - with: - dotnet-version: "8.0.x" - - name: Build and Test - run: dotnet fsi build.fsx -- -p build - - name: Setup DocFX - uses: crazy-max/ghaction-chocolatey@v1 - with: - args: install docfx - - name: DocFX Build - working-directory: docs - run: docfx docfx.json - continue-on-error: false - - name: Publish - if: github.event_name == 'push' - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: docs/_site - force_orphan: true + generate-docs: + runs-on: windows-latest + needs: build + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup .NET 9.0 SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: "9.0.x" + - name: Build and Test + run: dotnet fsi build.fsx -- -p build + - name: Setup DocFX + uses: crazy-max/ghaction-chocolatey@v1 + with: + args: install docfx + - name: DocFX Build + working-directory: docs + run: docfx docfx.json + continue-on-error: false + - name: Publish + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: docs/_site + force_orphan: true diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f61c6d..510666b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [2.3.0] - November 15, 2024 + +- Build with .NET 9.0 +- Pack with `dotnet pack` instead of `paket` + ## [2.2.2] - November 1, 2024 - feat: DocumentFormat.OpenXml 3.1.0 -> 3.1.1 diff --git a/Clippit.Tests/Clippit.Tests.csproj b/Clippit.Tests/Clippit.Tests.csproj index 875f4128..a85a3e2a 100644 --- a/Clippit.Tests/Clippit.Tests.csproj +++ b/Clippit.Tests/Clippit.Tests.csproj @@ -1,20 +1,24 @@ - + - net8.0 - LatestMajor + net9.0 true - latest true true - Clippit.Tests - Clippit.Tests - + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - - \ No newline at end of file + diff --git a/Clippit.Tests/paket.references b/Clippit.Tests/paket.references deleted file mode 100644 index d0aba400..00000000 --- a/Clippit.Tests/paket.references +++ /dev/null @@ -1,7 +0,0 @@ -DocumentFormat.OpenXml -DocumentFormat.OpenXml.Framework -IDisposableAnalyzers -Microsoft.NET.Test.Sdk -xunit -xunit.runner.visualstudio -xunit.runner.console \ No newline at end of file diff --git a/Clippit.sln b/Clippit.sln index f72084c3..732a8909 100644 --- a/Clippit.sln +++ b/Clippit.sln @@ -12,10 +12,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution .editorconfig = .editorconfig .gitignore = .gitignore global.json = global.json - paket.dependencies = paket.dependencies README.md = README.md CHANGELOG.md = CHANGELOG.md build.fsx = build.fsx + Directory.Build.props = Directory.Build.props EndProjectSection EndProject Global diff --git a/Clippit/Clippit.csproj b/Clippit/Clippit.csproj index 79874d91..a04f34ba 100644 --- a/Clippit/Clippit.csproj +++ b/Clippit/Clippit.csproj @@ -1,11 +1,18 @@ - + net8.0 - latest - Clippit - Clippit - false + + Clippit + true + snupkg + logo.jpeg + MIT + false + OpenXML;PowerTools;PowerPoint;Word;Excel;HTML + Fresh PowerTools for OpenXml - - \ No newline at end of file + + + + diff --git a/Clippit/paket.references b/Clippit/paket.references deleted file mode 100644 index 7b5422d8..00000000 --- a/Clippit/paket.references +++ /dev/null @@ -1,4 +0,0 @@ -DocumentFormat.OpenXml -DocumentFormat.OpenXml.Framework -SixLabors.ImageSharp.Drawing -IDisposableAnalyzers \ No newline at end of file diff --git a/Clippit/paket.template b/Clippit/paket.template deleted file mode 100644 index f2f064a8..00000000 --- a/Clippit/paket.template +++ /dev/null @@ -1,30 +0,0 @@ -type file -id - Clippit -owners - Sergey Tihon -authors - Sergey Tihon, Microsoft Corporation, Eric White, and others -projectUrl - https://github.com/sergey-tihon/Clippit -iconUrl - https://raw.githubusercontent.com/sergey-tihon/Clippit/master/docs/images/logo.jpeg -licenseUrl - https://github.com/sergey-tihon/Clippit/LICENSE -requireLicenseAcceptance - false -copyright - Copyright 2012-2024 -tags - OpenXML PowerTools PowerPoint Word Excel HTML -description - Fresh PowerTools for OpenXml -files - bin/Release/net8.0/Clippit.dll ==> lib/net8.0 - bin/Release/net8.0/Clippit.pdb ==> lib/net8.0 - -dependencies - framework: net8.0 - DocumentFormat.OpenXml >= LOCKEDVERSION - DocumentFormat.OpenXml.Framework >= LOCKEDVERSION - SixLabors.ImageSharp.Drawing >= LOCKEDVERSION diff --git a/Directory.Build.props b/Directory.Build.props new file mode 100644 index 00000000..45034222 --- /dev/null +++ b/Directory.Build.props @@ -0,0 +1,24 @@ + + + latest + enable + enable + false + + 5 + false + All + false + + Sergey Tihon, Microsoft Corporation, Eric White, and others + Copyright 2012-2024 + https://github.com/sergey-tihon/Clippit + git + + + + + + + + diff --git a/build.fsx b/build.fsx index aa2fbe5d..758e5805 100644 --- a/build.fsx +++ b/build.fsx @@ -1,6 +1,5 @@ -#r "nuget: Fun.Build, 1.0.5" +#r "nuget: Fun.Build, 1.1.14" #r "nuget: Fake.DotNet.AssemblyInfoFile" -#r "nuget: Fake.DotNet.Paket" open Fun.Build open Fake.IO @@ -23,12 +22,10 @@ pipeline "build" { stage "Check environment" { run "dotnet tool restore" - run "dotnet paket restore" + run "dotnet restore" } - stage "Check Formatting" { - run "dotnet csharpier --check ." - } + stage "Check Formatting" { run "dotnet csharpier --check ." } stage "Clean" { run (fun _ -> @@ -56,13 +53,8 @@ pipeline "build" { stage "RunTests" { run "dotnet test Clippit.Tests/" } stage "NuGet" { - run (fun _ -> - Paket.pack (fun p -> - { p with - ToolType = ToolType.CreateLocalTool() - OutputPath = "bin" - Version = version.Version - ReleaseNotes = version.ReleaseNotes })) + run + $"dotnet pack Clippit/Clippit.csproj -o bin/ -p:PackageVersion={version.Version} -p:PackageReleaseNotes=\"{version.ReleaseNotes}\"" } runIfOnlySpecified diff --git a/global.json b/global.json index ba341c54..cdbb589e 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.401", + "version": "9.0.100", "rollForward": "latestFeature" } } diff --git a/paket.dependencies b/paket.dependencies deleted file mode 100644 index e503f988..00000000 --- a/paket.dependencies +++ /dev/null @@ -1,21 +0,0 @@ -source https://api.nuget.org/v3/index.json - -storage: none -framework: net8.0 - -nuget DocumentFormat.OpenXml -nuget DocumentFormat.OpenXml.Framework -nuget SixLabors.ImageSharp.Drawing -nuget SixLabors.ImageSharp - -nuget System.IO.Packaging -nuget Microsoft.NETCore.Platforms -nuget System.Collections.Immutable -nuget System.Reflection.Metadata -nuget System.Text.Encoding.CodePages - -nuget IDisposableAnalyzers -nuget Microsoft.NET.Test.Sdk -nuget xunit -nuget xunit.runner.console -nuget xunit.runner.visualstudio diff --git a/paket.lock b/paket.lock deleted file mode 100644 index 4edfd10c..00000000 --- a/paket.lock +++ /dev/null @@ -1,45 +0,0 @@ -STORAGE: NONE -RESTRICTION: == net8.0 -NUGET - remote: https://api.nuget.org/v3/index.json - DocumentFormat.OpenXml (3.1.1) - DocumentFormat.OpenXml.Framework (>= 3.1.1) - DocumentFormat.OpenXml.Framework (3.1.1) - System.IO.Packaging (>= 8.0.1) - IDisposableAnalyzers (4.0.8) - Microsoft.CodeCoverage (17.11.1) - Microsoft.NET.Test.Sdk (17.11.1) - Microsoft.CodeCoverage (>= 17.11.1) - Microsoft.TestPlatform.TestHost (>= 17.11.1) - Microsoft.NETCore.Platforms (7.0.4) - Microsoft.TestPlatform.ObjectModel (17.11.1) - System.Reflection.Metadata (>= 1.6) - Microsoft.TestPlatform.TestHost (17.11.1) - Microsoft.TestPlatform.ObjectModel (>= 17.11.1) - Newtonsoft.Json (>= 13.0.1) - Newtonsoft.Json (13.0.3) - SixLabors.Fonts (2.0.6) - SixLabors.ImageSharp (3.1.5) - SixLabors.ImageSharp.Drawing (2.1.4) - SixLabors.Fonts (>= 2.0.4) - SixLabors.ImageSharp (>= 3.1.5) - System.Collections.Immutable (8.0) - System.IO.Packaging (8.0.1) - System.Reflection.Metadata (8.0.1) - System.Text.Encoding.CodePages (8.0) - xunit (2.9.2) - xunit.analyzers (>= 1.16) - xunit.assert (>= 2.9.2) - xunit.core (2.9.2) - xunit.abstractions (2.0.3) - xunit.analyzers (1.16) - xunit.assert (2.9.2) - xunit.core (2.9.2) - xunit.extensibility.core (2.9.2) - xunit.extensibility.execution (2.9.2) - xunit.extensibility.core (2.9.2) - xunit.abstractions (>= 2.0.3) - xunit.extensibility.execution (2.9.2) - xunit.extensibility.core (2.9.2) - xunit.runner.console (2.9.2) - xunit.runner.visualstudio (2.8.2)