Skip to content

Release v2.9.2

Release v2.9.2 #171

Workflow file for this run

name: Publish to PyPI
on:
push:
branches:
- 'release/**'
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-24.04
# The production environment's protection rules (required reviewer,
# deployment branches) gate every publish here.
environment: production
permissions:
contents: read
id-token: write # For PyPI trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Get current version
id: current-version
run: |
CURRENT_VERSION=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
echo "current_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "Current version: $CURRENT_VERSION"
- name: Build package
run: python -m build
- name: Check if version exists on PyPI
id: check-pypi
run: |
VERSION="${{ steps.current-version.outputs.current_version }}"
PACKAGE_NAME="robosystems-client"
# Check if version exists on PyPI
if curl -s "https://pypi.org/pypi/${PACKAGE_NAME}/${VERSION}/json" | grep -q "\"version\""; then
echo "❌ Version ${VERSION} already exists on PyPI"
echo "version_exists=true" >> $GITHUB_OUTPUT
exit 1
else
echo "✅ Version ${VERSION} does not exist on PyPI, safe to publish"
echo "version_exists=false" >> $GITHUB_OUTPUT
fi
- name: Publish to PyPI
if: steps.check-pypi.outputs.version_exists == 'false'
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
with:
verbose: true