Skip to content

Commit 4c4a769

Browse files
committed
ci: add changelog release workflow
1 parent e11bff5 commit 4c4a769

5 files changed

Lines changed: 131 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Validate and publish release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Install Rust toolchain
23+
run: |
24+
rustup toolchain install stable --profile minimal
25+
rustup default stable
26+
rustup component add clippy rustfmt
27+
28+
- name: Validate tag version
29+
run: |
30+
set -eu
31+
tag="${GITHUB_REF_NAME}"
32+
version="${tag#v}"
33+
cargo_version="$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n 1)"
34+
35+
if [ "$tag" = "$version" ]; then
36+
echo "Release tags must start with v, for example v0.1.0." >&2
37+
exit 1
38+
fi
39+
40+
if [ "$version" != "$cargo_version" ]; then
41+
echo "Tag $tag does not match Cargo.toml version $cargo_version." >&2
42+
exit 1
43+
fi
44+
45+
- name: Extract changelog notes
46+
run: |
47+
set -eu
48+
version="${GITHUB_REF_NAME#v}"
49+
awk -v version="$version" '
50+
$0 ~ "^## \\[" version "\\]" {
51+
found = 1
52+
print
53+
next
54+
}
55+
found && /^## \[/ {
56+
exit
57+
}
58+
found {
59+
print
60+
}
61+
END {
62+
if (!found) {
63+
exit 1
64+
}
65+
}
66+
' CHANGELOG.md > release-notes.md
67+
68+
if [ "$(wc -l < release-notes.md)" -lt 3 ]; then
69+
echo "CHANGELOG.md entry for $version is missing release notes." >&2
70+
exit 1
71+
fi
72+
73+
- name: Check formatting
74+
run: cargo fmt --check
75+
76+
- name: Lint
77+
run: cargo clippy --all-targets -- -D warnings
78+
79+
- name: Test
80+
run: cargo test
81+
82+
- name: Build
83+
run: cargo build --release
84+
85+
- name: Ensure release does not already exist
86+
env:
87+
GH_TOKEN: ${{ github.token }}
88+
run: |
89+
set -eu
90+
if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
91+
echo "Release $GITHUB_REF_NAME already exists." >&2
92+
exit 1
93+
fi
94+
95+
- name: Create GitHub release
96+
env:
97+
GH_TOKEN: ${{ github.token }}
98+
run: |
99+
gh release create "$GITHUB_REF_NAME" \
100+
--verify-tag \
101+
--title "$GITHUB_REF_NAME" \
102+
--notes-file release-notes.md

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Changelog
2+
3+
All notable ProofLog changes are recorded here.
4+
5+
The format follows Keep a Changelog conventions, and release versions follow semantic versioning.
6+
7+
## [Unreleased]
8+
9+
- Keep this section for changes that have landed but are not yet released.
10+
- Move entries into the next versioned section before tagging.
11+
12+
## [0.1.0] - 2026-05-19
13+
14+
### Added
15+
16+
- Local Rust CLI with `init`, `doctor`, `ingest`, and `proof` commands.
17+
- Local SQLite storage with owner-only config and database permissions on Unix-like systems.
18+
- Codex JSONL discovery, incremental raw ingestion, malformed-line handling, and parser diagnostics.
19+
- Derived sessions, messages, commands, approvals, file changes, verification facts, failure facts, and failure-resolution facts.
20+
- Git context detection, changed-file reporting, session correlation, risky path classification, and risky command classification.
21+
- Conservative proof decision engine with `READY`, `NOT READY`, and `UNKNOWN` outcomes.
22+
- Plain text, Markdown, and experimental JSON proof reports.
23+
- Decision-based proof exit codes.
24+
- Obvious-secret redaction in proof report output.
25+
- Public installation, CLI, contributing, parser fixture, and release documentation.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ ProofLog is not:
172172
- [Installation guide](docs/installation.md)
173173
- [Contributing guide](docs/contributing.md)
174174
- [Release checklist](docs/release-checklist.md)
175+
- [Changelog](CHANGELOG.md)
175176
- [CLI behavior](docs/cli.md)
176177
- [Product requirements](docs/prd.md)
177178
- [Architecture notes](docs/architecture.md)

docs/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Keep docs small and current. If a document does not help a user install, operate
99
- [Installation](installation.md)
1010
- [CLI behavior](cli.md)
1111
- [Demo script](demo.md)
12+
- [Changelog](../CHANGELOG.md)
1213

1314
## Contributor Docs
1415

docs/release-checklist.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ This check is local-only. Release notes may summarize the result, but must not i
8989
Before tagging:
9090

9191
- [ ] Confirm `Cargo.toml` version is correct.
92+
- [ ] Add or update the matching `CHANGELOG.md` entry.
9293
- [ ] Confirm `Cargo.lock` is current.
9394
- [ ] Confirm docs mention only available install paths and clearly label planned package channels.
9495
- [ ] Confirm the working tree is clean.
@@ -100,7 +101,7 @@ Tag only after the checks above pass:
100101
git tag vX.Y.Z
101102
```
102103

103-
Do not push the tag until release notes and publish decisions are final.
104+
Push the tag only after release notes and publish decisions are final. The GitHub release workflow validates the tag against `Cargo.toml`, extracts the matching changelog section, runs release checks, and creates the GitHub release.
104105

105106
## 8. Publish Gate
106107

0 commit comments

Comments
 (0)