47 lines
1.1 KiB
YAML
47 lines
1.1 KiB
YAML
name: Publish to PyPI
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
Publish-to-PyPI:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Fetch tags
|
|
run: |
|
|
git fetch --prune --unshallow --tags
|
|
|
|
- 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 uv
|
|
uses: astral-sh/setup-uv@v8.3.2
|
|
|
|
- name: Count commits
|
|
run: |
|
|
echo "Commit count: $(git rev-list --count main)"
|
|
echo "Tags available:"
|
|
git tag
|
|
echo "Remote tags available:"
|
|
git ls-remote --tags
|
|
|
|
- name: Bump version
|
|
run: |
|
|
uv run git-flow tag --token="${{ secrets.GITEA_TOKEN }}"
|
|
|
|
- name: Build and publish
|
|
run: |
|
|
uv build
|
|
uv publish --token="${{ secrets.PYPI_TOKEN }}" |