2025-04-24-V0.0.5 #13
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |