Harden monorepo release gate
This commit is contained in:
parent
19b0454b3f
commit
31a8d2bd9b
@ -35,5 +35,6 @@ standard-library APIs.
|
|||||||
## Publication Rule
|
## Publication Rule
|
||||||
|
|
||||||
The public repository must not contain machine-local paths, private checkout
|
The public repository must not contain machine-local paths, private checkout
|
||||||
names, or generated PDFs that drift after regeneration. The release gate must
|
names, or private remote names. Generated PDFs are committed artifacts: render
|
||||||
fail if tracked PDFs change after `scripts/render-doc-pdfs.sh`.
|
them explicitly with `scripts/render-doc-pdfs.sh`, then run the release gate,
|
||||||
|
which must not mutate tracked files by default.
|
||||||
|
|||||||
@ -14,8 +14,9 @@ cargo test --manifest-path compiler/Cargo.toml
|
|||||||
./scripts/release-gate.sh
|
./scripts/release-gate.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
`./scripts/release-gate.sh` regenerates publication PDFs and fails if tracked
|
Publication PDFs are committed artifacts. Regenerate them explicitly with
|
||||||
PDFs drift after regeneration.
|
`./scripts/render-doc-pdfs.sh` before a documentation release, then run the
|
||||||
|
release gate to verify the repository without mutating tracked files.
|
||||||
|
|
||||||
## Standard Library
|
## Standard Library
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,8 @@ SLOVO_STD_PATH="$PWD/lib/std" ./compiler/target/debug/glagol build hello -o hell
|
|||||||
- [Glagol Whitepaper](docs/papers/GLAGOL_WHITEPAPER.md)
|
- [Glagol Whitepaper](docs/papers/GLAGOL_WHITEPAPER.md)
|
||||||
|
|
||||||
Generated PDFs live beside their Markdown sources in `docs/papers/`.
|
Generated PDFs live beside their Markdown sources in `docs/papers/`.
|
||||||
|
Regenerate them with `./scripts/render-doc-pdfs.sh` before documentation
|
||||||
|
releases.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@ -7,9 +7,50 @@ compiler_dir="${repo_root}/compiler"
|
|||||||
|
|
||||||
cd "${repo_root}"
|
cd "${repo_root}"
|
||||||
git diff --check
|
git diff --check
|
||||||
|
|
||||||
|
required_pdfs=(
|
||||||
|
"docs/papers/SLOVO_WHITEPAPER.pdf"
|
||||||
|
"docs/papers/SLOVO_MANIFEST.pdf"
|
||||||
|
"docs/papers/GLAGOL_WHITEPAPER.pdf"
|
||||||
|
"docs/papers/GLAGOL_COMPILER_MANIFEST.pdf"
|
||||||
|
)
|
||||||
|
|
||||||
|
for pdf in "${required_pdfs[@]}"; do
|
||||||
|
if [ ! -s "${pdf}" ]; then
|
||||||
|
echo "missing generated documentation artifact: ${pdf}" >&2
|
||||||
|
echo "run ./scripts/render-doc-pdfs.sh and commit the result" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
private_text_pattern='(/home/[[:alnum:]_.-]+|sanjin[0-9]+|[0-9]{1,3}\.64\.0\.1|git\.hermeticum\.io)'
|
||||||
|
|
||||||
|
if git grep -nE "${private_text_pattern}" -- \
|
||||||
|
README.md CONTRIBUTING.md docs scripts compiler lib examples benchmarks tests .llm; then
|
||||||
|
echo "release gate found local/private publication text" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if command -v pdftotext >/dev/null 2>&1; then
|
||||||
|
pdf_text_dir="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "${pdf_text_dir}"' EXIT
|
||||||
|
for pdf in "${required_pdfs[@]}"; do
|
||||||
|
pdftotext "${pdf}" "${pdf_text_dir}/$(basename "${pdf}").txt"
|
||||||
|
done
|
||||||
|
if rg -n "${private_text_pattern}" "${pdf_text_dir}"; then
|
||||||
|
echo "release gate found local/private text inside generated PDFs" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${RENDER_DOC_PDFS:-0}" = "1" ]; then
|
||||||
"${repo_root}/scripts/render-doc-pdfs.sh"
|
"${repo_root}/scripts/render-doc-pdfs.sh"
|
||||||
git diff --check
|
git diff --check
|
||||||
git diff --exit-code -- docs/papers
|
if ! git diff --quiet -- docs/papers; then
|
||||||
|
echo "documentation PDFs changed; review and commit generated artifacts before release" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
cd "${compiler_dir}"
|
cd "${compiler_dir}"
|
||||||
cargo fmt --check
|
cargo fmt --check
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user