6565 publish :
6666 needs : [test, lint]
6767 runs-on : ubuntu-latest
68+ permissions :
69+ contents : write
70+ pull-requests : write
6871
6972 steps :
7073 - uses : actions/checkout@v4
74+ with :
75+ token : ${{ secrets.GITHUB_TOKEN }}
7176
7277 - name : Set up Python
7378 uses : actions/setup-python@v5
@@ -108,4 +113,41 @@ jobs:
108113 run : |
109114 twine upload dist/*
110115 echo "Package published to PyPI"
111- echo "Install with: pip install claude-code-sdk==${{ github.event.inputs.version }}"
116+ echo "Install with: pip install claude-code-sdk==${{ github.event.inputs.version }}"
117+
118+ - name : Create version update PR
119+ env :
120+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
121+ run : |
122+ # Create a new branch for the version update
123+ BRANCH_NAME="release/v${{ github.event.inputs.version }}"
124+ git checkout -b "$BRANCH_NAME"
125+
126+ # Configure git
127+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
128+ git config --local user.name "github-actions[bot]"
129+
130+ # Commit the version changes
131+ git add pyproject.toml src/claude_code_sdk/__init__.py
132+ git commit -m "chore: bump version to ${{ github.event.inputs.version }}"
133+
134+ # Push the branch
135+ git push origin "$BRANCH_NAME"
136+
137+ # Create PR using GitHub CLI (gh)
138+ gh pr create \
139+ --title "chore: bump version to ${{ github.event.inputs.version }}" \
140+ --body "This PR updates the version to ${{ github.event.inputs.version }} after publishing to PyPI.
141+
142+ ## Changes
143+ - Updated version in \`pyproject.toml\`
144+ - Updated version in \`src/claude_code_sdk/__init__.py\`
145+
146+ ## Release Information
147+ - Published to PyPI: https://pypi.org/project/claude-code-sdk/${{ github.event.inputs.version }}/
148+ - Install with: \`pip install claude-code-sdk==${{ github.event.inputs.version }}\`
149+
150+ ## Next Steps
151+ After merging this PR, a release tag will be created automatically." \
152+ --base main \
153+ --head "$BRANCH_NAME"
0 commit comments