41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: Publish to PyPI
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
Bump-Build-Publish:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name "gitea-actions"
|
|
git config --global user.email "actions@git.jonathanteran.dev"
|
|
git config --global --add safe.directory "$GITHUB_WORKSPACE"
|
|
|
|
- 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 }}"
|
|
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 }}" |