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: Publish all OpenHands packages (uv) | |
| on: | |
| # Run manually | |
| workflow_dispatch: | |
| # Run automatically when a release is published | |
| release: | |
| types: [published] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| version: ${{ steps.extract_version.outputs.version }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Extract version from release tag | |
| id: extract_version | |
| run: | | |
| # Get version from release tag (e.g., v1.2.3 -> 1.2.3) | |
| if [[ "${{ github.event_name }}" == "release" ]]; then | |
| VERSION="${{ github.event.release.tag_name }}" | |
| VERSION="${VERSION#v}" # Remove 'v' prefix if present | |
| else | |
| # For manual dispatch, extract from pyproject.toml | |
| VERSION=$(grep -m1 '^version = ' openhands-sdk/pyproject.toml | cut -d'"' -f2) | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "📦 Version: $VERSION" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: latest | |
| python-version: '3.13' | |
| - name: Build and publish all packages | |
| env: | |
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN_OPENHANDS }} | |
| run: | | |
| set -euo pipefail | |
| if [ -z "${UV_PUBLISH_TOKEN:-}" ]; then | |
| echo "❌ Missing secret PYPI_TOKEN_OPENHANDS" | |
| exit 1 | |
| fi | |
| PACKAGES=( | |
| openhands-sdk | |
| openhands-tools | |
| openhands-workspace | |
| openhands-agent-server | |
| ) | |
| echo "🚀 Building and publishing all packages..." | |
| for PKG in "${PACKAGES[@]}"; do | |
| echo "===== $PKG =====" | |
| uv build --package "$PKG" | |
| done | |
| # Use --check-url to skip files that already exist on PyPI | |
| # This allows re-running the workflow after partial failures | |
| uv publish --token "$UV_PUBLISH_TOKEN" --check-url https://pypi.org/simple/ | |
| echo "✅ All packages built and published successfully!" | |
| echo "" | |
| echo "📋 Note: Version bump PRs will be created by the 'Create Version Bump PRs' workflow" | |
| echo " which triggers automatically after this workflow completes." |