Compare commits
10
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
01631cfddd | ||
|
|
ad76e13673 | ||
|
|
d054881f3e | ||
|
|
ab3023acb7 | ||
|
|
aa63815cc6 | ||
|
|
9ef3100871 | ||
|
|
201e2b54a6 | ||
|
|
a5e50b8b16 | ||
|
|
df09810806 | ||
|
|
e44cd98696 |
@@ -5,13 +5,11 @@ on:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
Publish-to-PyPI:
|
||||
Bump-Build-Publish:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
@@ -19,19 +17,27 @@ 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 uv
|
||||
uses: astral-sh/setup-uv@v8.3.2
|
||||
|
||||
- name: Bump version
|
||||
- name: Install git-flow and bump version
|
||||
id: version
|
||||
run: |
|
||||
uv run git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
||||
pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
|
||||
TAG=$(git-flow tag --token="${{ secrets.GITEA_TOKEN }}")
|
||||
|
||||
if [ "$TAG" = "" ]; then
|
||||
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
|
||||
if: steps.version.outputs.should_build == 'true'
|
||||
run: |
|
||||
uv build
|
||||
uv publish --token="${{ secrets.PYPI_TOKEN }}"
|
||||
@@ -18,7 +18,7 @@ app = typer.Typer()
|
||||
|
||||
|
||||
@app.command()
|
||||
def tag(token: Optional[str] = None):
|
||||
def tag(token: Optional[str] = None, update_changelog: bool = False):
|
||||
"""Crea un nuevo tag para el último merge."""
|
||||
base.ensure_initialized()
|
||||
|
||||
@@ -69,15 +69,18 @@ def tag(token: Optional[str] = None):
|
||||
)
|
||||
return
|
||||
|
||||
changelog = Changelog()
|
||||
if update_changelog:
|
||||
changelog = Changelog()
|
||||
changelog.update(next_tag, commits)
|
||||
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")
|
||||
|
||||
if ci:
|
||||
Git("push").exec()
|
||||
|
||||
changelog.update(next_tag, commits)
|
||||
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()
|
||||
base.get_remote_api(token).create_tag(next_tag, tag_commit)
|
||||
print(next_tag)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user