Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
MinerU Alpha Release Design
历史归档:保留原设计或验收时的记录,不作为当前版本的安装、接口或实现指引。 当前入口见 开发文档;当时的版本、测试结论和未完成事项不追溯改写。
Goal
Publish PEP 440 Alpha versions such as 4.0.0a1 to the existing mineru PyPI project from an immutable Git tag, without changing the current stable or mineru-next-dev release flows.
Release contract
- Alpha releases use annotated tags named
vX.Y.ZaN, for examplev4.0.0a1. - The tagged commit must be contained in the remote
nextbranch. mineru/version.pyat the tagged commit must contain the same version as the tag without the leadingv.- The workflow checks out and builds the tagged commit, never the latest moving branch head.
- The built wheel metadata must contain the expected project name and version.
- A successful PyPI upload is followed by a GitHub Release marked as a pre-release.
Workflow structure
The independent .github/workflows/alpha-release.yml workflow is triggered only by tags matching the broad Alpha tag glob. A Python validation helper then enforces the exact canonical tag format.
The build job:
- checks out the tagged commit with full history;
- fetches
origin/nextand verifies that the tagged commit is its ancestor; - validates the tag and
mineru/version.py; - builds a wheel and runs package metadata checks;
- installs the wheel without dependencies in a clean virtual environment and verifies its installed distribution version;
- uploads the validated wheel as a workflow artifact.
The publishing job downloads exactly that artifact and publishes it with Twine, using the same PyPI API token authentication as the stable release workflow. It uses Python 3.12 and explicitly installs packaging>=24.2 so Twine can validate the PEP 639 license fields emitted in Core Metadata 2.4. The job runs the strict metadata check again before upload. The token is read from the PYPI_TOKEN GitHub secret through Twine's TWINE_PASSWORD environment variable. The job remains associated with the protected pypi GitHub environment.
The final job creates a GitHub pre-release and attaches the same wheel. It runs only after the PyPI publishing job succeeds.
Security and failure behavior
- Third-party actions are pinned to immutable commit SHAs where practical.
- Default workflow permissions are read-only; write permissions are scoped to the jobs that need them.
- PyPI authentication uses the existing
PYPI_TOKENGitHub secret. The token should be project-scoped tomineruand rotated according to the release credential policy. - Concurrency is scoped to the tag so duplicate runs for one tag cannot publish concurrently.
- Existing PyPI versions are not silently skipped. A duplicate upload fails visibly because published files are immutable.
- A validation, build, or smoke-test failure stops before the publishing job.
Operator flow
- Update
mineru/version.pyonnext, for example to4.0.0a1. - Commit the version change and let normal CI pass.
- Create and push the annotated tag
v4.0.0a1. - Ensure the repository or
pypienvironment provides thePYPI_TOKENsecret. - Approve the protected
pypienvironment deployment if required.
The workflow implementation can be tested locally without creating or pushing a tag. Merely adding the workflow does not publish anything.