Skip to content

chore: post-release version bump #106

chore: post-release version bump

chore: post-release version bump #106

name: Publish to Test PyPI
on:
push:
branches:
- dev
paths-ignore:
- 'docs/**'
- '**.md'
- '**.sample'
workflow_dispatch: ~
jobs:
build-n-publish:
name: Build and publish package to Test PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
ahead="$(git describe --tags --always | cut -s -d- -f 2)"
if [ -n "$ahead" ]; then
grep -Pq "^__version__\s*=\s*['\"].*\.dev['\"]\s*\$" src/version.py || exit 1
sed -i "s/\.dev/\.dev$ahead/" src/version.py
fi
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
print_hash: true
skip_existing: true