Skip to content

Bump version to 0.1.2397 #2396

Bump version to 0.1.2397

Bump version to 0.1.2397 #2396

Workflow file for this run

name: Publish to PyPI
on:
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine setuptools wheel
- name: Update version
run: |
# Get commit count since last tag
COMMIT_COUNT=$(git rev-list --count HEAD)
# Create new version with commit count
NEW_VERSION="0.1.${COMMIT_COUNT}"
# Update version in __init__.py
sed -i "s/__version__ = \".*\"/__version__ = \"${NEW_VERSION}\"/" llm_dialog_manager/__init__.py
# Update version in pyproject.toml
sed -i "s/version = \".*\"/version = \"${NEW_VERSION}\"/" pyproject.toml
# Commit the version update
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add llm_dialog_manager/__init__.py pyproject.toml
git commit -m "Bump version to ${NEW_VERSION}"
git push
- name: Build package
run: python -m build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*