diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 299887e..79a1040 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,20 +37,21 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDKs (8.0, 9.0, 10.0) + - name: Setup .NET SDKs (8.0, 9.0, 10.0, 11.0) uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: dotnet-version: | 8.0.x 9.0.x 10.0.x + 11.0.x cache: true cache-dependency-path: "**/*.csproj" # The WPF tester targets *-windows, so on Linux/macOS we build only the # cross-platform projects. CHDSharpTest spawns the CLI from # CHDSharpCli/bin///CHDSharp.dll, so it must be built first - # in the same configuration and for all three target frameworks. + # in the same configuration and for all four target frameworks. - name: Build (cross-platform projects) if: runner.os != 'Windows' run: | @@ -83,13 +84,14 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDKs (8.0, 9.0, 10.0) + - name: Setup .NET SDKs (8.0, 9.0, 10.0, 11.0) uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: dotnet-version: | 8.0.x 9.0.x 10.0.x + 11.0.x cache: true cache-dependency-path: "**/*.csproj" @@ -134,10 +136,10 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" @@ -159,7 +161,7 @@ jobs: retention-days: 14 coverage: - name: coverage (net10.0) + name: coverage (net11.0) runs-on: ubuntu-24.04 timeout-minutes: 45 @@ -169,18 +171,18 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" - - name: Build CLI and test suites (net10.0) + - name: Build CLI and test suites (net11.0) run: | - dotnet build CHDSharpCli/CHDSharpCli.csproj -c Release -f net10.0 -warnaserror - dotnet build CHDSharpTest/CHDSharpTest.csproj -c Release -f net10.0 -warnaserror - dotnet build CHDSharpEncoderTest/CHDSharpEncoderTest.csproj -c Release -f net10.0 -warnaserror + dotnet build CHDSharpCli/CHDSharpCli.csproj -c Release -f net11.0 -warnaserror + dotnet build CHDSharpTest/CHDSharpTest.csproj -c Release -f net11.0 -warnaserror + dotnet build CHDSharpEncoderTest/CHDSharpEncoderTest.csproj -c Release -f net11.0 -warnaserror - name: Install dotnet-coverage run: dotnet tool install --global dotnet-coverage --version 18.12.0 @@ -190,9 +192,9 @@ jobs: set -euo pipefail export PATH="$PATH:$HOME/.dotnet/tools" mkdir -p coverage - dotnet-coverage collect "dotnet test CHDSharpTest/CHDSharpTest.csproj -c Release -f net10.0 --no-build" -f cobertura -o coverage/lib.cobertura.xml --nologo + dotnet-coverage collect "dotnet test CHDSharpTest/CHDSharpTest.csproj -c Release -f net11.0 --no-build" -f cobertura -o coverage/lib.cobertura.xml --nologo # Instrumentation invalidates wall-clock assertions, so skip the one timing benchmark. - dotnet-coverage collect "dotnet test CHDSharpEncoderTest/CHDSharpEncoderTest.csproj -c Release -f net10.0 --no-build --filter FullyQualifiedName!~ParallelEncode_IsFasterThanSingleThreaded" -f cobertura -o coverage/encoder.cobertura.xml --nologo + dotnet-coverage collect "dotnet test CHDSharpEncoderTest/CHDSharpEncoderTest.csproj -c Release -f net11.0 --no-build --filter FullyQualifiedName!~ParallelEncode_IsFasterThanSingleThreaded" -f cobertura -o coverage/encoder.cobertura.xml --nologo dotnet-coverage merge coverage/lib.cobertura.xml coverage/encoder.cobertura.xml -f cobertura -o coverage/coverage.cobertura.xml --nologo - name: Upload coverage report @@ -214,10 +216,10 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" @@ -252,18 +254,18 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" - - name: Build battle harness (net10.0) - run: dotnet build CHDSharpBattleTest/CHDSharpBattleTest.csproj -c Release -f net10.0 -warnaserror + - name: Build battle harness (net11.0) + run: dotnet build CHDSharpBattleTest/CHDSharpBattleTest.csproj -c Release -f net11.0 -warnaserror - name: Run quick chdman parity battle - run: dotnet run --project CHDSharpBattleTest -c Release --framework net10.0 --no-build -- --chdman CHDSharpTester/chdman.exe --quick --no-keep + run: dotnet run --project CHDSharpBattleTest -c Release --framework net11.0 --no-build -- --chdman CHDSharpTester/chdman.exe --quick --no-keep - name: Upload battle artifacts on failure if: failure() diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 8f013a1..6c170d0 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -38,10 +38,10 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" @@ -52,7 +52,7 @@ jobs: queries: security-extended - name: Build for CodeQL - run: dotnet build CHDSharpCli/CHDSharpCli.csproj -c Release -f net10.0 + run: dotnet build CHDSharpCli/CHDSharpCli.csproj -c Release -f net11.0 - name: Perform CodeQL analysis uses: github/codeql-action/analyze@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3 diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 065cfbd..f0b4eed 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -43,10 +43,10 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 + - name: Setup .NET SDK 11 uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: - dotnet-version: "10.0.x" + dotnet-version: "11.0.x" cache: true cache-dependency-path: "**/*.csproj" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ea886b..5e2fbba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,12 @@ # Builds and publishes a CHDSharp release from a version tag: -# - six platform bundles (framework-dependent single-file CLI) attached to the GitHub release +# - six platform bundles (framework-dependent single-file CLI) attached to the GitHub release: +# Windows .zip, Linux .tar.gz, macOS .dmg # - build provenance attestations for the bundles and the NuGet package # - the CHDSharp NuGet package # - the docs/ folder synced to the GitHub wiki (Pages is deployed by pages.yml) # -# Assets are named CHDSharp_-_v.zip - the exact names the CLI's -# built-in update check (VersionCheckService) looks up via the GitHub releases API. +# Assets are named CHDSharp_-_v. - the exact names the +# CLI's built-in update check (VersionCheckService) looks up via the GitHub releases API. name: Release on: @@ -21,9 +22,48 @@ concurrency: jobs: bundles: - name: Bundles & GitHub release - runs-on: ubuntu-24.04 + name: bundles (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + rids: linux-x64,linux-arm64 + - os: windows-latest + rids: win-x64,win-arm64 + - os: macos-latest + rids: osx-x64,osx-arm64 + runs-on: ${{ matrix.os }} timeout-minutes: 60 + + steps: + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + + - name: Setup .NET SDK 11 + uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 + with: + dotnet-version: "11.0.x" + + - name: Build release bundles + shell: pwsh + run: ./scripts/package-release.ps1 -Rids ${{ matrix.rids }} -OutputPath dist + + - name: Upload bundles + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: bundles-${{ matrix.os }} + path: dist/* + if-no-files-found: error + retention-days: 7 + + release: + name: GitHub release + needs: bundles + runs-on: ubuntu-24.04 + timeout-minutes: 30 permissions: contents: write id-token: write @@ -38,11 +78,6 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDK 10 - uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 - with: - dotnet-version: "10.0.x" - - name: Verify tag matches Directory.Build.props shell: pwsh run: | @@ -51,14 +86,19 @@ jobs: if ($tag -ne "v$version") { throw "Tag '$tag' does not match version 'v$version' in Directory.Build.props" } Write-Host "Releasing v$version" - - name: Build release bundles - shell: pwsh - run: ./scripts/package-release.ps1 -OutputPath dist + - name: Download bundles + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + path: dist + merge-multiple: true + + - name: List bundles + run: ls -lh dist - name: Attest bundle provenance uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4.2.2 with: - subject-path: "dist/*.zip" + subject-path: "dist/*" - name: Create GitHub release and upload bundles env: @@ -70,12 +110,12 @@ jobs: if ! gh release view "$tag" >/dev/null 2>&1; then gh release create "$tag" --title "CHDSharp v$ver" --notes-file WhatsNew.md fi - gh release upload "$tag" dist/*.zip --clobber + gh release upload "$tag" dist/* --clobber gh release view "$tag" --json url,assets --jq '.url, (.assets[]?.name)' nuget: name: NuGet publish - needs: bundles + needs: release runs-on: ubuntu-24.04 timeout-minutes: 30 permissions: @@ -92,13 +132,14 @@ jobs: with: persist-credentials: false - - name: Setup .NET SDKs (8.0, 9.0, 10.0) + - name: Setup .NET SDKs (8.0, 9.0, 10.0, 11.0) uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 with: dotnet-version: | 8.0.x 9.0.x 10.0.x + 11.0.x - name: Pack and push to NuGet env: @@ -125,7 +166,7 @@ jobs: wiki: name: Wiki & Pages - needs: bundles + needs: release runs-on: ubuntu-24.04 timeout-minutes: 30 permissions: diff --git a/AGENTS.md b/AGENTS.md index 6c98d23..0661049 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,8 +32,8 @@ the CHD (Compressed Hunks of Data) disk-image format used by MAME. ## Build / test / run -Requires .NET SDK 8 or later (`global.json` rolls forward; targets `net8.0;net9.0;net10.0`, -LangVersion 14). +Requires .NET SDK 11 or later (`global.json` rolls forward; targets +`net8.0;net9.0;net10.0;net11.0`, LangVersion 15). ```bash dotnet build -c Release # whole solution @@ -136,7 +136,7 @@ matches `Directory.Build.props`. ```bash dotnet build -c Release dotnet test - dotnet run --project CHDSharpBattleTest -c Release --framework net10.0 + dotnet run --project CHDSharpBattleTest -c Release --framework net11.0 jb inspectcode CSharp_CHDSharp.sln --severity=WARNING # must report 0 findings ``` @@ -149,29 +149,30 @@ matches `Directory.Build.props`. pwsh scripts/package-release.ps1 ``` - Writes `CHDSharp__v.zip` for win/linux/osx × x64/arm64 into - `CHDSharpLib/bin/Release` (the default output path) without deleting other files there. Each - bundle gets the single framework-dependent binary (the .NET runtime is **not** embedded) plus - `LICENSE.txt`, `README.md`, `README.txt` and `WhatsNew.md`. Asset names must match - `VersionCheckService.GetExpectedAssetName`: - `CHDSharp_{win|linux|osx}-{x64|arm64}_v.zip`. + Writes the platform-native bundle for win/linux/osx × x64/arm64 into + `CHDSharpLib/bin/Release` (the default output path) without deleting other files there: + `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS. Each bundle gets the single + framework-dependent binary (the .NET runtime is **not** embedded) plus `LICENSE.txt`, + `README.md`, `README.txt` and `WhatsNew.md`. macOS `.dmg` bundles require macOS (use `-Rids` + on other hosts). Asset names must match `VersionCheckService.GetExpectedAssetName`: + `CHDSharp_{win|linux|osx}-{x64|arm64}_v.`. 6. **Tag and push**: ```bash - git tag -a v1.5.2 -m "CHDSharp v1.5.2" - git push origin main v1.5.2 + git tag -a v1.7.0 -m "CHDSharp v1.7.0" + git push origin main v1.7.0 ``` - `release.yml` verifies the tag against `Directory.Build.props`, rebuilds the six bundles, - creates the GitHub release with `WhatsNew.md` as the body, uploads the assets, publishes the - NuGet package (skipped when the version already exists), syncs the wiki and - deploys the documentation site (`pages.yml`). + `release.yml` verifies the tag against `Directory.Build.props`, rebuilds the six bundles on + native runners (Windows `.zip`, Linux `.tar.gz`, macOS `.dmg`), creates the GitHub release + with `WhatsNew.md` as the body, uploads the assets, publishes the NuGet package (skipped when + the version already exists), syncs the wiki and deploys the documentation site (`pages.yml`). 7. **Verify the release**: ```bash - gh release view v1.5.2 + gh release view v1.7.0 gh run list --workflow=release.yml --limit 1 (Invoke-RestMethod https://api.nuget.org/v3-flatcontainer/chdsharp/index.json).versions ``` @@ -186,15 +187,15 @@ Pages rebuild request; needs `repo` scope). `.github/workflows/ci.yml` runs on every push to `main`, every pull request, and manual dispatch: -- **`build & test`** - Linux/macOS/Windows matrix; installs the .NET 8/9/10 SDKs, builds with +- **`build & test`** - Linux/macOS/Windows matrix; installs the .NET 8/9/10/11 SDKs, builds with `-warnaserror` (NuGet audit is on), and runs both xUnit suites (`CHDSharpTest`, - `CHDSharpEncoderTest`) for all three target frameworks. The CLI is built first because + `CHDSharpEncoderTest`) for all four target frameworks. The CLI is built first because `CHDSharpTest` spawns `CHDSharpCli/bin///CHDSharp.dll`; the Windows job also builds the full solution (WPF tester, battle harness, benchmark). - **`quality`** - Windows; installs JetBrains ReSharper GlobalTools and fails on any `jb inspectcode --severity=WARNING` finding, uploading the SARIF to code scanning. - **`package`** - packs `CHDSharpLib`, checks the `.nupkg` contents, and uploads it as an artifact. -- **`coverage`** - collects merged Cobertura coverage for both suites on `net10.0`. +- **`coverage`** - collects merged Cobertura coverage for both suites on `net11.0`. - **`docs build (Jekyll + DocFX)`** - builds the Jekyll site with `--strict_front_matter`, then generates the DocFX API reference (`scripts/build-api-docs.ps1`). - **`chdman parity (smoke)`** - Windows; runs the quick battle harness against diff --git a/CHDSharpBattleTest/CHDSharpBattleTest.csproj b/CHDSharpBattleTest/CHDSharpBattleTest.csproj index 0667dd9..2db9add 100644 --- a/CHDSharpBattleTest/CHDSharpBattleTest.csproj +++ b/CHDSharpBattleTest/CHDSharpBattleTest.csproj @@ -1,10 +1,10 @@ Exe - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 enable enable - latest + 15 CHDSharpBattleTest CHDSharpBattleTest en @@ -68,7 +68,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CHDSharpBenchmark/CHDSharpBenchmark.csproj b/CHDSharpBenchmark/CHDSharpBenchmark.csproj index 6bb0aa5..d977aa5 100644 --- a/CHDSharpBenchmark/CHDSharpBenchmark.csproj +++ b/CHDSharpBenchmark/CHDSharpBenchmark.csproj @@ -1,7 +1,7 @@ Exe - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 CHDSharpBenchmark @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CHDSharpBenchmark/README.md b/CHDSharpBenchmark/README.md index 1a75d1d..f3a8c62 100644 --- a/CHDSharpBenchmark/README.md +++ b/CHDSharpBenchmark/README.md @@ -40,13 +40,13 @@ Decode benchmarks prefer the standard single-codec V5 file names (`v5_zlib.chd`, ```powershell # all benchmark groups (BenchmarkDotNet, ShortRun config) -dotnet run --project CHDSharpBenchmark -c Release --framework net10.0 +dotnet run --project CHDSharpBenchmark -c Release --framework net11.0 # only the encode group, only zstd cases -dotnet run --project CHDSharpBenchmark -c Release --framework net10.0 -- --filter *Encode* --filter *zstd* +dotnet run --project CHDSharpBenchmark -c Release --framework net11.0 -- --filter *Encode* --filter *zstd* # publishing-grade numbers (more iterations) -dotnet run --project CHDSharpBenchmark -c Release --framework net10.0 -- --job LongRun +dotnet run --project CHDSharpBenchmark -c Release --framework net11.0 -- --job LongRun ``` BenchmarkDotNet exports results to `BenchmarkDotNet.Artifacts/results/` (GitHub + HTML + CSV) @@ -62,7 +62,7 @@ per operation (the proxy for encode peak memory). Compares the library against MAME's `chdman.exe` (wall-clock, median of N runs): ```powershell -dotnet run --project CHDSharpBenchmark -c Release --framework net10.0 -- --chdman chdman.exe +dotnet run --project CHDSharpBenchmark -c Release --framework net11.0 -- --chdman chdman.exe ``` The harness runs four passes: diff --git a/CHDSharpCli/CHDSharpCli.csproj b/CHDSharpCli/CHDSharpCli.csproj index 3af18ca..88b58c7 100644 --- a/CHDSharpCli/CHDSharpCli.csproj +++ b/CHDSharpCli/CHDSharpCli.csproj @@ -1,7 +1,7 @@ Exe - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 CHDSharp CHDSharp CHDSharpCli @@ -11,7 +11,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/CHDSharpCli/README.md b/CHDSharpCli/README.md index 6ac70de..cc791fc 100644 --- a/CHDSharpCli/README.md +++ b/CHDSharpCli/README.md @@ -6,7 +6,7 @@ [![GitHub issues](https://img.shields.io/github/issues/purelogiccode/CHDSharp)](https://github.com/purelogiccode/CHDSharp/issues) [![Last commit](https://img.shields.io/github/last-commit/purelogiccode/CHDSharp)](https://github.com/purelogiccode/CHDSharp/commits/main) [![Release](https://img.shields.io/github/v/release/purelogiccode/CHDSharp?color=blue)](https://github.com/purelogiccode/CHDSharp/releases/latest) -[![.NET](https://img.shields.io/badge/.NET-8.0_|_9.0_|_10.0-blueviolet)](https://dotnet.microsoft.com/) +[![.NET](https://img.shields.io/badge/.NET-8.0_|_9.0_|_10.0_|_11.0-blueviolet)](https://dotnet.microsoft.com/) [![Platform](https://img.shields.io/badge/platform-Windows_|_Linux_|_macOS-lightgrey)](../README.md#building) [![chdman parity](https://img.shields.io/badge/chdman%20parity-100%25%20byte--identical-brightgreen)](../docs/chdman-parity.md) [![License](https://img.shields.io/badge/license-MIT_%2B_LGPL--2.1_component-blue)](../LICENSE.txt) @@ -17,7 +17,7 @@ The binary is named `CHDSharp` (e.g. `CHDSharp.exe` on Windows). It accepts the same subcommands and options as MAME's `chdman`, plus additional convenience commands. -> **v1.6.3** - expected `createcd` input failures no longer create bug reports: malformed ISO/CUE/GDI/TOC images, truncated BIN/WAV sources and missing referenced files keep their unchanged console text and exit code but are tagged as user errors. Other I/O and runtime failures are still reported. Six platform bundles are attached to every release (`CHDSharp_-_v.zip`). Release bundles are framework-dependent single-file binaries and require the .NET 10 runtime; the library targets `net8.0` / `net9.0` / `net10.0`. +> **v1.7.0** - the CLI now runs on .NET 11 and ships native platform bundles: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS. Release bundles are framework-dependent single-file binaries and require the .NET 11 runtime; the library targets `net8.0` / `net9.0` / `net10.0` / `net11.0`. No command-line behavior changed in this release. --- @@ -484,14 +484,14 @@ When launched by double-clicking the executable (no arguments), the application ## Building ```bash -# Build (requires .NET 8.0+ SDK) +# Build (requires .NET 11.0+ SDK) dotnet build CHDSharpCli/CHDSharpCli.csproj -c Release # Run dotnet run --project CHDSharpCli -- info -i game.chd # Run the built executable (the binary is named CHDSharp) -CHDSharpCli/bin/Release/net8.0/CHDSharp.exe info -i game.chd +CHDSharpCli/bin/Release/net11.0/CHDSharp.exe info -i game.chd ``` ### Dependencies diff --git a/CHDSharpCli/VersionCheckService.cs b/CHDSharpCli/VersionCheckService.cs index c5e85c9..44f9a37 100644 --- a/CHDSharpCli/VersionCheckService.cs +++ b/CHDSharpCli/VersionCheckService.cs @@ -88,7 +88,9 @@ private static async Task CheckAsync() /// /// Builds the release-asset name for the current platform, matching the bundles /// produced by scripts/package-release.ps1 and attached to GitHub releases: - /// CHDSharp_{os}-{arch}_v{version}.zip (e.g. CHDSharp_win-x64_v1.5.0.zip). + /// CHDSharp_{os}-{arch}_v{version} with a .zip (Windows), + /// .tar.gz (Linux) or .dmg (macOS) extension + /// (e.g. CHDSharp_linux-x64_v1.7.0.tar.gz). /// /// The release version whose bundle should be looked up. /// The expected asset file name for this OS and CPU architecture. @@ -99,6 +101,11 @@ private static string GetExpectedAssetName(Version version) : OperatingSystem.IsMacOS() ? "osx" : "win"; + var extension = OperatingSystem.IsWindows() + ? "zip" + : OperatingSystem.IsMacOS() + ? "dmg" + : "tar.gz"; var arch = RuntimeInformation.OSArchitecture switch { Architecture.Arm64 => "arm64", @@ -106,6 +113,6 @@ private static string GetExpectedAssetName(Version version) _ => "x64" }; - return $"CHDSharp_{os}-{arch}_v{version}.zip"; + return $"CHDSharp_{os}-{arch}_v{version}.{extension}"; } } \ No newline at end of file diff --git a/CHDSharpEncoderTest/CHDSharpEncoderTest.csproj b/CHDSharpEncoderTest/CHDSharpEncoderTest.csproj index 25e03f7..20f6d51 100644 --- a/CHDSharpEncoderTest/CHDSharpEncoderTest.csproj +++ b/CHDSharpEncoderTest/CHDSharpEncoderTest.csproj @@ -1,6 +1,6 @@ - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 Exe CHDSharpEncoderTest + true MIT false diff --git a/README.md b/README.md index bfb74bf..33321ed 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ [![Release](https://img.shields.io/github/v/release/purelogiccode/CHDSharp?color=blue)](https://github.com/purelogiccode/CHDSharp/releases/latest) [![NuGet](https://img.shields.io/nuget/v/CHDSharp?color=blue)](https://www.nuget.org/packages/CHDSharp/) [![NuGet Downloads](https://img.shields.io/nuget/dt/CHDSharp?color=blue)](https://www.nuget.org/packages/CHDSharp/) -[![.NET](https://img.shields.io/badge/.NET-8.0_|_9.0_|_10.0-blueviolet)](https://dotnet.microsoft.com/) +[![.NET](https://img.shields.io/badge/.NET-8.0_|_9.0_|_10.0_|_11.0-blueviolet)](https://dotnet.microsoft.com/) [![Platform](https://img.shields.io/badge/platform-Windows_|_Linux_|_macOS-lightgrey)](#building) [![chdman parity](https://img.shields.io/badge/chdman%20parity-100%25%20byte--identical-brightgreen)](docs/chdman-parity.md) [![License](https://img.shields.io/badge/license-MIT_%2B_LGPL--2.1_component-blue)](LICENSE.txt) @@ -26,6 +26,13 @@ Supports every CHD format version (V1–V5), all 10 compression codecs, parent/c --- +## What's New in v1.7.0 + +- **.NET 11 and C# 15** - every project now multi-targets `net8.0`/`net9.0`/`net10.0`/`net11.0` (`net11.0-windows` for the WPF tester) and builds with `LangVersion 15`. The NuGet package includes `net11.0` assemblies for the library and all vendored codecs. Runtime packages (`Microsoft.Extensions.Logging.Abstractions`, `System.IO.Hashing`) are 11.0.0; their `netstandard2.0` assets keep the `net8.0`/`net9.0` targets working. +- **Native CLI bundles** - Windows ships `.zip`, Linux ships `.tar.gz` and macOS ships `.dmg`. The update check resolves the correct extension per platform, and the release workflow builds each platform's bundles on its native runner. +- **Tooling** - Dependabot updates for GitHub Actions, `Meziantou.Analyzer 3.0.339` and `xunit.v3 4.0.3`; the Pages workflow now uses the .NET 11 SDK so DocFX keeps building against `net11.0`. +- **Verification** - 4,220 library tests + 455 encoder tests on each of the four target frameworks (18,700 total), `jb inspectcode` 0 findings, quick battle harness 905/905 checks. No public API or encoder-output changes. + ## What's New in v1.6.3 - **Expected `createcd` input errors stay out of the Bug Report API** - malformed ISO/CUE/GDI/TOC files, truncated BIN/WAV sources and missing referenced files are now logged through `logger.UserError(...)`. The console text and exit code are unchanged (the same input is rejected by `chdman` too), but these diagnostics are no longer POSTed as application defects. Other I/O and runtime failures are still reported. @@ -135,9 +142,9 @@ See [docs/ReleaseNotes.md](docs/ReleaseNotes.md) for the full changelog. dotnet add package CHDSharp ``` -Targets `net8.0`, `net9.0`, and `net10.0`. Zero native dependencies — every codec (zlib, lzma, huffman, flac, zstd, AVHuff) is implemented in pure C#. +Targets `net8.0`, `net9.0`, `net10.0`, and `net11.0`. Zero native dependencies — every codec (zlib, lzma, huffman, flac, zstd, AVHuff) is implemented in pure C#. -Prebuilt CLI bundles for Windows, Linux and macOS (x64 + ARM64) are attached to each [release](https://github.com/purelogiccode/CHDSharp/releases/latest) — framework-dependent single-file binaries that require the [.NET 10 runtime](https://dotnet.microsoft.com/download/dotnet/10.0). See [WhatsNew.md](WhatsNew.md) for what changed in the latest release. +Prebuilt CLI bundles for Windows, Linux and macOS (x64 + ARM64) are attached to each [release](https://github.com/purelogiccode/CHDSharp/releases/latest) — framework-dependent single-file binaries that require the [.NET 11 runtime](https://dotnet.microsoft.com/download/dotnet/11.0). Windows bundles are `.zip`, Linux bundles are `.tar.gz` and macOS bundles are `.dmg`; each contains `LICENSE.txt`, `README.md`, `README.txt` and `WhatsNew.md`. See [WhatsNew.md](WhatsNew.md) for what changed in the latest release. --- @@ -631,7 +638,7 @@ The full wiki lives in [`docs/`](docs/README.md): | Project | Type | Description | |---------|------|-------------| -| `CHDSharpTest` | xUnit | Unit + corpus tests (4,216 tests per TFM, 30 CHD fixtures) | +| `CHDSharpTest` | xUnit | Unit + corpus tests (4,220 tests per TFM, 30 CHD fixtures) | | `CHDSharpEncoderTest` | xUnit | Encoder tests (455 tests, chdman cross-validation) | | `CHDSharpBattleTest` | Console | Battle harness: 3,174/3,174 (synthetic) + 3003/3003 (real-world) checks vs `chdman` | | `CHDSharpTester` | WPF | Interactive batch verification against `chdman` | @@ -670,7 +677,7 @@ dotnet pack -c Release CHDSharpLib/ jb inspectcode CSharp_CHDSharp.sln --severity=WARNING ``` -Requires [.NET 8.0 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) or later. Works on Windows, Linux, and macOS. +Requires [.NET 11.0 SDK](https://dotnet.microsoft.com/download/dotnet/11.0) or later. Works on Windows, Linux, and macOS. --- diff --git a/SECURITY.md b/SECURITY.md index a9ad531..58ca38b 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,11 +4,11 @@ | Version | Supported | |---------|-----------| -| 1.5.x | :white_check_mark: | -| < 1.5 | :x: | +| 1.7.x | :white_check_mark: | +| < 1.7 | :x: | Only the latest released minor line receives security fixes. The library targets -`net8.0`, `net9.0`, and `net10.0`; the CLI ships as framework-dependent bundles for +`net8.0`, `net9.0`, `net10.0`, and `net11.0`; the CLI ships as framework-dependent bundles for Windows, Linux, and macOS (x64/arm64). ## Reporting a vulnerability @@ -82,7 +82,9 @@ Out of scope: ## Verifying a release ```bash -gh attestation verify CHDSharp_win-x64_v1.5.2.zip --repo purelogiccode/CHDSharp +gh attestation verify CHDSharp_win-x64_v1.7.0.zip --repo purelogiccode/CHDSharp +gh attestation verify CHDSharp_linux-x64_v1.7.0.tar.gz --repo purelogiccode/CHDSharp +gh attestation verify CHDSharp_osx-arm64_v1.7.0.dmg --repo purelogiccode/CHDSharp ``` NuGet packages are published from the tag workflow; compare the package version, diff --git a/VendoredFlac/VendoredFlac.csproj b/VendoredFlac/VendoredFlac.csproj index 239c731..05a54a1 100644 --- a/VendoredFlac/VendoredFlac.csproj +++ b/VendoredFlac/VendoredFlac.csproj @@ -1,7 +1,7 @@ Library - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 VendoredFlac true @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VendoredLZMA/VendoredLZMA.csproj b/VendoredLZMA/VendoredLZMA.csproj index 4eaf010..05e8820 100644 --- a/VendoredLZMA/VendoredLZMA.csproj +++ b/VendoredLZMA/VendoredLZMA.csproj @@ -1,7 +1,7 @@ Library - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 VendoredLZMA true @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VendoredZLib/VendoredZLib.csproj b/VendoredZLib/VendoredZLib.csproj index 58420c1..c44552f 100644 --- a/VendoredZLib/VendoredZLib.csproj +++ b/VendoredZLib/VendoredZLib.csproj @@ -1,7 +1,7 @@ Library - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 VendoredZLib true MA0202 @@ -11,7 +11,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/VendoredZSTD/VendoredZSTD.csproj b/VendoredZSTD/VendoredZSTD.csproj index a5552c6..10cb30a 100644 --- a/VendoredZSTD/VendoredZSTD.csproj +++ b/VendoredZSTD/VendoredZSTD.csproj @@ -1,7 +1,7 @@ Library - net8.0;net9.0;net10.0 + net8.0;net9.0;net10.0;net11.0 VendoredZSTD true false @@ -17,7 +17,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/WhatsNew.md b/WhatsNew.md index da0375c..9e47a14 100644 --- a/WhatsNew.md +++ b/WhatsNew.md @@ -1,11 +1,10 @@ -# CHDSharp v1.6.3 - What's New +# CHDSharp v1.7.0 - What's New -**Released:** 2026-11-03 - [Full changelog](docs/ReleaseNotes.md) - [NuGet](https://www.nuget.org/packages/CHDSharp/1.6.3) +**Released:** 2026-11-13 - [Full changelog](docs/ReleaseNotes.md) - [NuGet](https://www.nuget.org/packages/CHDSharp/1.7.0) -CHDSharp v1.6.3 is a small diagnostics release. `createcd` now keeps expected malformed-input -failures out of the Bug Report API while preserving the exact `chdman`-compatible console text and -exit codes. The vendored codec libraries are explicitly documented as frozen, and no encoder output -changed. +CHDSharp v1.7.0 moves the complete solution to **.NET 11** and **C# 15**, keeps the +`net8.0`/`net9.0` targets for current consumers, and switches the CLI bundles to each +platform's native archive format. No library API or encoder output changed. --- @@ -13,49 +12,64 @@ changed. | Platform | Bundle | |----------|--------| -| Windows x64 | [`CHDSharp_win-x64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_win-x64_v1.6.3.zip) | -| Windows ARM64 | [`CHDSharp_win-arm64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_win-arm64_v1.6.3.zip) | -| Linux x64 | [`CHDSharp_linux-x64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_linux-x64_v1.6.3.zip) | -| Linux ARM64 | [`CHDSharp_linux-arm64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_linux-arm64_v1.6.3.zip) | -| macOS Intel | [`CHDSharp_osx-x64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_osx-x64_v1.6.3.zip) | -| macOS Apple Silicon | [`CHDSharp_osx-arm64_v1.6.3.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.6.3/CHDSharp_osx-arm64_v1.6.3.zip) | +| Windows x64 | [`CHDSharp_win-x64_v1.7.0.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_win-x64_v1.7.0.zip) | +| Windows ARM64 | [`CHDSharp_win-arm64_v1.7.0.zip`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_win-arm64_v1.7.0.zip) | +| Linux x64 | [`CHDSharp_linux-x64_v1.7.0.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_linux-x64_v1.7.0.tar.gz) | +| Linux ARM64 | [`CHDSharp_linux-arm64_v1.7.0.tar.gz`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_linux-arm64_v1.7.0.tar.gz) | +| macOS Intel | [`CHDSharp_osx-x64_v1.7.0.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_osx-x64_v1.7.0.dmg) | +| macOS Apple Silicon | [`CHDSharp_osx-arm64_v1.7.0.dmg`](https://github.com/purelogiccode/CHDSharp/releases/download/v1.7.0/CHDSharp_osx-arm64_v1.7.0.dmg) | Every bundle contains a **framework-dependent single-file** `CHDSharp` / `CHDSharp.exe` build (the .NET runtime is **not** embedded) plus `LICENSE.txt`, `README.md`, `README.txt` -and this document. The [.NET 10 runtime](https://dotnet.microsoft.com/download/dotnet/10.0) +and this document. The [.NET 11 runtime](https://dotnet.microsoft.com/download/dotnet/11.0) is required. --- -## Fixed: expected `createcd` input errors no longer become bug reports +## .NET 11 and C# 15 -A report showed `--createcd failed: "Unrecognized ISO sector size (...)"` being filed as an -application defect. That input is rejected by `chdman` too (`cdrom.cpp:2078`, `parse_iso`): a -raw ISO must be a multiple of 2048, 2336 or 2352 bytes. +- All 12 projects now multi-target `net8.0;net9.0;net10.0;net11.0` + (`net11.0-windows` for the WPF tester) and compile with `LangVersion 15`. +- The NuGet package ships `lib/net11.0` assemblies for `CHDSharpLib` and all four vendored + codec assemblies. +- CI, CodeQL, DocFX, the release pipeline and the documentation site all run on the .NET 11 SDK. +- The runtime packages (`Microsoft.Extensions.Logging.Abstractions`, `System.IO.Hashing`) and + SourceLink are at 11.0.0/11.0.100 for every target. The packages ship `netstandard2.0` assets, + so the `net8.0`/`net9.0` targets remain functional; their advisory TFM-support warnings are + suppressed centrally. -- `createcd` now logs `InvalidDataException` (malformed ISO/CUE/GDI/TOC, truncated BIN/WAV, - invalid source layout) and `FileNotFoundException` (missing referenced file) through - `logger.UserError(...)`. The event stays at warning level in the console and rolling file logs, - and the console text and exit code are unchanged, but it is no longer POSTed to the Bug Report - API. -- Other `ArgumentException` / `IOException` / `UnauthorizedAccessException` failures still use - `logger.Warning(...)` and are still reported. -- Regression test `Createcd_rejects_iso_size_that_is_not_sector_aligned` covers the reported - non-sector-aligned ISO path. +## Native CLI bundles -## Documentation: vendored codecs are frozen +- **Windows** stays `.zip`. +- **Linux** is now `.tar.gz`. +- **macOS** is now `.dmg` (built on a macOS runner; the disk image contains the binary and + the documentation files). +- `VersionCheckService` looks up the correct asset extension for the running platform, and + the release workflow builds each platform's bundles on its native runner before + publishing them together. -`AGENTS.md` now has a **Vendored codecs (frozen)** section: `VendoredFlac`, `VendoredLZMA`, -`VendoredZLib` and `VendoredZSTD` are kept byte-for-byte verbatim for `chdman` parity and may only -be edited when strictly necessary - never to satisfy an analyzer, formatter or InspectCode finding. -The existing InspectCode and `.editorconfig` exclusions remain in place. +## Tooling and dependencies + +- Dependabot updates: GitHub Actions (`setup-dotnet 6.1.0`, `github/codeql-action 4.39.3`, + `ruby/setup-ruby 1.338.0`), `Meziantou.Analyzer 3.0.339` and `xunit.v3 4.0.3`. +- The Pages workflow now uses the .NET 11 SDK, so the DocFX API reference keeps building + against the `net11.0` target. +- Documentation, `WhatsNew.md`, the per-project READMEs and `AGENTS.md` describe the + four target frameworks and the new bundle formats. ## Verification -- `dotnet build -c Release`: 0 warnings, 0 errors. -- `jb inspectcode --severity=WARNING --exclude="Vendored*/**"`: **0 findings**; no vendored sources - were modified. -- Library tests: **4,220 passed** and encoder tests: **455 passed** on each of `net8.0`, `net9.0` - and `net10.0`. -- Quick `chdman` parity battle: **905/905 checks passed**, byte-identical output. +- `dotnet build -c Release -warnaserror`: 0 warnings, 0 errors. +- `jb inspectcode --severity=WARNING --exclude="Vendored*/**"`: **0 findings**. +- Library tests: **4,220 passed** and encoder tests: **455 passed** on each of `net8.0`, + `net9.0`, `net10.0` and `net11.0` (**18,700 tests total**). +- Quick `chdman` parity battle on `net11.0`: **905/905 checks passed**, byte-identical output. - No public API changes and no encoder output changes. + +## Upgrade notes + +- Use the bundle matching your platform: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on + macOS. On Linux run `chmod +x CHDSharp` after extracting if needed; on macOS drag `CHDSharp` + out of the mounted disk image. +- The CLI's update check now expects the new asset names. Older releases remain downloadable + from the [releases page](https://github.com/purelogiccode/CHDSharp/releases). diff --git a/docfx.json b/docfx.json index 0694d84..6caded3 100644 --- a/docfx.json +++ b/docfx.json @@ -12,7 +12,7 @@ "dest": "docfx", "outputFormat": "mref", "properties": { - "TargetFramework": "net10.0" + "TargetFramework": "net11.0" } } ], diff --git a/docs/README.md b/docs/README.md index 33b542a..4866b20 100644 --- a/docs/README.md +++ b/docs/README.md @@ -37,7 +37,8 @@ CHDSharp is a pure C# implementation that reads and writes every CHD version wit | | | |---|---| | Package | [`CHDSharp`](https://www.nuget.org/packages/CHDSharp/) | -| Targets | `net8.0`, `net9.0`, `net10.0` | +| Targets | `net8.0`, `net9.0`, `net10.0`, `net11.0` | +| CLI bundles | `.zip` (Windows), `.tar.gz` (Linux), `.dmg` (macOS) | | Format versions | CHD V1 – V5 (read & write) | | Codecs | `zlib`, `lzma`, `huff`, `flac`, `zstd`, `avhu` + CD variants `cdzl`, `cdlz`, `cdfl`, `cdzs` | | Native dependencies | **none** | diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 6e78913..7bfad0b 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,5 +1,66 @@ # CHDSharp Release Notes +## CHDSharp v1.7.0 + +Platform and packaging release on top of v1.6.3. No public API or encoder-output changes. + +**Released:** 2026-11-13 - [NuGet](https://www.nuget.org/packages/CHDSharp/1.7.0) - +[CLI bundles](https://github.com/purelogiccode/CHDSharp/releases/tag/v1.7.0) + +### .NET 11 and C# 15 + +All projects now multi-target `net8.0;net9.0;net10.0;net11.0` (`net11.0-windows` for the WPF +tester) and compile with `LangVersion 15`. The package includes `lib/net11.0` assemblies for +`CHDSharpLib` and every vendored codec, and CI, CodeQL, DocFX and the release pipeline run on the +.NET 11 SDK. + +The runtime packages (`Microsoft.Extensions.Logging.Abstractions`, `System.IO.Hashing`) and +SourceLink are at 11.0.0/11.0.100 for every target. The runtime packages officially target +net10+, but ship `netstandard2.0` assets, so `net8.0`/`net9.0` remain functional; their advisory +TFM-support warnings are suppressed centrally in `Directory.Build.props`. + +### Platform-native CLI bundles + +- Windows remains `.zip`. +- Linux is now `.tar.gz`. +- macOS is now `.dmg`. +- `VersionCheckService` resolves the extension for the running platform, and the release + workflow builds Linux, Windows and macOS bundles on their native runners before a final + release job attests and publishes all six assets. +- `scripts/package-release.ps1` enforces that `.dmg` bundles are built on macOS, preserves the + executable bit for Unix binaries and updates the bundle `README.txt` accordingly. + +### Fixes from the release review + +- The Pages workflow now installs .NET 11; DocFX targets `net11.0`, so running it on the .NET 10 + SDK would have failed. +- `VersionCheckService` no longer looks up a `.zip` asset on Linux and macOS, where the new + bundles are `.tar.gz` and `.dmg`. +- Runtime package versions are unified at 11.0.0; their `netstandard2.0` assets keep the + `net8.0`/`net9.0` targets functional, and the advisory TFM-support warnings are suppressed + centrally instead of leaking into every project build. +- Documentation test counts, target-framework lists, bundle names and the supported-version table + were corrected. + +### Tooling + +Dependabot updates: GitHub Actions (`setup-dotnet 6.1.0`, `github/codeql-action 4.39.3`, +`ruby/setup-ruby 1.338.0`), `Meziantou.Analyzer 3.0.339` and `xunit.v3 4.0.3`. + +### Verification + +- `dotnet build -c Release -warnaserror`: 0 warnings, 0 errors. +- `jb inspectcode --severity=WARNING --exclude="Vendored*/**"`: 0 findings. +- Library tests: 4,220 passed and encoder tests: 455 passed on each of `net8.0`, `net9.0`, + `net10.0` and `net11.0` (18,700 total). +- Quick battle harness on `net11.0`: 905/905 checks, byte-identical `chdman` output. + +### Upgrade notes + +Use the bundle matching your platform: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS. +Linux users may need `chmod +x CHDSharp` after extracting; macOS users should copy `CHDSharp` out +of the mounted disk image. The CLI update check expects the new asset names. + ## CHDSharp v1.6.3 Diagnostics and documentation release on top of v1.6.2. No public API or encoder-output changes. diff --git a/docs/building.md b/docs/building.md index 6b05e6f..626a16e 100644 --- a/docs/building.md +++ b/docs/building.md @@ -10,7 +10,7 @@ How to build, test, pack, and publish every component of the repository. ## Prerequisites -- [.NET SDK 8.0](https://dotnet.microsoft.com/download/dotnet/8.0) or later (the solution targets `net8.0`, `net9.0`, and `net10.0`; the SDK's `rollForward` is set to `latestMajor` with prereleases allowed). +- [.NET SDK 11.0](https://dotnet.microsoft.com/download/dotnet/11.0) or later (the solution targets `net8.0`, `net9.0`, `net10.0`, and `net11.0`; the SDK's `rollForward` is set to `latestMajor` with prereleases allowed). - Works on Windows, Linux, and macOS. - No native toolchains are required — the library is 100% managed. @@ -32,7 +32,7 @@ CSharp_CHDSharp.sln ├── VendoredLZMA/ LZMA SDK C# port ├── VendoredFlac/ Pure C# FLAC encoder/decoder ├── VendoredZSTD/ Pure C# zstd 1.5.5 encoder/decoder (MAME parity) -└── Directory.Build.props Centralized versioning (1.6.3) and analyzer setup +└── Directory.Build.props Centralized versioning (1.7.0) and analyzer setup ``` --- @@ -52,14 +52,14 @@ dotnet build CHDSharpLib/CHDSharpLib.csproj -c Release ### Centralized versioning -`Directory.Build.props` defines a single `` (currently `1.6.3`) that all projects inherit, so `AssemblyVersion`, `FileVersion`, and the NuGet package version stay in sync automatically. +`Directory.Build.props` defines a single `` (currently `1.7.0`) that all projects inherit, so `AssemblyVersion`, `FileVersion`, and the NuGet package version stay in sync automatically. ### Code style & analyzers All projects enable: - `Nullable` + `ImplicitUsings`. -- `LangVersion 14`. +- `LangVersion 15`. - [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) (build-time analyzer, `PrivateAssets=all`). - `CHDSharpLib` additionally treats missing XML documentation (`CS1591`) as an error, so **all public API members must carry XML doc comments**. @@ -100,7 +100,7 @@ The inspection policy lives in the root `.editorconfig`: dotnet test # A single framework -dotnet test -f net10.0 +dotnet test -f net11.0 # A specific test class dotnet test --filter "FullyQualifiedName~CorpusTests" @@ -109,7 +109,7 @@ dotnet test --filter "FullyQualifiedName~CorpusTests" dotnet test -v detailed ``` -The suite contains **4,216 tests per target framework** (unit + corpus) that run against 30 deterministic CHD fixtures covering V1–V5 and every codec. See [Testing](testing.md). +The suite contains **4,220 tests per target framework** (unit + corpus) that run against 30 deterministic CHD fixtures covering V1–V5 and every codec. See [Testing](testing.md). The companion **encoder suite** (`CHDSharpEncoderTest`, 455 tests) validates CHD creation against `chdman.exe` — including 100 MB+ raw/CD round-trips: @@ -145,7 +145,7 @@ dotnet pack CHDSharpLib/CHDSharpLib.csproj -c Release The package (`CHDSharp..nupkg`) is written to `CHDSharpLib/bin/Release/`. It includes: -- The library DLL for `net8.0`, `net9.0`, and `net10.0`. +- The library DLL for `net8.0`, `net9.0`, `net10.0`, and `net11.0`. - The README (this wiki's sibling pages are referenced from it), the combined license file (`LICENSE.txt`), and the package icon. - Embedded PDBs (`DebugType=embedded`) and embedded SourceLink for debugging. - Deterministic, reproducible builds (`Deterministic=true`, `ContinuousIntegrationBuild` on GitHub Actions). @@ -154,11 +154,15 @@ The package (`CHDSharp..nupkg`) is written to `CHDSharpLib/bin/Release/ | Package | Version | Purpose | |---------|---------|---------| -| [Microsoft.Extensions.Logging.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/) | 10.0.13 (all TFMs) | Pluggable logging (optional) | -| [System.IO.Hashing](https://www.nuget.org/packages/System.IO.Hashing/) | 10.0.13 (all TFMs) | SHA1/MD5 hashing helpers | -| Microsoft.SourceLink.GitHub | 10.0.402 | SourceLink (build-time, `PrivateAssets=all`) | +| [Microsoft.Extensions.Logging.Abstractions](https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/) | 11.0.0 (all TFMs) | Pluggable logging (optional) | +| [System.IO.Hashing](https://www.nuget.org/packages/System.IO.Hashing/) | 11.0.0 (all TFMs) | SHA1/MD5 hashing helpers | +| Microsoft.SourceLink.GitHub | 11.0.100 | SourceLink (build-time, `PrivateAssets=all`) | -All codec dependencies are vendored in-repo as project references and bundled inside the package (the only runtime NuGet dependency is the optional `Microsoft.Extensions.Logging.Abstractions` logging abstraction): +The 11.0.0 packages target net10+, but ship `netstandard2.0` assets, so the `net8.0`/`net9.0` +targets remain functional; their advisory TFM-support warnings are suppressed in +`Directory.Build.props`. + +All codec dependencies are vendored in-repo as project references and bundled inside the package (the runtime NuGet dependencies are the optional `Microsoft.Extensions.Logging.Abstractions` logging abstraction and `System.IO.Hashing`): | Project | Purpose | |---------|---------| @@ -179,19 +183,25 @@ pwsh scripts/package-release.ps1 # One platform, custom output pwsh scripts/package-release.ps1 -Rids win-x64 -OutputPath dist + +# Native formats: .zip on Windows, .tar.gz on Linux, .dmg on macOS +pwsh scripts/package-release.ps1 -Rids linux-x64,linux-arm64 -OutputPath dist ``` For every runtime identifier the script publishes the CLI as a **framework-dependent single-file** binary (`--self-contained false -p:PublishSingleFile=true` — the .NET runtime is *not* embedded), appends `LICENSE.txt`, `README.md`, `README.txt` and -`WhatsNew.md`, and writes `CHDSharp__v.zip` (the exact asset name the CLI's -built-in update check looks up on GitHub releases, e.g. `CHDSharp_win-x64_v1.6.3.zip`). -Existing files in the output path are never deleted. The binary is named `CHDSharp` -(`CHDSharp.exe` on Windows); bundles require the .NET 10 runtime. +`WhatsNew.md`, and writes the platform-native bundle: `CHDSharp__v.zip` on +Windows, `.tar.gz` on Linux and `.dmg` on macOS (the exact asset names the CLI's built-in +update check looks up on GitHub releases, e.g. `CHDSharp_linux-x64_v1.7.0.tar.gz`). +Existing files in the output path are never deleted. macOS `.dmg` bundles must be built on +macOS. The binary is named `CHDSharp` (`CHDSharp.exe` on Windows); bundles require the +.NET 11 runtime. The `Release` GitHub Actions workflow (`.github/workflows/release.yml`) runs this script -on a version tag, creates the GitHub release, pushes the NuGet package, and syncs the -wiki — see [CI](#ci). +on a version tag with one native runner per platform, then attests and publishes all six +assets in a final release job, pushes the NuGet package, and syncs the wiki — see +[CI](#ci). --- @@ -228,10 +238,10 @@ requests a legacy Pages rebuild. The repository is set up for GitHub Actions (`ContinuousIntegrationBuild=true`), producing deterministic builds and SourceLink-enabled symbols. - **`ci.yml`** - the build + test gatekeeper, on every push to `main`, every pull request, and manual dispatch. The `CI gate` job aggregates: - - `build & test` across Ubuntu, macOS and Windows: builds the full solution on Windows and the cross-platform subset elsewhere with `-warnaserror` (NuGet audit covers direct and transitive packages), then runs both xUnit suites (`CHDSharpTest` - 4,216 tests per target framework - and `CHDSharpEncoderTest` - 455 tests) for all three TFMs. + - `build & test` across Ubuntu, macOS and Windows: builds the full solution on Windows and the cross-platform subset elsewhere with `-warnaserror` (NuGet audit covers direct and transitive packages), then runs both xUnit suites (`CHDSharpTest` - 4,220 tests per target framework - and `CHDSharpEncoderTest` - 455 tests) for all four TFMs. - `quality`: `jb inspectcode --severity=WARNING`, failing on any finding and uploading SARIF to code scanning. - `package`: `dotnet pack` plus a `.nupkg` content check, uploaded as an artifact. - - `coverage`: merged Cobertura coverage for both suites on `net10.0` (the wall-clock parallel-encode test is excluded because instrumentation invalidates its timing). + - `coverage`: merged Cobertura coverage for both suites on `net11.0` (the wall-clock parallel-encode test is excluded because instrumentation invalidates its timing). - `docs build (Jekyll + DocFX)`: builds `docs/` with `--strict_front_matter`, then generates the DocFX API reference, so broken XML docs or a broken `docfx.json` fail the gate. - `chdman parity (smoke)`: the quick battle harness against the checked-in `CHDSharpTester/chdman.exe`. - `Wiki sync` (on `main` only, after the gate): mirrors `docs/` to the wiki. The site itself is deployed by `pages.yml`. @@ -240,6 +250,6 @@ The repository is set up for GitHub Actions (`ContinuousIntegrationBuild=true`), - **`codeql.yml`** - CodeQL C# analysis (`security-extended`) plus GitHub Actions analysis on `main`, pull requests, and a weekly schedule. - **`dependency-review.yml`** - fails pull requests that add moderate-or-higher vulnerable dependencies. - **`scorecard.yml`** - OpenSSF Scorecard, published to the public API and code scanning. -- **`release.yml`** - the tag-triggered release pipeline: builds the six platform CLI bundles, attests their provenance, creates the GitHub release, publishes the NuGet package, and syncs this documentation to the wiki. See [Publish the CLI](#publish-the-cli-release-bundles). +- **`release.yml`** - the tag-triggered release pipeline: builds the six platform CLI bundles on native runners (Windows `.zip`, Linux `.tar.gz`, macOS `.dmg`), attests their provenance, creates the GitHub release, publishes the NuGet package, and syncs this documentation to the wiki. See [Publish the CLI](#publish-the-cli-release-bundles). Repository security settings (Dependabot alerts/security updates, secret scanning with push protection, private vulnerability reporting, read-only workflow permissions, and mandatory full-SHA action pinning) are described in [`SECURITY.md`](https://github.com/purelogiccode/CHDSharp/blob/main/SECURITY.md). diff --git a/docs/getting-started.md b/docs/getting-started.md index e5fb184..d2bdf96 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -22,11 +22,11 @@ or via the Package Manager Console: Install-Package CHDSharp ``` -The package targets `net8.0`, `net9.0`, and `net10.0` and has **no native dependencies**. Every codec — including Zstd and AVHuff — is implemented in managed code and vendored in-repo as pure C# projects, so all codec assemblies ship inside the package. The only runtime NuGet dependency is the optional `Microsoft.Extensions.Logging.Abstractions` logging abstraction (and `System.IO.Hashing` for hashing helpers). +The package targets `net8.0`, `net9.0`, `net10.0`, and `net11.0` and has **no native dependencies**. Every codec — including Zstd and AVHuff — is implemented in managed code and vendored in-repo as pure C# projects, so all codec assemblies ship inside the package. The runtime NuGet dependencies are the optional `Microsoft.Extensions.Logging.Abstractions` logging abstraction and `System.IO.Hashing` for hashing helpers. ### Prebuilt CLI (no build required) -Every [release](https://github.com/purelogiccode/CHDSharp/releases/latest) attaches six CLI bundles — `CHDSharp_-_v.zip` for Windows, Linux and macOS on x64 and ARM64. Each bundle is a framework-dependent **single-file** binary (`CHDSharp` / `CHDSharp.exe`) alongside `LICENSE.txt`, `README.md`, `README.txt` and `WhatsNew.md`, and requires the [.NET 10 runtime](https://dotnet.microsoft.com/download/dotnet/10.0). On Linux/macOS run `chmod +x CHDSharp` if the binary is not executable after unzipping. +Every [release](https://github.com/purelogiccode/CHDSharp/releases/latest) attaches six CLI bundles for Windows, Linux and macOS on x64 and ARM64: `.zip` on Windows, `.tar.gz` on Linux and `.dmg` on macOS. Each bundle is a framework-dependent **single-file** binary (`CHDSharp` / `CHDSharp.exe`) alongside `LICENSE.txt`, `README.md`, `README.txt` and `WhatsNew.md`, and requires the [.NET 11 runtime](https://dotnet.microsoft.com/download/dotnet/11.0). On Windows expand the archive; on Linux extract with `tar -xzf` and run `chmod +x CHDSharp` if needed; on macOS open the disk image and copy `CHDSharp` out of it. ### From source diff --git a/docs/libchdr-comparison.md b/docs/libchdr-comparison.md index c52b4b4..b432b29 100644 --- a/docs/libchdr-comparison.md +++ b/docs/libchdr-comparison.md @@ -59,7 +59,7 @@ CHDSharp vs the two other independent CHD implementations (chd-rs 0.3.4 and CHDl | Multi-hash output (SHA-256/CRC32/XXH3) | ✅ SHA1/SHA256/CRC32/XXH3 | ❌ | ✅ SHA1/MD5/CRC32/SHA256/XXH3 | 🟡 SHA1/MD5 only | ❌ | | Batch mode (folder scan) | ✅ | ❌ | ✅ | ❌ | ❌ | | Native dependencies | **none** (pure C#) | none (pure-Rust crates) | zlib-ng / zstd / lzma / flac | zlib / lzma / flac | zlib (miniz) / LZMA SDK / zstd / dr_flac | -| Language | C# (.NET 8/9/10) | Rust | C++ | C++ (MAME) | C | +| Language | C# (.NET 8/9/10/11) | Rust | C++ | C++ (MAME) | C | The same table is also in the [repository README](../README.md#library-comparison-chdsharp-vs-chd-rs-vs-chdlite-vs-chdman-vs-libchdr). diff --git a/docs/testing.md b/docs/testing.md index fedcf14..a4895fc 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -4,7 +4,7 @@ layout: default # Testing -CHDSharp ships a **4,216-test** xUnit suite (per target framework) plus a deterministic 30-file corpus covering every format version, codec, map type, and parent/child combination. Tests run on `net8.0`, `net9.0`, and `net10.0`. +CHDSharp ships a **4,220-test** xUnit suite (per target framework) plus a deterministic 30-file corpus covering every format version, codec, map type, and parent/child combination. Tests run on `net8.0`, `net9.0`, `net10.0`, and `net11.0`. --- @@ -76,7 +76,7 @@ CHDSharp ships a **4,216-test** xUnit suite (per target framework) plus a determ dotnet test # One framework -dotnet test -f net10.0 +dotnet test -f net11.0 # One class / filter dotnet test --filter "FullyQualifiedName~CorpusTests" @@ -172,5 +172,5 @@ Exit code is `0` when every check passes, `1` on any failure, `2` on usage error 1. **Every new feature needs a test** — corpus fixture for format-level behavior, unit test for API-level behavior. 2. **Corpus fixtures must be deterministic** — regenerate via `CHDSharpTestDataGeneration`, never hand-edit binaries. 3. **New fixtures must be registered in `manifest.json`** with the correct expected version and pass/fail status. -4. All 4,216 tests must pass per target framework before merging, and `CHDSharpBattleTest` must stay at 3,174/3,174 (synthetic) and 3003/3003 (real-world corpus). +4. All 4,220 tests must pass per target framework before merging, and `CHDSharpBattleTest` must stay at 3,174/3,174 (synthetic) and 3003/3003 (real-world corpus). 5. **Keep the inspectors clean** — `jb inspectcode CSharp_CHDSharp.sln --severity=WARNING` must report no findings. Never edit vendored code to satisfy an inspection; exempt it in `.editorconfig` instead (see [Building](building.md#code-inspections)). diff --git a/scripts/package-release.ps1 b/scripts/package-release.ps1 index 9f5a1f6..619ff76 100644 --- a/scripts/package-release.ps1 +++ b/scripts/package-release.ps1 @@ -7,27 +7,34 @@ .DESCRIPTION For every requested runtime identifier the CLI is published as a framework-dependent single-file executable - the .NET runtime itself is NOT embedded, so the bundle - requires the .NET 10 runtime to be installed. Each bundle is written as - CHDSharp__v.zip, the exact asset name VersionCheckService looks up on - GitHub releases for the built-in update check (e.g. CHDSharp_win-x64_v1.5.0.zip). - Existing files in the output path are never deleted. + requires the .NET 11 runtime to be installed. Bundles use the native archive format + for each platform - CHDSharp__v.zip on Windows, + CHDSharp__v.tar.gz on Linux and CHDSharp__v.dmg on macOS - + the exact asset names VersionCheckService looks up on GitHub releases for the built-in + update check (e.g. CHDSharp_linux-x64_v1.7.0.tar.gz). Existing files in the output + path are never deleted. macOS .dmg bundles require macOS; use -Rids on other hosts to + select only the formats you can build. .EXAMPLE pwsh scripts/package-release.ps1 - pwsh scripts/package-release.ps1 -Rids win-x64 -OutputPath dist + pwsh scripts/package-release.ps1 -Rids win-x64,win-arm64 -OutputPath dist + pwsh scripts/package-release.ps1 -Rids osx-arm64 -OutputPath dist #> [CmdletBinding()] param( [string]$Version, [string]$OutputPath, [string]$Configuration = "Release", - [string]$TargetFramework = "net10.0", + [string]$TargetFramework = "net11.0", [string[]]$Rids = @("win-x64", "win-arm64", "linux-x64", "linux-arm64", "osx-x64", "osx-arm64") ) $ErrorActionPreference = "Stop" $RepoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path +# Accept both -Rids win-x64,linux-x64 (CI matrix expansion) and -Rids win-x64 -Rids linux-x64. +$Rids = @($Rids | ForEach-Object { $_ -split ',' } | ForEach-Object { $_.Trim() } | Where-Object { $_ }) + if (-not $Version) { $props = Get-Content (Join-Path $RepoRoot "Directory.Build.props") -Raw $versionMatch = [regex]::Match($props, "([^<]+)") @@ -54,6 +61,14 @@ $produced = [System.Collections.Generic.List[string]]::new() foreach ($rid in $Rids) { $isWindowsRid = $rid.StartsWith("win-", [StringComparison]::Ordinal) + $isLinuxRid = $rid.StartsWith("linux-", [StringComparison]::Ordinal) + $isMacRid = $rid.StartsWith("osx-", [StringComparison]::Ordinal) + if (-not ($isWindowsRid -or $isLinuxRid -or $isMacRid)) { + throw "Unsupported runtime identifier '$rid' (expected win-*, linux-* or osx-*)." + } + if ($isMacRid -and -not $IsMacOS) { + throw "macOS .dmg bundles must be built on macOS; requested '$rid' on $([Environment]::OSVersion.Platform)." + } $exeName = if ($isWindowsRid) { "CHDSharp.exe" } else { "CHDSharp" } $publishDir = Join-Path $artifactsRoot "publish/$rid" @@ -80,13 +95,17 @@ foreach ($rid in $Rids) { Copy-Item $license $stageDir Copy-Item $readme $stageDir Copy-Item $whatsNew $stageDir + if (-not $isWindowsRid -and -not $IsWindows) { + & chmod +x (Join-Path $stageDir $exeName) + if ($LASTEXITCODE -ne 0) { throw "chmod +x failed for $exeName (exit code $LASTEXITCODE)" } + } $runExample = if ($isWindowsRid) { "CHDSharp.exe info -i game.chd" } else { "CHDSharp info -i game.chd" } $readmeTxtLines = @( "CHDSharp CLI v$Version", "Pure C# CHD (Compressed Hunks of Data) reader/writer -- MAME chdman-compatible.", - "Framework-dependent single-file build targeting .NET 10.", - "REQUIRES the .NET 10 runtime to be installed: https://dotnet.microsoft.com/download/dotnet/10.0", + "Framework-dependent single-file build targeting .NET 11.", + "REQUIRES the .NET 11 runtime to be installed: https://dotnet.microsoft.com/download/dotnet/11.0", "===============================================================================", "", "Run from a command prompt:", @@ -95,7 +114,13 @@ foreach ($rid in $Rids) { if (-not $isWindowsRid) { $readmeTxtLines += @( "", - "NOTE: if the binary is not executable after unzipping, run: chmod +x $exeName" + "NOTE: if the binary is not executable after extracting the archive, run: chmod +x $exeName" + ) + } + if ($isMacRid) { + $readmeTxtLines += @( + "", + "macOS: open the .dmg, copy CHDSharp anywhere (for example ~/bin), then run it from a terminal." ) } $readmeTxtLines += @( @@ -123,13 +148,28 @@ foreach ($rid in $Rids) { Write-Host " smoke test: $($smoke | Select-Object -First 1)" } - $zipName = "CHDSharp_${rid}_v$Version.zip" - $zipPath = Join-Path $OutputPath $zipName - if (Test-Path $zipPath) { Remove-Item $zipPath } - [IO.Compression.ZipFile]::CreateFromDirectory($stageDir, $zipPath, [IO.Compression.CompressionLevel]::Optimal, $false) - $sizeMb = [math]::Round((Get-Item $zipPath).Length / 1MB, 2) - Write-Host " -> $zipPath ($sizeMb MB)" -ForegroundColor Green - $produced.Add($zipPath) + $extension = if ($isWindowsRid) { "zip" } elseif ($isLinuxRid) { "tar.gz" } else { "dmg" } + $bundleName = "CHDSharp_${rid}_v$Version.$extension" + $bundlePath = Join-Path $OutputPath $bundleName + if (Test-Path $bundlePath) { Remove-Item $bundlePath } + + switch ($extension) { + "zip" { + [IO.Compression.ZipFile]::CreateFromDirectory($stageDir, $bundlePath, [IO.Compression.CompressionLevel]::Optimal, $false) + } + "tar.gz" { + & tar -czf $bundlePath -C $stageDir . + if ($LASTEXITCODE -ne 0) { throw "tar failed for $rid (exit code $LASTEXITCODE)" } + } + "dmg" { + & hdiutil create -volname "CHDSharp v$Version" -srcfolder $stageDir -ov -format UDZO $bundlePath + if ($LASTEXITCODE -ne 0) { throw "hdiutil failed for $rid (exit code $LASTEXITCODE)" } + } + } + + $sizeMb = [math]::Round((Get-Item $bundlePath).Length / 1MB, 2) + Write-Host " -> $bundlePath ($sizeMb MB)" -ForegroundColor Green + $produced.Add($bundlePath) } Write-Host ""