Compare commits

..
10 Commits
Author SHA1 Message Date
gitea-actions bd03cf218b chore: bump version and update CHANGELOG.md [skip ci] 2026-09-21 13:54:46 +00:00
jt e9e7d2ad6e Merge pull request 'bugfix: fix workflow pipeline' (#32) from bugfix/return-empty-on-remote-tag-error into main
Publish to PyPI / Publish-to-PyPI (push) Failing after 20s
Reviewed-on: #32
2026-09-21 13:54:33 +00:00
Jonathan Teran Carballo 82c78c727a bugfix: fix workflow pipeline 2026-09-21 10:54:16 -03:00
jt 6d65462dbf Merge pull request 'bugfix: return empty on remote tag error' (#28) from bugfix/return-empty-on-remote-tag-error into main
Publish to PyPI / Publish-to-PyPI (push) Failing after 8s
Reviewed-on: #28
2026-09-21 13:45:48 +00:00
Jonathan Teran Carballo 6df7206eec bugfix: print errors in stderr 2026-09-21 10:45:16 -03:00
Jonathan Teran Carballo e793feaa1e bugfix: only return tag on remote tag command, empty if error 2026-09-21 10:44:48 -03:00
jt d03cf964e1 Merge pull request 'docs: fix workflow yaml' (#27) from chore/update-pipeline into main
Publish to PyPI / Publish-to-PyPI (push) Failing after 12s
Reviewed-on: #27
2026-09-21 12:53:52 +00:00
Jonathan Teran Carballo 9d17cf0320 docs: fix workflow yaml 2026-09-21 09:53:28 -03:00
jt 8c95835207 Merge pull request 'docs: update pipeline workflow' (#26) from chore/update-pipeline into main
Publish to PyPI / Publish-to-PyPI (push) Failing after 0s
Reviewed-on: #26
2026-09-21 12:49:27 +00:00
Jonathan Teran Carballo 7c69936360 docs: update pipeline workflow 2026-09-21 09:48:01 -03:00
3 changed files with 33 additions and 31 deletions
+7
View File
@@ -1,3 +1,10 @@
## v1.22.2 - 2026-09-21
- **bugfix**: fix workflow pipeline [[jteran](mailto:jteran@renatre.org.ar)] (82c78c7)
---
## v1.22.1 - 2026-09-21 ## v1.22.1 - 2026-09-21
- **refactor**: update remote tag fetching behaviour so it uses api instead of shallow clone [[jteran](mailto:jteran@renatre.org.ar)] (22ba8f5) - **refactor**: update remote tag fetching behaviour so it uses api instead of shallow clone [[jteran](mailto:jteran@renatre.org.ar)] (22ba8f5)
+6 -3
View File
@@ -1,3 +1,5 @@
import sys
from git_flow import ( from git_flow import (
BRANCH_TYPES, BRANCH_TYPES,
REPOSITORY_TOKEN_FILENAME, REPOSITORY_TOKEN_FILENAME,
@@ -163,7 +165,7 @@ def get_commit_message(commit_types: list[str] = COMMIT_TYPES) -> str:
def io_error(message: str, title: Optional[str] = None): def io_error(message: str, title: Optional[str] = None):
_io_status(message, "✖ Error: ", "red", title) _io_status(message, "✖ Error: ", "red", title, file=sys.stderr)
def io_warning(message: str, title: Optional[str] = None): def io_warning(message: str, title: Optional[str] = None):
@@ -178,7 +180,7 @@ def io_success(message: str, title: Optional[str] = None):
_io_status(message, "✔ Success: ", "green", title) _io_status(message, "✔ Success: ", "green", title)
def _io_status(message: str, prefix: str, style: str, title: Optional[str] = None): def _io_status(message: str, prefix: str, style: str, title: Optional[str] = None, file=None):
if title: if title:
rich.print( rich.print(
rich.panel.Panel( rich.panel.Panel(
@@ -187,7 +189,8 @@ def _io_status(message: str, prefix: str, style: str, title: Optional[str] = Non
style=style, style=style,
expand=False, expand=False,
title_align="left", title_align="left",
) ),
file=file
) )
else: else:
rich.print(f"[{style}]{prefix}{message}[/{style}]") rich.print(f"[{style}]{prefix}{message}[/{style}]")
+16 -24
View File
@@ -32,7 +32,15 @@ def tag(token: Optional[str] = None):
if ci and not token: if ci and not token:
raise GitFlowError("No hay token disponible") raise GitFlowError("No hay token disponible")
merge_commit = get_last_merge_commit() merge_commit = Git(
"log", first_parent=True, merges=True, max_count=1, format="%H"
).firstline()
if not merge_commit:
if not ci:
raise GitFlowError("No hay merges a taggear.")
return
# Con varios entornos cada uno versiona por separado (v1.0.0-prod), con uno solo no hace falta # Con varios entornos cada uno versiona por separado (v1.0.0-prod), con uno solo no hace falta
suffix = f"-{target}" if len(base.environments) > 1 else "" suffix = f"-{target}" if len(base.environments) > 1 else ""
@@ -55,6 +63,7 @@ def tag(token: Optional[str] = None):
) )
if not next_tag: if not next_tag:
if not ci:
base.io_info( base.io_info(
"Los cambios realizados no implican un salto de versión, se mantiene la anterior." "Los cambios realizados no implican un salto de versión, se mantiene la anterior."
) )
@@ -63,14 +72,15 @@ def tag(token: Optional[str] = None):
changelog = Changelog() changelog = Changelog()
changelog.update(next_tag, commits) changelog.update(next_tag, commits)
Git("add", Changelog.FILENAME).exec(print="Agregando nuevo CHANGELOG.md") Git("add", Changelog.FILENAME).exec(print=None if ci else "Agregando nuevo CHANGELOG.md")
Git("commit", message=Changelog.COMMIT_MESSAGE).exec(print="Creando commit") Git("commit", message=Changelog.COMMIT_MESSAGE).exec(print=None if ci else "Creando commit")
tag_commit = Git("show", "HEAD", patch=False, format="%h").firstline() tag_commit = Git("show", "HEAD", patch=False, format="%h").firstline()
if ci: if ci:
Git("push").exec(print="Subiendo commit al remoto para taggearlo") Git("push").exec()
base.io_success(base.get_remote_api(token).create_tag(next_tag, tag_commit)) base.get_remote_api(token).create_tag(next_tag, tag_commit)
print(next_tag)
else:
Git("tag", next_tag, tag_commit).exec(print="Creando tag localmente") Git("tag", next_tag, tag_commit).exec(print="Creando tag localmente")
@@ -81,24 +91,6 @@ def get_token_and_ci(token: Optional[str]):
return (base.ensure_repository_token(), False) return (base.ensure_repository_token(), False)
def get_last_merge_commit():
commit = Git(
"log", first_parent=True, merges=True, max_count=1, format="%H"
).firstline()
if not commit:
raise GitFlowError("No hay merges a taggear.")
return commit
def check_not_tagged(commit: str):
tag = Git("describe", commit, tags=True, exact_match=True).firstline(check=False)
if tag:
raise GitFlowError("El commit a taggear ya tiene tag: " + tag)
def get_next_tag_from_commits( def get_next_tag_from_commits(
commits: list[str], suffix: str, current_tag: str | None commits: list[str], suffix: str, current_tag: str | None
) -> str | None: ) -> str | None: