docs: keep a CHANGELOG.md, with one entry file per PR

Release notes were written by hand on GitHub at tag time, so the contents
of a stacked release had to be pieced together from every PR, and output
changes that scripts and agents rely on were easy to miss.

- CHANGELOG.md backfills every published release (0.2.0 to 0.4.0) from its
  GitHub notes, verbatim.
- A PR adds changes/unreleased/<branch-name>.md instead of editing
  CHANGELOG.md, so stacked PRs never conflict. changes/README.md gives the
  sections, including Output Changes for JSON, MCP and error-code changes.
- scripts/changelog.sh: `check` validates entries and CHANGELOG.md,
  `release X.Y.Z` folds the entries into a new section (ordered by PR), and
  `notes X.Y.Z` prints a section as GitHub release notes.
- The release workflow sets the GitHub notes from the tag's section.
- New flake check `changelog` runs scripts/changelog-test.sh; both scripts
  are shellchecked.
- Entries for 0.5.0: #73, #74, #75, #78, #79, #80, #81 and this PR.

Claude-Session: https://claude.ai/code/session_01RqPPVeVDrnLoP7NUZmLRxY
This commit is contained in:
Rasyidan Akbar F. 2026-11-04 19:48:58 +07:00
commit 809966925e
21 changed files with 942 additions and 13 deletions

View file

@ -152,6 +152,15 @@
INSTALL_SH_SHELL=${shell} bash scripts/install-sh-test.sh
touch "$out"
'';
changelogSrc = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./CHANGELOG.md
./changes
./scripts/changelog.sh
./scripts/changelog-test.sh
];
};
publisherTestSrc = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
@ -303,6 +312,17 @@
diff -u ${./web/src/content/docs/mcp/tools.md} tools.md
touch "$out"
'';
# CHANGELOG.md and changes/unreleased/ entries are well formed, and
# scripts/changelog.sh folds and extracts them as releases expect.
changelog = pkgs.runCommand "idx-changelog" {
nativeBuildInputs = with pkgs; [ bash coreutils diffutils findutils gawk gnugrep ];
} ''
cp -r ${changelogSrc}/. .
chmod -R u+w .
export HOME="$TMPDIR"
bash scripts/changelog-test.sh
touch "$out"
'';
install-script-sh = installerCheck "sh";
install-script-dash = installerCheck "dash";
shellcheck = pkgs.runCommand "idx-shellcheck" {
@ -311,6 +331,7 @@
shellcheck -s sh ${installerSrc}/install.sh
shellcheck ${installerSrc}/scripts/install-sh-test.sh
shellcheck ${./scripts/live-smoke.sh}
shellcheck ${changelogSrc}/scripts/changelog.sh ${changelogSrc}/scripts/changelog-test.sh
shellcheck ${./tests/agents/agent-smoke.sh}
shellcheck ${./web/scripts/gen-cli-reference.sh} ${./web/scripts/gen-mcp-tools.sh}
touch "$out"