pforge-cli 0.1.0__tar.gz → 0.1.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/PKG-INFO +1 -1
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/pyproject.toml +1 -1
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/pyproject.toml.orig +1 -1
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/__init__.py +1 -1
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/cli.py +46 -2
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/releases.py +87 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/README.md +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/bumper.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/changelog.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/commits.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/config.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/doctor.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/documentation.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/hooks.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/process.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/project.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/publishing.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/pull_requests.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/quality.py +0 -0
- {pforge_cli-0.1.0 → pforge_cli-0.1.1}/src/project_forge/status.py +0 -0
|
@@ -19,7 +19,7 @@ from project_forge.project import find_project_root
|
|
|
19
19
|
from project_forge.publishing import run_publish_flow
|
|
20
20
|
from project_forge.pull_requests import run_pr_workflow
|
|
21
21
|
from project_forge.quality import run_quality_gate
|
|
22
|
-
from project_forge.releases import run_release_workflow
|
|
22
|
+
from project_forge.releases import run_release_pipeline, run_release_workflow
|
|
23
23
|
from project_forge.status import show_status
|
|
24
24
|
|
|
25
25
|
app = typer.Typer(
|
|
@@ -71,6 +71,21 @@ def bump(
|
|
|
71
71
|
"-r",
|
|
72
72
|
help="Explicit release increment ('patch', 'minor', 'major', or version like '1.2.0').",
|
|
73
73
|
),
|
|
74
|
+
patch: bool = typer.Option(
|
|
75
|
+
False,
|
|
76
|
+
"--patch",
|
|
77
|
+
help="Bump patch version (e.g. 1.0.0 -> 1.0.1).",
|
|
78
|
+
),
|
|
79
|
+
minor: bool = typer.Option(
|
|
80
|
+
False,
|
|
81
|
+
"--minor",
|
|
82
|
+
help="Bump minor version (e.g. 1.0.0 -> 1.1.0).",
|
|
83
|
+
),
|
|
84
|
+
major: bool = typer.Option(
|
|
85
|
+
False,
|
|
86
|
+
"--major",
|
|
87
|
+
help="Bump major version (e.g. 1.0.0 -> 2.0.0).",
|
|
88
|
+
),
|
|
74
89
|
prerelease: str | None = typer.Option(
|
|
75
90
|
None,
|
|
76
91
|
"--prerelease",
|
|
@@ -100,11 +115,19 @@ def bump(
|
|
|
100
115
|
),
|
|
101
116
|
) -> None:
|
|
102
117
|
"""Native Python SemVer version bumper and changelog generator."""
|
|
118
|
+
target_release_as = release_as
|
|
119
|
+
if patch:
|
|
120
|
+
target_release_as = "patch"
|
|
121
|
+
elif minor:
|
|
122
|
+
target_release_as = "minor"
|
|
123
|
+
elif major:
|
|
124
|
+
target_release_as = "major"
|
|
125
|
+
|
|
103
126
|
root_dir = find_project_root()
|
|
104
127
|
cfg = load_config(root_dir)
|
|
105
128
|
code, new_version = run_bump(
|
|
106
129
|
root_dir=root_dir,
|
|
107
|
-
release_as=
|
|
130
|
+
release_as=target_release_as,
|
|
108
131
|
prerelease=prerelease,
|
|
109
132
|
first_release=first_release,
|
|
110
133
|
dry_run=dry_run,
|
|
@@ -366,6 +389,27 @@ def release_publish(
|
|
|
366
389
|
raise typer.Exit(code)
|
|
367
390
|
|
|
368
391
|
|
|
392
|
+
@release_app.command("pipeline")
|
|
393
|
+
def release_pipeline_cmd(
|
|
394
|
+
push: bool = typer.Option(
|
|
395
|
+
True, "--push/--no-push", help="Push commits and tags to remote origin."
|
|
396
|
+
),
|
|
397
|
+
create_pr: bool = typer.Option(
|
|
398
|
+
True, "--create-pr/--no-create-pr", help="Create or update pull request."
|
|
399
|
+
),
|
|
400
|
+
draft: bool = typer.Option(True, "--draft/--no-draft", help="Create draft release on GitHub."),
|
|
401
|
+
) -> None:
|
|
402
|
+
"""Execute complete post-release pipeline: git push -> create PR -> draft release."""
|
|
403
|
+
root_dir = find_project_root()
|
|
404
|
+
code = run_release_pipeline(
|
|
405
|
+
root_dir=root_dir,
|
|
406
|
+
push=push,
|
|
407
|
+
create_pr=create_pr,
|
|
408
|
+
draft_release=draft,
|
|
409
|
+
)
|
|
410
|
+
raise typer.Exit(code)
|
|
411
|
+
|
|
412
|
+
|
|
369
413
|
# -----------------------------------------------------------------------------
|
|
370
414
|
# Docs Subcommands
|
|
371
415
|
# -----------------------------------------------------------------------------
|
|
@@ -171,3 +171,90 @@ def run_release_workflow(
|
|
|
171
171
|
return 1
|
|
172
172
|
|
|
173
173
|
return 0
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
def run_release_pipeline(
|
|
177
|
+
root_dir: Path | None = None,
|
|
178
|
+
push: bool = True,
|
|
179
|
+
create_pr: bool = True,
|
|
180
|
+
draft_release: bool = True,
|
|
181
|
+
) -> int:
|
|
182
|
+
"""Execute complete post-tag release pipeline: git push -> create PR -> draft release.
|
|
183
|
+
|
|
184
|
+
Parameters
|
|
185
|
+
----------
|
|
186
|
+
root_dir : Path | None, optional
|
|
187
|
+
Project root directory.
|
|
188
|
+
push : bool, optional
|
|
189
|
+
Whether to push branch and follow-tags, by default True.
|
|
190
|
+
create_pr : bool, optional
|
|
191
|
+
Whether to create/update pull request, by default True.
|
|
192
|
+
draft_release : bool, optional
|
|
193
|
+
Whether to draft GitHub release, by default True.
|
|
194
|
+
|
|
195
|
+
Returns
|
|
196
|
+
-------
|
|
197
|
+
int
|
|
198
|
+
0 on success, non-zero on failure.
|
|
199
|
+
"""
|
|
200
|
+
if root_dir is None:
|
|
201
|
+
from project_forge.project import find_project_root
|
|
202
|
+
|
|
203
|
+
root_dir = find_project_root()
|
|
204
|
+
|
|
205
|
+
from project_forge.config import load_config
|
|
206
|
+
from project_forge.pull_requests import run_pr_workflow
|
|
207
|
+
|
|
208
|
+
cfg = load_config(root_dir)
|
|
209
|
+
dev_branch = cfg.git.development_branch
|
|
210
|
+
base_branch = cfg.git.default_branch
|
|
211
|
+
|
|
212
|
+
console.print("\n[bold cyan]═════ Starting Automated Post-Release Pipeline ═════[/bold cyan]\n")
|
|
213
|
+
|
|
214
|
+
# Step 1: Push commits and tags to remote
|
|
215
|
+
if push:
|
|
216
|
+
console.print(
|
|
217
|
+
f"[bold yellow]Step 1: Pushing commits and release tags to origin {dev_branch}...[/bold yellow]"
|
|
218
|
+
)
|
|
219
|
+
push_res = run_process(["git", "push", "--follow-tags", "origin", dev_branch], cwd=root_dir)
|
|
220
|
+
if not push_res.passed:
|
|
221
|
+
console.print(
|
|
222
|
+
f"[bold red]Pipeline aborted: git push failed.[/bold red]\n{push_res.stderr}"
|
|
223
|
+
)
|
|
224
|
+
return push_res.exit_code
|
|
225
|
+
console.print("[bold green]✔ Git push completed successfully.[/bold green]")
|
|
226
|
+
|
|
227
|
+
# Step 2: Create/update PR
|
|
228
|
+
if create_pr:
|
|
229
|
+
console.print(
|
|
230
|
+
f"\n[bold yellow]Step 2: Creating/updating Pull Request into {base_branch} with Quality Gate certification...[/bold yellow]"
|
|
231
|
+
)
|
|
232
|
+
pr_code = run_pr_workflow(
|
|
233
|
+
root_dir=root_dir,
|
|
234
|
+
head=dev_branch,
|
|
235
|
+
base=base_branch,
|
|
236
|
+
dry_run=False,
|
|
237
|
+
)
|
|
238
|
+
if pr_code != 0:
|
|
239
|
+
console.print("[bold red]Pipeline warning: PR creation had errors.[/bold red]")
|
|
240
|
+
|
|
241
|
+
# Step 3: Publish release (draft by default)
|
|
242
|
+
if draft_release:
|
|
243
|
+
console.print(
|
|
244
|
+
"\n[bold yellow]Step 3: Creating GitHub Draft Release for latest version...[/bold yellow]"
|
|
245
|
+
)
|
|
246
|
+
rel_code = run_release_workflow(
|
|
247
|
+
root_dir=root_dir,
|
|
248
|
+
publish=True,
|
|
249
|
+
latest=True,
|
|
250
|
+
draft=True,
|
|
251
|
+
)
|
|
252
|
+
if rel_code != 0:
|
|
253
|
+
console.print(
|
|
254
|
+
"[bold red]Pipeline warning: Draft release creation had errors.[/bold red]"
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
console.print(
|
|
258
|
+
"\n[bold green]═════ Automated Post-Release Pipeline Completed ═════[/bold green]\n"
|
|
259
|
+
)
|
|
260
|
+
return 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|