Build and publish a release

This guide uses 4.0.0 as an example. Prepare the README, build the Python packages and verify both manuals before tagging. Pushing the v4.0.0 tag triggers publication. To build a standalone desktop application locally, go directly to Build an offline desktop package.

Prepare the build environment

Follow Installation and verification to create the application environment. Confirm the GUI starts and both ffmpeg and ffprobe are available. From the repository root, fetch existing tags and install the regression, documentation and package build tools.

conda activate mulimgviewer
git fetch origin --tags
python -m pip install build -r docs/requirements.txt -r auto_test_scripts/requirements.txt

Prepare the release content

Set __version__ to "4.0.0" in src/mulimgviewer/release_version.py. Use three numeric components. The v prefix belongs in the Git tag.

Collect release notes under ## 未发布 in CHANGELOG.md. Enter the version number only in the version file above. The prepare command moves pending notes into that version and generates its README. Review the examples and images before running the commands.

python tools/release.py --prepare
git diff -- README.md CHANGELOG.md src/mulimgviewer/release_version.py

Version 3.9.7 keeps the original README. Starting with 4.0.0, the script generates the root README.md from the template. Edit the template and regenerate when changing the release introduction.

Check whether the candidate is ready to commit

python tools/release.py --full

On a headless Linux builder, install Xvfb and xauth and run xvfb-run -a python tools/release.py --full. GUI regression tests run with the current Python interpreter. If Sphinx is installed separately, set SPHINX_PYTHON to the documentation environment’s Python executable.

The script checks for an existing local tag, builds both manuals with warnings treated as errors, runs strict regression tests, then builds and validates the Python distributions. After Local checks passed for v4.0.0, review these outputs.

  • Open docs/_build/release-zh_CN/index.html and docs/_build/release-en/index.html for the Chinese and English manuals.

  • auto_test_scripts/reports/latest.json points to the most recent regression report directory. Open its report.html to review failures, skips and the test environment.

  • build/release-4.0.0/dist/ contains the installable Python wheel and source archive. For users who want a desktop launcher, build the offline packages in the next step.

For a stale README, rerun --prepare. If the tag already exists, check the version number. For a documentation or test failure, fix the reported issue and rerun --full.

Verify the commit you intend to distribute

Commit the version file, template, generated README, release notes and corresponding source together. Push the candidate branch and review CI and the regression report for that commit. For offline packages, select the branch in Actions → Desktop packages → Run workflow, verify the run’s commit SHA and download the platform artifacts.

Use the desktop bundle guide to check the target platform and architecture, then extract the downloaded archive. Launch the package on each target system, verify side-by-side playback with the sample clips, export and reopen a result, and attach that tested artifact to the release.

Tag the verified commit and check publication

The following commands trigger a public release. Use git rev-parse HEAD to confirm the current commit matches the one verified by CI and used for packaging. If merging or rebasing changed the SHA, review the checks for the final commit.

git rev-parse HEAD
git tag -a $(python tools/release.py --print-tag) -m "MulimgViewer release"
git push origin "refs/tags/$(python tools/release.py --print-tag)"

Check the build and publication jobs for the tag in GitHub Actions. After Python builds pass on all three systems, the workflow extracts the release notes from the changelog and publishes the Python distributions to GitHub Releases and PyPI. The repository requires a valid PYPI_API_TOKEN for PyPI. Desktop archives come from a separate workflow. Attach the verified archives to the same release.

README feature links open the manual sections from the same commit. The online Chinese and English manual links follow the configured Read the Docs default. Verify the tagged builds in both projects before changing the default.