Publish an approved commit and automate the next version bump (#9187)
## Why
The current release workflow starts from a tag but builds from the tip
of `master`. If `master` advances while approval is pending, the package
uploaded to PyPI can differ from the tagged source. After publication, a
maintainer also has to merge the version bump PR before development
builds pick up the next version.
## What changed
A maintainer can now start a release from the Actions UI or with `gh
workflow run release.yml`. A successful release takes two human actions:
start the workflow and approve it once in `release-env`.
1. Choose what to publish. By default, the workflow uses the tip of
`master` and reads the release version from that commit’s `version.txt`.
The optional `target_sha` and `release_version` inputs let the
maintainer select an earlier commit on `master` or specify the version
to publish.
2. Review and approve. The run shows the source commit, release version,
and next development version before approval. The workflow builds and
tags the same commit, creates the GitHub Release, and uploads the
package to PyPI. When the requested version differs from `version.txt`,
the tagged commit changes only that file.
3. After a successful upload, the workflow opens and merges a PR that
increments the patch number of the published version on `master`. It
uses the release account’s administrator permission to merge that
version-only PR. If the merge fails, the PR remains available for manual
recovery.
For example, with `0.20.3` in `version.txt`, leaving the version input
blank publishes `0.20.3` and updates `master` to `0.20.4`. Entering
`0.21.0` publishes `0.21.0` and updates `master` to `0.21.1`.
Pushing a matching `vX.Y.Z` tag still starts a release. The maintainer
guide covers both entry points and recovery after publication.
---------
Signed-off-by: Masahiro Tanaka <tanaka.masahiro@gmail.com>