Automate releases and docs deployment (#874)

Port mailsuite's tag-triggered release pipeline:

- Add release.yml: pushing a version tag runs the full CI suite
  (python-tests.yml via workflow_call), then builds the package (the tag
  must match the version in parsedmarc/constants.py, checked with
  `hatch version`), publishes to PyPI via Trusted Publishing, creates
  the GitHub Release with notes from the tag's CHANGELOG.md section and
  the built distributions attached, pushes the multi-arch Docker image,
  and deploys the Sphinx docs
- Add docs.yml: reusable docs build/deploy to GitHub Pages, also
  runnable on demand (workflow_dispatch) for documentation-only changes
  between releases
- docker.yml: add a workflow_call trigger with a push_image input, since
  a GitHub Release created with the workflow's own GITHUB_TOKEN emits no
  `release: published` event; release.yml calls it directly instead
- Remove the legacy build.sh / publish-docs.sh manual process
- AGENTS.md: CRITICAL rule that releases require explicit maintainer
  permission, plus docs for the new release flow and its one-time
  repo/PyPI configuration prerequisites
- Bump the mailsuite floor to >=2.3.0 (raises the transitive mail-parser
  floor to >=4.6.2 and cryptography to >=50.0.0)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Sean Whalen
2026-08-17 18:22:12 -04:00
committed by GitHub
co-authored by Claude Fable 5
parent 7acfaa0cea
commit 400f3d319c
9 changed files with 231 additions and 56 deletions
+56
View File
@@ -0,0 +1,56 @@
name: Docs
# Builds the Sphinx docs and deploys them to GitHub Pages.
# Runs on demand (Actions → Docs → Run workflow) for documentation-only
# updates between releases, and is called by release.yml on every release.
on:
workflow_dispatch:
workflow_call:
permissions:
contents: read
jobs:
docs:
name: Build and deploy docs
runs-on: ubuntu-latest
concurrency:
group: github-pages-deploy
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Job-level permissions replace (not merge with) the workflow-level
# grant, so contents: read must be repeated here for checkout.
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[build]
- name: Build docs
run: make -C docs html
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4