Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57c6ff7a4b | ||
|
|
4a39fe95d4 | ||
|
|
24a40c99bc | ||
|
|
bd03cf218b | ||
|
|
e9e7d2ad6e | ||
|
|
82c78c727a | ||
|
|
6d65462dbf | ||
|
|
6df7206eec | ||
|
|
e793feaa1e |
@@ -10,6 +10,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
@@ -17,15 +19,17 @@ jobs:
|
||||
git config --global user.email "actions@git.jonathanteran.dev"
|
||||
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
||||
|
||||
- name: Set up Python
|
||||
- name: "Set up Python"
|
||||
uses: actions/setup-python@v6
|
||||
with:
|
||||
python-version-file: ".python-version"
|
||||
|
||||
- name: Install git-flow and bump version
|
||||
- name: Install uv
|
||||
uses: astral-sh/setup-uv@v8.3.2
|
||||
|
||||
- name: Bump version
|
||||
run: |
|
||||
pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
|
||||
git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
||||
uv run git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
||||
|
||||
- name: Build and publish
|
||||
run: |
|
||||
|
||||
@@ -1,3 +1,17 @@
|
||||
## v1.22.3 - 2026-09-21
|
||||
|
||||
- **bugfix**: tag locally for workflow to run [[jteran](mailto:jteran@renatre.org.ar)] (24a40c9)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## v1.22.2 - 2026-09-21
|
||||
|
||||
- **bugfix**: fix workflow pipeline [[jteran](mailto:jteran@renatre.org.ar)] (82c78c7)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## 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)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import sys
|
||||
|
||||
from git_flow import (
|
||||
BRANCH_TYPES,
|
||||
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):
|
||||
_io_status(message, "✖ Error: ", "red", title)
|
||||
_io_status(message, "✖ Error: ", "red", title, file=sys.stderr)
|
||||
|
||||
|
||||
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)
|
||||
|
||||
|
||||
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:
|
||||
rich.print(
|
||||
rich.panel.Panel(
|
||||
@@ -187,7 +189,8 @@ def _io_status(message: str, prefix: str, style: str, title: Optional[str] = Non
|
||||
style=style,
|
||||
expand=False,
|
||||
title_align="left",
|
||||
)
|
||||
),
|
||||
file=file
|
||||
)
|
||||
else:
|
||||
rich.print(f"[{style}]{prefix}{message}[/{style}]")
|
||||
|
||||
+19
-27
@@ -32,7 +32,15 @@ def tag(token: Optional[str] = None):
|
||||
if ci and not token:
|
||||
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
|
||||
suffix = f"-{target}" if len(base.environments) > 1 else ""
|
||||
|
||||
@@ -55,23 +63,25 @@ def tag(token: Optional[str] = None):
|
||||
)
|
||||
|
||||
if not next_tag:
|
||||
base.io_info(
|
||||
"Los cambios realizados no implican un salto de versión, se mantiene la anterior."
|
||||
)
|
||||
if not ci:
|
||||
base.io_info(
|
||||
"Los cambios realizados no implican un salto de versión, se mantiene la anterior."
|
||||
)
|
||||
return
|
||||
|
||||
changelog = Changelog()
|
||||
|
||||
changelog.update(next_tag, commits)
|
||||
Git("add", Changelog.FILENAME).exec(print="Agregando nuevo CHANGELOG.md")
|
||||
Git("commit", message=Changelog.COMMIT_MESSAGE).exec(print="Creando commit")
|
||||
Git("add", Changelog.FILENAME).exec(print=None if ci else "Agregando nuevo CHANGELOG.md")
|
||||
Git("commit", message=Changelog.COMMIT_MESSAGE).exec(print=None if ci else "Creando commit")
|
||||
tag_commit = Git("show", "HEAD", patch=False, format="%h").firstline()
|
||||
|
||||
if ci:
|
||||
Git("push").exec(print="Subiendo commit al remoto para taggearlo")
|
||||
base.io_success(base.get_remote_api(token).create_tag(next_tag, tag_commit))
|
||||
Git("push").exec()
|
||||
base.get_remote_api(token).create_tag(next_tag, tag_commit)
|
||||
print(next_tag)
|
||||
|
||||
Git("tag", next_tag, tag_commit).exec(print="Creando tag localmente")
|
||||
Git("tag", next_tag, tag_commit).exec(print=None if ci else "Creando tag localmente")
|
||||
|
||||
|
||||
def get_token_and_ci(token: Optional[str]):
|
||||
@@ -81,24 +91,6 @@ def get_token_and_ci(token: Optional[str]):
|
||||
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(
|
||||
commits: list[str], suffix: str, current_tag: str | None
|
||||
) -> str | None:
|
||||
|
||||
Reference in New Issue
Block a user