name: Publish to PyPI on: push: branches: - main jobs: Bump-Build-Publish: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v7 with: fetch-depth: 10 - name: Set up Python uses: actions/setup-python@v6 with: python-version-file: ".python-version" - name: Install git-flow and bump version id: version run: | pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}" # El código 3 indica que no hace falta un nuevo tag: se saltea la publicación status=0 git-flow tag --token="${{ secrets.GITEA_TOKEN }}" || status=$? if [ "$status" -eq 3 ]; then echo "skip=true" >> "$GITHUB_OUTPUT" elif [ "$status" -ne 0 ]; then exit "$status" fi - name: Install uv if: steps.version.outputs.skip != 'true' uses: astral-sh/setup-uv@v8.3.2 - name: Build and publish if: steps.version.outputs.skip != 'true' run: | uv build uv publish --token="${{ secrets.PYPI_TOKEN }}"