发布 SDK 0.6.0 并补充场标定使用说明
支持不带前缀的版本标签,保留 Finger 资产随 wheel 交付。发布工具 97 项回归及 SDK 自带资产的场标定录像验证通过。
This commit is contained in:
@@ -192,6 +192,7 @@ def _cmd_github(argv: list[str]) -> int:
|
||||
help="actually mutate the release repo, push, and create the release",
|
||||
)
|
||||
parser.add_argument("--notes-file", type=Path, default=None, help="release notes markdown")
|
||||
parser.add_argument("--tag", default=None, help="release tag: <version> or v<version> (default)")
|
||||
parser.add_argument(
|
||||
"--attach-preflight",
|
||||
action="store_true",
|
||||
@@ -218,6 +219,7 @@ def _cmd_github(argv: list[str]) -> int:
|
||||
version=args.version,
|
||||
apply=args.apply,
|
||||
notes_file=args.notes_file,
|
||||
tag=args.tag,
|
||||
attach_preflight=args.attach_preflight,
|
||||
allow_dirty_release=args.allow_dirty_release,
|
||||
skip_fetch=args.skip_fetch,
|
||||
|
||||
+11
-4
@@ -8,7 +8,7 @@
|
||||
3. sync the open-source subset of this checkout into ``orisys-sdk-release``
|
||||
(``tools/sync_downstreams.py`` + the manifest's ``checks``)
|
||||
4. stage ``SDK/<version>/*.whl`` into ``orisys-sdk-release/release/<version>/``
|
||||
5. commit, tag ``v<version>``, push branch + tag
|
||||
5. commit, tag (default ``v<version>``), push branch + tag
|
||||
6. create the GitHub Release with the wheels attached, then verify the assets
|
||||
|
||||
Nothing mutates anything unless ``--apply`` is passed: the default is a dry run
|
||||
@@ -48,6 +48,7 @@ class Options:
|
||||
skip_fetch: bool = False
|
||||
skip_checks: bool = False
|
||||
skip_release_upload: bool = False
|
||||
tag: str | None = None
|
||||
|
||||
|
||||
@dataclass
|
||||
@@ -131,7 +132,7 @@ def build_github_steps(
|
||||
tag,
|
||||
"--verify-tag",
|
||||
"--title",
|
||||
title or f"v{version}",
|
||||
title or tag,
|
||||
"--latest",
|
||||
]
|
||||
if notes_file is not None:
|
||||
@@ -242,6 +243,10 @@ def _stage_wheels(wheels: list[Path], asset_dir: Path) -> None:
|
||||
|
||||
def publish(options: Options) -> int:
|
||||
version = options.version
|
||||
tag = options.tag or f"v{version}"
|
||||
if tag not in {version, f"v{version}"}:
|
||||
print(f"[FAIL] tag must be {version!r} or {'v' + version!r}")
|
||||
return 1
|
||||
mode = "APPLY" if options.apply else "DRY RUN"
|
||||
print(f"=== release github: orisys {version} ({mode}) ===")
|
||||
|
||||
@@ -287,8 +292,10 @@ def publish(options: Options) -> int:
|
||||
return 1
|
||||
print(f"[ok ] release repo: {repo} ({branch}) clean={not dirty}")
|
||||
|
||||
tag = f"v{version}"
|
||||
existing = _existing_release_tags(repo, version)
|
||||
if existing and tag not in existing:
|
||||
print(f"[FAIL] version already has tag(s) {existing}; refusing a second tag {tag}")
|
||||
return 1
|
||||
# A tag that exists without a GitHub Release means a previous run got as far
|
||||
# as pushing the tag and then failed (or the upload was left manual). That is
|
||||
# exactly the resumable state, so continue instead of refusing.
|
||||
@@ -383,7 +390,7 @@ def publish(options: Options) -> int:
|
||||
_git(repo, "add", "-A")
|
||||
pending = _git(repo, "status", "--porcelain")
|
||||
if pending:
|
||||
_git(repo, "commit", "-m", f"release {version}")
|
||||
_git(repo, "commit", "-m", f"发布 SDK {version}")
|
||||
print(f"[ok ] committed {len(pending.splitlines())} change(s) in {repo}")
|
||||
else:
|
||||
print("[ok ] nothing new to commit in the release repo")
|
||||
|
||||
Reference in New Issue
Block a user