|
10 | 10 |
|
11 | 11 | import create_tarballs
|
12 | 12 | import sign_release_assets
|
| 13 | +import sign_tag |
13 | 14 | import validate_pr
|
14 | 15 | import verify_release_assets
|
15 | 16 | from lib import changelog
|
@@ -607,6 +608,27 @@ def stage_tag(config: Config, version: str) -> None:
|
607 | 608 | s.ok(f"Pushed tag {version} to {config.upstream}")
|
608 | 609 |
|
609 | 610 |
|
| 611 | +def stage_sign_tag(config: Config, version: str) -> None: |
| 612 | + with stage.Stage("Sign tag", "Signing/verifying the release tag") as s: |
| 613 | + git.fetch(config.upstream) |
| 614 | + if git.tag_has_signature(version): |
| 615 | + if not git.verify_tag(version): |
| 616 | + raise s.fail(f"Tag {version} signature cannot be verified") |
| 617 | + s.ok("Tag already signed") |
| 618 | + return |
| 619 | + if config.github_actions: |
| 620 | + s.ok("Asking user to sign the tag") |
| 621 | + raise assign_to_user(s, config.issue, "sign the tag") |
| 622 | + sign_tag.main( |
| 623 | + sign_tag.Config( |
| 624 | + tag=version, |
| 625 | + upstream=config.upstream, |
| 626 | + verify_only=False, |
| 627 | + local_only=config.dryrun, |
| 628 | + )) |
| 629 | + s.ok("Tag signed") |
| 630 | + |
| 631 | + |
610 | 632 | def stage_build_binaries(config: Config, version: str) -> None:
|
611 | 633 | """Wait for GitHub Actions to build the binaries.
|
612 | 634 |
|
@@ -774,6 +796,7 @@ def run_stages(config: Config) -> None:
|
774 | 796 | stage_await_merged(config, version)
|
775 | 797 | stage_await_master_build(config, version)
|
776 | 798 | stage_tag(config, version)
|
| 799 | + stage_sign_tag(config, version) |
777 | 800 | stage_build_binaries(config, version)
|
778 | 801 | stage_create_tarballs(version)
|
779 | 802 | stage_sign_release_assets(config, version)
|
|
0 commit comments