diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0f87426 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,27 @@ +name: CI + +on: + push: + branches: [ master, main, dev ] + pull_request: + +jobs: + build-dotnet8: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Build modern SDK-style projects (v2) + run: | + dotnet build src/FlatFile.Core.Modern/FlatFile.Core.Modern.csproj -c Release + dotnet build src/FlatFile.Core.Attributes.Modern/FlatFile.Core.Attributes.Modern.csproj -c Release + dotnet build src/FlatFile.Delimited.Modern/FlatFile.Delimited.Modern.csproj -c Release + dotnet build src/FlatFile.FixedLength.Modern/FlatFile.FixedLength.Modern.csproj -c Release + dotnet build src/FlatFile.Delimited.Attributes.Modern/FlatFile.Delimited.Attributes.Modern.csproj -c Release + dotnet build src/FlatFile.FixedLength.Attributes.Modern/FlatFile.FixedLength.Attributes.Modern.csproj -c Release diff --git a/.github/workflows/publish-nuget.yml b/.github/workflows/publish-nuget.yml new file mode 100644 index 0000000..cb83561 --- /dev/null +++ b/.github/workflows/publish-nuget.yml @@ -0,0 +1,48 @@ +name: Publish NuGet (v2) + +on: + push: + branches: [ master ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + publish: + runs-on: ubuntu-latest + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + PACKAGE_VERSION: 2.0.${{ github.run_number }} + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Validate NuGet API key is configured + run: | + if [ -z "$NUGET_API_KEY" ]; then + echo "NUGET_API_KEY secret is not configured." >&2 + exit 1 + fi + + - name: Pack v2 packages + run: | + mkdir -p artifacts/packages + dotnet pack src/FlatFile.Core.Modern/FlatFile.Core.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + dotnet pack src/FlatFile.Core.Attributes.Modern/FlatFile.Core.Attributes.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + dotnet pack src/FlatFile.Delimited.Modern/FlatFile.Delimited.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + dotnet pack src/FlatFile.FixedLength.Modern/FlatFile.FixedLength.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + dotnet pack src/FlatFile.Delimited.Attributes.Modern/FlatFile.Delimited.Attributes.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + dotnet pack src/FlatFile.FixedLength.Attributes.Modern/FlatFile.FixedLength.Attributes.Modern.csproj -c Release -o artifacts/packages /p:Version=$PACKAGE_VERSION + + - name: Publish packages to NuGet + run: | + dotnet nuget push "artifacts/packages/*.nupkg" \ + --api-key "$NUGET_API_KEY" \ + --source https://api.nuget.org/v3/index.json \ + --skip-duplicate diff --git a/README.md b/README.md index 5c30b8a..cd8bae7 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,36 @@ FlatFile FlatFile is a library to work with flat files (work up-to 100 times faster then [FileHelpers](https://www.nuget.org/packages/FileHelpers/2.0.0)) + +## Modernization status + +- 🚨 **v2 breaking change**: dropped legacy .NET Framework targets (`net35`-`net48`) and old build pipeline. +- ✅ Modernized runtime support to **.NET 8** only via SDK-style projects. +- ✅ CI now builds modern projects with `dotnet build` on GitHub Actions. + +### Modern .NET support + +Active projects: + +- `src/FlatFile.Core.Modern` +- `src/FlatFile.Core.Attributes.Modern` +- `src/FlatFile.Delimited.Modern` +- `src/FlatFile.FixedLength.Modern` +- `src/FlatFile.Delimited.Attributes.Modern` +- `src/FlatFile.FixedLength.Attributes.Modern` + +All of them target `net8.0` and carry package/assembly version `2.0.0`. + +### NuGet publishing from GitHub + +When changes are merged to `master`, GitHub Actions can publish v2 packages automatically using `.github/workflows/publish-nuget.yml`. + +Required repository secret: + +- `NUGET_API_KEY`: NuGet.org API key with push permission for FlatFile packages. + +The publish workflow packs all `*.Modern` projects and pushes resulting `.nupkg` files to NuGet (`--skip-duplicate`). + ### Installing FlatFile #### Installing all packages diff --git a/assets/psake-common.ps1 b/assets/psake-common.ps1 index 293bd40..dacecac 100644 --- a/assets/psake-common.ps1 +++ b/assets/psake-common.ps1 @@ -20,8 +20,15 @@ Properties { ### Project information $solution_path = "$src_dir\$solution" $sharedAssemblyInfo = "$src_dir\SharedAssemblyInfo.cs" - $config = "Release" - $frameworks = @("NET35", "NET40", "NET45") + $config = "Release" + $modern_projects = @( + "$src_dir\FlatFile.Core.Modern\FlatFile.Core.Modern.csproj", + "$src_dir\FlatFile.Core.Attributes.Modern\FlatFile.Core.Attributes.Modern.csproj", + "$src_dir\FlatFile.Delimited.Modern\FlatFile.Delimited.Modern.csproj", + "$src_dir\FlatFile.FixedLength.Modern\FlatFile.FixedLength.Modern.csproj", + "$src_dir\FlatFile.Delimited.Attributes.Modern\FlatFile.Delimited.Attributes.Modern.csproj", + "$src_dir\FlatFile.FixedLength.Attributes.Modern\FlatFile.FixedLength.Attributes.Modern.csproj" + ) ### Files $releaseNotes = "$base_dir\ChangeLog.md" @@ -29,34 +36,27 @@ Properties { ## Tasks -Task Restore -Description "Restore NuGet packages for solution." { - "Restoring NuGet packages for '$solution_path'..." - Exec { .$nuget restore $solution_path } +Task Restore -Description "Restore .NET packages for modern projects." { + foreach ($project in $modern_projects) { + "Restoring '$project'..." + Exec { dotnet restore $project } + } } Task Clean -Description "Clean up build and project folders." { Clean-Directory $build_dir - if ($solution) { - "Cleaning up '$solution'..." - - foreach ($framework in $frameworks) { - Exec { msbuild $solution_path /target:Clean /nologo /verbosity:minimal /p:Framework=$framework} - } + foreach ($project in $modern_projects) { + "Cleaning '$project'..." + Exec { dotnet clean $project -c $config } } } -Task Compile -Depends Clean, Restore -Description "Compile all the projects in a solution." { - "Compiling '$solution'..." - - $extra = $null - if ($appVeyor) { - $extra = "/logger:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" +Task Compile -Depends Clean, Restore -Description "Compile all modern SDK-style projects." { + foreach ($project in $modern_projects) { + "Compiling '$project'..." + Exec { dotnet build $project -c $config --no-restore } } - - foreach ($framework in $frameworks) { - Exec { msbuild $solution_path /p:"Configuration=$config;Framework=$framework" /nologo /verbosity:minimal $extra } - } } ### Pack functions diff --git a/docs/modernization-plan.md b/docs/modernization-plan.md new file mode 100644 index 0000000..046fed4 --- /dev/null +++ b/docs/modernization-plan.md @@ -0,0 +1,27 @@ +# FlatFile modernization plan + +## Current direction (v2) + +This repository now follows a **modern-only** strategy: + +1. Legacy .NET Framework build matrix was removed from CI. +2. SDK-style projects under `*.Modern` are the active build path. +3. Active target is `net8.0` with version `2.0.0` (breaking major release). + +## Why + +The previous mixed strategy (legacy + modern) produced unstable CI and unnecessary maintenance overhead. +A major-version reset enables simpler tooling, faster builds, and a clear support policy. + +## Next steps + +- Publish v2 packages from modern projects (`dotnet pack`). +- Add analyzers and nullable annotations incrementally. +- Add dedicated test projects targeting `net8.0`. + + +## CI/CD publishing + +- `.github/workflows/publish-nuget.yml` publishes NuGet packages on pushes to `master`. +- Configure repository secret `NUGET_API_KEY` before enabling release merges. +- Package versions are generated as `2.0.` in CI. diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..f416ac7 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,17 @@ + + + true + MIT + forcewake + Pavel Nasovich + FlatFile library for high-performance fixed-length and delimited file processing. + https://github.com/forcewake/FlatFile + https://github.com/forcewake/FlatFile + git + README.md + + + + + + diff --git a/src/FlatFile.Benchmark/FlatFile.Benchmark.csproj b/src/FlatFile.Benchmark/FlatFile.Benchmark.csproj index caa3588..09b1eed 100644 --- a/src/FlatFile.Benchmark/FlatFile.Benchmark.csproj +++ b/src/FlatFile.Benchmark/FlatFile.Benchmark.csproj @@ -31,6 +31,63 @@ prompt 4 + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Benchmark.XML + + ..\packages\Benchmark.It.1.2.0\lib\BenchmarkIt.dll diff --git a/src/FlatFile.Core.Attributes.Modern/FlatFile.Core.Attributes.Modern.csproj b/src/FlatFile.Core.Attributes.Modern/FlatFile.Core.Attributes.Modern.csproj new file mode 100644 index 0000000..95ba650 --- /dev/null +++ b/src/FlatFile.Core.Attributes.Modern/FlatFile.Core.Attributes.Modern.csproj @@ -0,0 +1,22 @@ + + + net8.0 + FlatFile.Core.Attributes + FlatFile.Core.Attributes + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + + + + + diff --git a/src/FlatFile.Core.Attributes/FlatFile.Core.Attributes.csproj b/src/FlatFile.Core.Attributes/FlatFile.Core.Attributes.csproj index 87f339c..5689453 100644 --- a/src/FlatFile.Core.Attributes/FlatFile.Core.Attributes.csproj +++ b/src/FlatFile.Core.Attributes/FlatFile.Core.Attributes.csproj @@ -86,6 +86,63 @@ 4 bin\$(Configuration)\$(Framework)\$(AssemblyName).XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Core.Attributes.XML + + diff --git a/src/FlatFile.Core.Modern/FlatFile.Core.Modern.csproj b/src/FlatFile.Core.Modern/FlatFile.Core.Modern.csproj new file mode 100644 index 0000000..ce7d9bb --- /dev/null +++ b/src/FlatFile.Core.Modern/FlatFile.Core.Modern.csproj @@ -0,0 +1,18 @@ + + + net8.0 + FlatFile.Core + FlatFile.Core + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + diff --git a/src/FlatFile.Core/Exceptions/ParseLineException.cs b/src/FlatFile.Core/Exceptions/ParseLineException.cs index 707a336..679fa17 100644 --- a/src/FlatFile.Core/Exceptions/ParseLineException.cs +++ b/src/FlatFile.Core/Exceptions/ParseLineException.cs @@ -29,11 +29,13 @@ public ParseLineException(string line, int lineNumber) public int LineNumber { get; private set; } public string Line { get; private set; } +#pragma warning disable SYSLIB0051 protected ParseLineException(SerializationInfo info, StreamingContext context, string line, int lineNumber) : base(info, context) { Line = line; LineNumber = lineNumber; } +#pragma warning restore SYSLIB0051 } } diff --git a/src/FlatFile.Core/FlatFile.Core.csproj b/src/FlatFile.Core/FlatFile.Core.csproj index 08ab631..4cb20c8 100644 --- a/src/FlatFile.Core/FlatFile.Core.csproj +++ b/src/FlatFile.Core/FlatFile.Core.csproj @@ -86,6 +86,63 @@ 4 bin\$(Configuration)\$(Framework)\FlatFile.Core.XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Core.XML + + diff --git a/src/FlatFile.Delimited.Attributes.Modern/FlatFile.Delimited.Attributes.Modern.csproj b/src/FlatFile.Delimited.Attributes.Modern/FlatFile.Delimited.Attributes.Modern.csproj new file mode 100644 index 0000000..e115b0e --- /dev/null +++ b/src/FlatFile.Delimited.Attributes.Modern/FlatFile.Delimited.Attributes.Modern.csproj @@ -0,0 +1,24 @@ + + + net8.0 + FlatFile.Delimited.Attributes + FlatFile.Delimited.Attributes + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + + + + + + + diff --git a/src/FlatFile.Delimited.Attributes/FlatFile.Delimited.Attributes.csproj b/src/FlatFile.Delimited.Attributes/FlatFile.Delimited.Attributes.csproj index 8c89756..3c6c5fa 100644 --- a/src/FlatFile.Delimited.Attributes/FlatFile.Delimited.Attributes.csproj +++ b/src/FlatFile.Delimited.Attributes/FlatFile.Delimited.Attributes.csproj @@ -84,6 +84,63 @@ 4 bin\$(Configuration)\$(Framework)\$(AssemblyName).XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Delimited.Attributes.XML + + diff --git a/src/FlatFile.Delimited.Modern/FlatFile.Delimited.Modern.csproj b/src/FlatFile.Delimited.Modern/FlatFile.Delimited.Modern.csproj new file mode 100644 index 0000000..0c46795 --- /dev/null +++ b/src/FlatFile.Delimited.Modern/FlatFile.Delimited.Modern.csproj @@ -0,0 +1,22 @@ + + + net8.0 + FlatFile.Delimited + FlatFile.Delimited + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + + + + + diff --git a/src/FlatFile.Delimited/FlatFile.Delimited.csproj b/src/FlatFile.Delimited/FlatFile.Delimited.csproj index 1523482..32a8a8f 100644 --- a/src/FlatFile.Delimited/FlatFile.Delimited.csproj +++ b/src/FlatFile.Delimited/FlatFile.Delimited.csproj @@ -84,6 +84,63 @@ 4 bin\$(Configuration)\$(Framework)\FlatFile.Delimited.XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Delimited.XML + + diff --git a/src/FlatFile.FixedLength.Attributes.Modern/FlatFile.FixedLength.Attributes.Modern.csproj b/src/FlatFile.FixedLength.Attributes.Modern/FlatFile.FixedLength.Attributes.Modern.csproj new file mode 100644 index 0000000..0b8b8d6 --- /dev/null +++ b/src/FlatFile.FixedLength.Attributes.Modern/FlatFile.FixedLength.Attributes.Modern.csproj @@ -0,0 +1,24 @@ + + + net8.0 + FlatFile.FixedLength.Attributes + FlatFile.FixedLength.Attributes + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + + + + + + + diff --git a/src/FlatFile.FixedLength.Attributes/FlatFile.FixedLength.Attributes.csproj b/src/FlatFile.FixedLength.Attributes/FlatFile.FixedLength.Attributes.csproj index 5289115..32c95c4 100644 --- a/src/FlatFile.FixedLength.Attributes/FlatFile.FixedLength.Attributes.csproj +++ b/src/FlatFile.FixedLength.Attributes/FlatFile.FixedLength.Attributes.csproj @@ -84,6 +84,63 @@ 4 bin\$(Configuration)\$(Framework)\$(AssemblyName).XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.FixedLength.Attributes.XML + + diff --git a/src/FlatFile.FixedLength.Modern/FlatFile.FixedLength.Modern.csproj b/src/FlatFile.FixedLength.Modern/FlatFile.FixedLength.Modern.csproj new file mode 100644 index 0000000..f029abe --- /dev/null +++ b/src/FlatFile.FixedLength.Modern/FlatFile.FixedLength.Modern.csproj @@ -0,0 +1,22 @@ + + + net8.0 + FlatFile.FixedLength + FlatFile.FixedLength + false + latest + disable + true + 2.0.0 + 2.0.0.0 + 2.0.0.0 + + + + + + + + + + diff --git a/src/FlatFile.FixedLength/FlatFile.FixedLength.csproj b/src/FlatFile.FixedLength/FlatFile.FixedLength.csproj index f0090b9..b1b1510 100644 --- a/src/FlatFile.FixedLength/FlatFile.FixedLength.csproj +++ b/src/FlatFile.FixedLength/FlatFile.FixedLength.csproj @@ -84,6 +84,63 @@ 4 bin\$(Configuration)\$(Framework)\FlatFile.FixedLength.XML + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.FixedLength.XML + + diff --git a/src/FlatFile.Tests/FlatFile.Tests.csproj b/src/FlatFile.Tests/FlatFile.Tests.csproj index 57f98f9..9d1d0e0 100644 --- a/src/FlatFile.Tests/FlatFile.Tests.csproj +++ b/src/FlatFile.Tests/FlatFile.Tests.csproj @@ -31,6 +31,63 @@ prompt 4 + + + + v4.5.1 + AnyCPU + + + v4.5.2 + AnyCPU + + + v4.6 + AnyCPU + + + v4.6.1 + AnyCPU + + + v4.6.2 + AnyCPU + + + v4.7 + AnyCPU + + + v4.7.1 + AnyCPU + + + v4.7.2 + AnyCPU + + + v4.8 + AnyCPU + true + full + false + bin\$(Configuration)\$(Framework)\ + DEBUG;TRACE + prompt + 4 + + + v4.8 + AnyCPU + pdbonly + true + bin\$(Configuration)\$(Framework)\ + TRACE + prompt + 4 + bin\$(Configuration)\$(Framework)\FlatFile.Tests.XML + + ..\packages\FakeItEasy.2.2.0\lib\net40\FakeItEasy.dll