Compare commits
13
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a17d9c308a | ||
|
|
7121d40ed8 | ||
|
|
41b7a9e602 | ||
|
|
f35dbc126a | ||
|
|
410c5f9356 | ||
|
|
7a24ccb24c | ||
|
|
dc35b635a1 | ||
|
|
5171100c76 | ||
|
|
68cec91506 | ||
|
|
02c081f68f | ||
|
|
a83d693584 | ||
|
|
b51544ddab | ||
|
|
d5a88d6c8d |
@@ -10,6 +10,8 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 10
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
@@ -28,16 +30,16 @@ jobs:
|
||||
- name: Install git-flow and bump version
|
||||
id: version
|
||||
run: |
|
||||
# pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
|
||||
uv run git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
||||
TAG=force
|
||||
pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
|
||||
git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
||||
RESULT="$?"
|
||||
|
||||
if [ -z "$TAG" ]; then
|
||||
if [ "$RESULT" -eq 0 ]; then
|
||||
echo "New tag available."
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "No new tag available, skipping next step."
|
||||
echo "should_build=false" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "New tag available: $TAG."
|
||||
echo "should_build=true" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Build and publish
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
## v1.23.0 - 2026-09-21
|
||||
|
||||
- **feature**: add fetch depth [[jonathan.nerat](mailto:jonathan.nerat@gmail.com)] (68cec91)
|
||||
|
||||
---
|
||||
|
||||
|
||||
## v1.22.3 - 2026-09-21
|
||||
|
||||
- **bugfix**: tag locally for workflow to run [[jteran](mailto:jteran@renatre.org.ar)] (24a40c9)
|
||||
|
||||
@@ -16,11 +16,11 @@ app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def tag(token: str | None = None, update_changelog: bool = False):
|
||||
def tag(target: str | None = None, token: str | None = None, update_changelog: bool = False):
|
||||
"""Crea un nuevo tag para el último merge."""
|
||||
base.ensure_initialized()
|
||||
|
||||
target = Git.get_current_branch()
|
||||
target = target or Git.get_current_branch()
|
||||
|
||||
if target not in base.environments:
|
||||
raise GitFlowError("Solo se pueden taggear commits en ramas principales.")
|
||||
@@ -35,9 +35,7 @@ def tag(token: str | None = None, update_changelog: bool = False):
|
||||
).firstline()
|
||||
|
||||
if not merge_commit:
|
||||
if not ci:
|
||||
raise GitFlowError("No hay merges a taggear.")
|
||||
return
|
||||
raise GitFlowError("No hay merges a taggear.")
|
||||
|
||||
# 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 ""
|
||||
@@ -50,7 +48,7 @@ def tag(token: str | None = None, update_changelog: bool = False):
|
||||
current_tag = base.get_remote_api(token).get_latest_tag(suffix)
|
||||
else:
|
||||
# Commits se obtienen del último merge, listando hasta el primer forkpoint
|
||||
branch = Git("show", merge_commit + "^2", patch=False, format="%h").firstline()
|
||||
branch = Git("show", merge_commit + "^2", patch=False, format="%H").firstline()
|
||||
fork_point = Git.get_first_fork_point(branch, target)
|
||||
commits = Git.get_commits(fork_point, branch)
|
||||
# Último tag se obtiene localmente
|
||||
@@ -60,8 +58,6 @@ def tag(token: str | None = None, update_changelog: bool = False):
|
||||
[c.subject for c in commits], suffix, current_tag
|
||||
)
|
||||
|
||||
base.io_info(f"Current tag: {current_tag}. Next tag: {next_tag}")
|
||||
|
||||
if not next_tag:
|
||||
base.io_warning(
|
||||
"Los cambios realizados no implican un salto de versión, se mantiene la anterior."
|
||||
@@ -78,7 +74,7 @@ def tag(token: str | None = None, update_changelog: bool = False):
|
||||
if ci:
|
||||
Git("push").exec()
|
||||
|
||||
tag_commit = Git("show", "HEAD", patch=False, format="%h").firstline()
|
||||
tag_commit = Git("show", "HEAD", patch=False, format="%H").firstline()
|
||||
|
||||
if ci:
|
||||
base.io_success(base.get_remote_api(token).create_tag(next_tag, tag_commit))
|
||||
|
||||
@@ -46,7 +46,7 @@ class GitlabRemoteAPI(RemoteAPI):
|
||||
if response.ok:
|
||||
return "Tag creado exitosamente: " + tag
|
||||
else:
|
||||
raise GitFlowError("Ocurrió un error al crear el tag para repositorio " + quote(self.repository, safe="") + ": " + response.text)
|
||||
raise GitFlowError("Ocurrió un error al crear el tag: " + response.text)
|
||||
|
||||
def get_merge_commits(self, merge_commit: str) -> list[Commit]:
|
||||
mrs = self.get_json(
|
||||
|
||||
Reference in New Issue
Block a user