docs: add condition checking before build and publish

This commit is contained in:
jt
2026-09-21 11:05:28 -03:00
parent e44cd98696
commit a5e50b8b16
@@ -5,7 +5,7 @@ on:
- main
jobs:
Publish-to-PyPI:
Bump-Build-Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
@@ -23,11 +23,19 @@ jobs:
python-version-file: ".python-version"
- name: Install git-flow and bump version
id: version
run: |
pip install git-flow-envs=="${{ vars.GITFLOWENVS_VERSION }}"
git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
TAG=$(git-flow tag --token="${{ secrets.GITEA_TOKEN }}")
if [ "$TAG" = "" ]; then
echo "should_build=false" >> $GITHUB_OUTPUT
else
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 }}"