Skip to content

2025-04-25-V0.0.6

2025-04-25-V0.0.6 #14

Workflow file for this run

name: Upload Python Package
on:
release:
types: [published]
# on:
# push:
# branches: [main]
permissions:
contents: read
id-token: write
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Cache uv dependencies
uses: actions/cache@v4
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('pyproject.toml') }}
- name: Create virtual environment
run: |
uv venv .venv
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
echo ".venv/bin" >> $GITHUB_PATH
# - name: Install tomli for version verification
# run: |
# uv pip install tomli
# - name: Verify version consistency
# run: |
# VERSION=$(python -c "import tomli; print(tomli.load(open('pyproject.toml', 'rb'))['project']['version'])")
# RELEASE_TAG=${{ github.event.release.tag_name }}
# if [[ "v$VERSION" != "$RELEASE_TAG" ]]; then
# echo "Version mismatch: pyproject.toml ($VERSION) != release tag ($RELEASE_TAG)"
# exit 1
# fi
- name: Build release distributions
run: |
uv build --verbose
- name: Test CLI entry point
run: |
uv pip install dist/*.whl
uv run -m tdengine_mcp_server -h
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
environment:
name: pypi
url: https://pypi.org/project/tdengine-mcp-server/${{ github.event.release.tag_name }}
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/
- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
# - name: Test package with uvx
# run: |
# uvx tdengine-mcp-server -h
# env:
# UVX_PYPI_INDEX: https://pypi.org/simple/