Skip to content

Commit

Permalink
feat: build with net9 (#88)
Browse files Browse the repository at this point in the history
* feat: build with net9

* feat: package without packet

* feat: add symbols

* fix: typo
  • Loading branch information
sergey-tihon authored Nov 15, 2024
1 parent 0cd6a7d commit b7ed142
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 208 deletions.
26 changes: 10 additions & 16 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
107 changes: 53 additions & 54 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
22 changes: 13 additions & 9 deletions Clippit.Tests/Clippit.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<RollForward>LatestMajor</RollForward>
<TargetFramework>net9.0</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<LangVersion>latest</LangVersion>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<RootNamespace>Clippit.Tests</RootNamespace>
<AssemblyName>Clippit.Tests</AssemblyName>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Clippit\Clippit.csproj" />
</ItemGroup>
<ItemGroup>
<Service Include="{82a7f48d-3b50-4b1e-b82e-3ada8210c358}" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.console" Version="2.9.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
</Project>
7 changes: 0 additions & 7 deletions Clippit.Tests/paket.references

This file was deleted.

2 changes: 1 addition & 1 deletion Clippit.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 14 additions & 7 deletions Clippit/Clippit.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>latest</LangVersion>
<AssemblyName>Clippit</AssemblyName>
<RootNamespace>Clippit</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

<PackageId>Clippit</PackageId>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageIcon>logo.jpeg</PackageIcon>
<License>MIT</License>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageTags>OpenXML;PowerTools;PowerPoint;Word;Excel;HTML</PackageTags>
<Description>Fresh PowerTools for OpenXml</Description>
</PropertyGroup>
<Import Project="..\.paket\Paket.Restore.targets" />
</Project>
<ItemGroup>
<None Include="..\docs\images\logo.jpeg" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
4 changes: 0 additions & 4 deletions Clippit/paket.references

This file was deleted.

30 changes: 0 additions & 30 deletions Clippit/paket.template

This file was deleted.

24 changes: 24 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>

<WarningLevel>5</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<AnalysisMode>All</AnalysisMode>
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>

<Authors>Sergey Tihon, Microsoft Corporation, Eric White, and others</Authors>
<Copyright>Copyright 2012-2024</Copyright>
<RepositoryUrl>https://github.com/sergey-tihon/Clippit</RepositoryUrl>
<RepositoryType>git</RepositoryType>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="DocumentFormat.OpenXml" Version="3.1.1" />
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.1.4" />
<PackageReference Include="IDisposableAnalyzers" Version="4.0.8" PrivateAssets="all"/>
</ItemGroup>
</Project>
18 changes: 5 additions & 13 deletions build.fsx
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 _ ->
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.401",
"version": "9.0.100",
"rollForward": "latestFeature"
}
}
21 changes: 0 additions & 21 deletions paket.dependencies

This file was deleted.

Loading

0 comments on commit b7ed142

Please sign in to comment.