Skip to content

release: publish benchmark results to the README - #34

Merged
nullfx merged 2 commits into
mainfrom
feature/readme-benchmarks
Oct 9, 2026
Merged

nullfx merged 2 commits into
mainfrom
feature/readme-benchmarks

Conversation

@nullfx

@nullfx nullfx commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Publish benchmark results to the README

Each release now writes its BenchmarkDotNet results into a # Benchmarks section at the end of README.md. That updated README is committed together with the version bump.

What changed

  • README.md: new # Benchmarks section at the end. It starts with a placeholder line, which the first release replaces.
  • .github/scripts/update-readme-benchmarks.ps1 (new):
    • Replaces everything after # Benchmarks with the BenchmarkDotNet *-report-github.md report, preceded by a one-line note saying these are ShortRun numbers from a GitHub-hosted runner.
    • Leaves everything above the heading untouched.
    • Keeps the file's BOM and line endings.
    • Appends the heading if it's missing, and fails if there are no reports.
  • release.yml: new order is bump → build → unit tests → benchmarks → Update Readme Benchmarks → pack → verify → upload → commit Directory.Build.props + README.md as release: vX.Y.Z [skip ci] → push → publish.
    • Packing now happens after the README update, so the README inside the .nupkg (shown on nuget.org) has this release's benchmark results.
    • The version commit is made once everything has passed, right before the push. Previously it was made locally before the build.
    • On a re-run whose version commit was already pushed, the README step and the commit are skipped, and the push step only runs if a commit was made.

SourceLink

The package is built before the release commit exists, so its SourceLink commit is the commit the release started from (the PR merge on main). That commit is on GitHub and has identical source files; the release commit only changes Directory.Build.props and README.md. So "go to source" works, and nothing is amended or rewritten.

Validation

Simulated locally on a clone of main (v1.1.13), running each PowerShell step the way Actions runs it:

Check Result
Increment version 1.1.13 → 1.1.14, exit 0
Build / unit tests Succeeded; 36/36 tests passed
Benchmarks 18 benchmarks, *-report-github.md produced
Built DLLs after tests and benchmarks Unchanged (same hash and timestamp), so the packed assemblies are the ones from the Build step
Update Readme Benchmarks README section written, exit 0
Pack / verify Succeeded
README inside .nupkg Byte-identical to the committed README and contains the v1.1.14 results
Commit One commit with Directory.Build.props + README.md; working tree clean afterwards
SourceLink commit in nuspec The pre-release commit on main (exists on GitHub)
Second release Replaces the section rather than appending
Windows checkout (CRLF + BOM) Preserved; no mixed line endings
Heading missing / no benchmark report Heading appended / step fails (exit 1)

Notes

  • Expect noise: ShortRun timings from shared runners vary from release to release, which is what the note in the README says.

🤖 Generated with Claude Code

https://claude.ai/code/session_012C6aJYkYBV2GSnSZwsd9GU

- Add a '# Benchmarks' section at the end of README.md.
- New .github/scripts/update-readme-benchmarks.ps1 replaces everything
  after '# Benchmarks' with the BenchmarkDotNet *-report-github.md
  report(s), preceded by a one-line note on how they were measured.
  Content above the heading is untouched; BOM and line endings are kept.
- release.yml: run benchmarks right after the version bump, update the
  README, and commit Directory.Build.props + README.md together as the
  'release: vX.Y.Z [skip ci]' commit. Build/pack/test then run from that
  commit, so the README inside the .nupkg (nuget.org page) and the
  SourceLink commit SHA both match what is pushed to main.
- Build uses --no-incremental so the benchmark run's build output is
  never reused for the packed assemblies.
- The README step is skipped on a re-run whose version commit was
  already pushed; the push step now keys off whether a commit was made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C6aJYkYBV2GSnSZwsd9GU
@nullfx nullfx self-assigned this Oct 9, 2026
Reorders release.yml per review:

  bump -> build -> unit tests -> benchmarks -> Update Readme Benchmarks
  -> pack -> verify -> upload -> commit (version + README) -> push

- Pack runs after the README update so the README inside the .nupkg
  (shown on nuget.org) carries this release's benchmark results.
- The version commit is made once everything has passed, right before
  the push, instead of before the build. The package's SourceLink commit
  is the pre-release commit on main, which exists on GitHub and has
  identical sources; nothing is amended.
- Drop --no-incremental from the build: verified that the unit-test and
  benchmark runs leave the built DLLs untouched (same hash and mtime).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012C6aJYkYBV2GSnSZwsd9GU
@nullfx
nullfx merged commit 4151dcf into main Oct 9, 2026
5 checks passed
@nullfx
nullfx deleted the feature/readme-benchmarks branch October 9, 2026 18:32
@nullfx nullfx moved this from In Progress to Done in NullFX.CRC Devopment Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants