Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 64 additions & 62 deletions .github/workflows/pypi-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,62 @@ jobs:
run: |
pipx install poetry

# OpenHands-CLI step runs first since it's simpler and less error-prone
- name: Create PR for OpenHands-CLI repo
run: |
set -euo pipefail

REPO="OpenHands/openhands-cli"
BRANCH="bump-sdk-$VERSION"

echo "🔄 Creating PR for $REPO..."

# Clone the repo
git clone "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git" openhands-cli-repo
cd openhands-cli-repo

# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Create branch
git checkout -b "$BRANCH"

# Update versions using uv
uv add "openhands-sdk==$VERSION" "openhands-tools==$VERSION"

# Check if there are changes
if git diff --quiet; then
echo "⚠️ No changes detected in $REPO - versions may already be up to date"
exit 0
fi

# Commit and push
git add pyproject.toml uv.lock
git commit -m "Bump openhands-sdk, openhands-tools to $VERSION" \
-m "Automated version bump after PyPI release." \
-m "Co-authored-by: openhands <[email protected]>"
git push -u origin "$BRANCH"

# Create PR
gh pr create \
--repo "$REPO" \
--title "Bump SDK packages to v$VERSION" \
--body "## Automated Version Bump

This PR updates the following packages to version **$VERSION**:
- \`openhands-sdk\`
- \`openhands-tools\`

**Triggered by:** Release of [software-agent-sdk v$VERSION](https://github.com/OpenHands/software-agent-sdk/releases/tag/v$VERSION)

---
_This PR was automatically created by the pypi-release workflow._" \
--base main \
--head "$BRANCH"

echo "✅ PR created for $REPO"

- name: Create PR for OpenHands repo
run: |
set -euo pipefail
Expand Down Expand Up @@ -163,24 +219,25 @@ jobs:
echo "📦 SDK commit hash: $SDK_COMMIT_HASH"

# 1. Update versions in pyproject.toml using poetry (root)
# Use --lock to only update pyproject.toml without modifying lock file
echo "📝 Updating root pyproject.toml..."
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
poetry add --lock "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"

# 2. Update versions in enterprise/pyproject.toml using poetry
# Must be done BEFORE running poetry lock in root to avoid conflicting constraints
# Use --lock to only update pyproject.toml without modifying lock file
echo "📝 Updating enterprise/pyproject.toml..."
cd enterprise
poetry add "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
poetry add --lock "openhands-sdk==$VERSION" "openhands-tools==$VERSION" "openhands-agent-server==$VERSION"
cd ..

# 3. Generate poetry.lock in root
# 3. Generate poetry.lock in root (regenerate from scratch)
echo "🔒 Running poetry lock in root..."
poetry lock
poetry lock --no-update

# 4. Generate poetry.lock in enterprise directory
# 4. Generate poetry.lock in enterprise directory (regenerate from scratch)
echo "🔒 Running poetry lock in enterprise/..."
cd enterprise
poetry lock
poetry lock --no-update
cd ..

# 5. Update the hash in sandbox_spec_service.py
Expand Down Expand Up @@ -243,61 +300,6 @@ jobs:

echo "✅ PR created for $REPO"

- name: Create PR for OpenHands-CLI repo
run: |
set -euo pipefail

REPO="All-Hands-AI/openhands-cli"
BRANCH="bump-sdk-$VERSION"

echo "🔄 Creating PR for $REPO..."

# Clone the repo
git clone "https://x-access-token:${GH_TOKEN}@github.com/${REPO}.git" openhands-cli-repo
cd openhands-cli-repo

# Configure git
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

# Create branch
git checkout -b "$BRANCH"

# Update versions using uv
uv add "openhands-sdk==$VERSION" "openhands-tools==$VERSION"

# Check if there are changes
if git diff --quiet; then
echo "⚠️ No changes detected in $REPO - versions may already be up to date"
exit 0
fi

# Commit and push
git add pyproject.toml uv.lock
git commit -m "Bump openhands-sdk, openhands-tools to $VERSION" \
-m "Automated version bump after PyPI release." \
-m "Co-authored-by: openhands <[email protected]>"
git push -u origin "$BRANCH"

# Create PR
gh pr create \
--repo "$REPO" \
--title "Bump SDK packages to v$VERSION" \
--body "## Automated Version Bump

This PR updates the following packages to version **$VERSION**:
- \`openhands-sdk\`
- \`openhands-tools\`

**Triggered by:** Release of [software-agent-sdk v$VERSION](https://github.com/OpenHands/software-agent-sdk/releases/tag/v$VERSION)

---
_This PR was automatically created by the pypi-release workflow._" \
--base main \
--head "$BRANCH"

echo "✅ PR created for $REPO"

- name: Summary
run: |
echo "## ✅ Version Bump PRs Created" >> $GITHUB_STEP_SUMMARY
Expand Down
Loading