Release Process
The first public release should be prepared from an independent branch and reviewed before any public push, PR, release, package upload, or GitHub Pages deployment.
Release Order
- Prepare the candidate on an independent branch.
- Run local tests, packaging checks, artifact audits, and docs build.
- Push the candidate pull request for maintainer review.
- After approval, merge the reviewed source into GitHub
main. - Enable GitHub Pages only after public docs CI passes.
- Create release tags, GitHub release assets, and TestPyPI/PyPI uploads only
from the reviewed GitHub
maincommit after public CI passes. - Before publication, verify the external state with
make public-publish-check PUBLIC_PUBLISH_PHASE=pre-publish V=0.6.7. - After publication, verify the external state with
make public-publish-check PUBLIC_PUBLISH_PHASE=post-publish V=0.6.7.
Public release assets must not be created directly from an unsynced candidate
branch. make publish, make publish-test, and make public-release-tag
require docs/maintainer-approval-record.md to name the reviewed commit,
publication strategy, and maintainer sign-offs.
Required Evidence
- Secret scan report.
- License and SBOM report.
- Public repository file list.
- sdist file list.
- wheel file list.
- GitHub Pages file list.
- CI run links.
- E2E or smoke-test results.
- Release notes.
Local Commands
make public-review
python3 scripts/audit_public_history_paths.py --json --allow-violations
git diff --checkThe release gate builds and audits the wheel and source distribution, checks metadata with Twine, verifies the clean-export candidate, and checks the public docs output.
The history path audit is review evidence for the publication strategy. It is not a content-level secret scan. If it reports blocked historical paths, the release owner must choose a reviewed clean export or a reviewed history rewrite before importing source into GitHub.
Version Alignment
The release tag, GitHub release, package version, and documentation version
should refer to the same reviewed GitHub main commit.
The Python release notes should mention the ksadk-web commit or tag used to
generate the embedded static UI. After package publication, the publication
state check verifies that PyPI reports the reviewed version for both public
package names.
Credential Boundary
PyPI and TestPyPI credentials must stay outside the repository. Prefer PyPI Trusted Publishing with GitHub OIDC. If a temporary token is required, keep it in release-system secrets or a maintainer local environment after approval.
Never commit:
.pypirc- API tokens
- kubeconfig files
- private registry credentials
- customer data or private traces
PyPI Publication Workflow
Official publication runs through .github/workflows/publish-pypi.yml,
triggered by a GitHub Release published event or workflow_dispatch.
新增
This workflow replaces the previous manual make publish upload. Official
packages are now published to PyPI via OIDC Trusted Publishing.
The workflow runs the following steps:
- Sync frontend static assets:
make sync-ksadk-web-staticpullsdist-ksadkfrom@kingsoftcloud/ksadk-web@latestby default and unpacks it into the packaging tree. When triggered viaworkflow_dispatch, theksadk_web_versioninput pins a specific npm version (for example1.2.3). - Release preflight:
make public-preflightchainspublic-audit,public-test,docs-site-build, andpublic-build-check. - Build and content check: inside
public-build-check,uv buildproduces the artifacts andtwine check dist/*validates wheel and sdist metadata. - OIDC upload:
pypa/gh-action-pypi-publishuploads through Trusted Publishing. The job runs in thepypienvironment withid-token: write.
# .github/workflows/publish-pypi.yml trigger and permission highlights
on:
release:
types: [published]
workflow_dispatch:
inputs:
ksadk_web_version:
description: KsADK Web npm version to bundle
required: false
default: latest
permissions:
id-token: write # required for OIDC Trusted PublishingDo not configure PYPI_API_TOKEN
The normal release path relies entirely on OIDC Trusted Publishing. No
PYPI_API_TOKEN is needed in the repository or in workflow secrets. A
temporary token is only a fallback for when Trusted Publishing is
unavailable, and must live in GitHub environment secrets.
To replicate the release preflight locally (replace the version with the current release):
make sync-ksadk-web-static
make public-preflight
make public-publish-check PUBLIC_PUBLISH_PHASE=pre-publish V=0.6.7Public Import Approval
Before importing real source into GitHub, the approval record must name:
- the exact private branch or commit reviewed.
- whether publication uses clean export, rewritten history, or full history.
- the export manifests or history scan evidence.
- the reviewer who approved the sensitive-data boundary.
- the release owner responsible for GitHub, Pages, and PyPI actions.