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
20 changes: 8 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ on:
description: 'Package version to publish (e.g., 0.1.4)'
required: true
type: string
claude_code_version:
description: 'Claude Code CLI version to bundle (e.g., 2.0.0 or latest)'
required: false
type: string
default: 'latest'
jobs:
test:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,7 +86,6 @@ jobs:
run: |
python scripts/build_wheel.py \
--version "${{ github.event.inputs.version }}" \
--cli-version "${{ github.event.inputs.claude_code_version }}" \
--skip-sdist \
--clean
shell: bash
Expand Down Expand Up @@ -132,9 +126,12 @@ jobs:
run: |
python scripts/update_version.py "${{ env.VERSION }}"

- name: Update CLI version
- name: Read CLI version from code
id: cli_version
run: |
python scripts/update_cli_version.py "${{ github.event.inputs.claude_code_version }}"
CLI_VERSION=$(python -c "import re; print(re.search(r'__cli_version__ = \"([^\"]+)\"', open('src/claude_agent_sdk/_cli_version.py').read()).group(1))")
echo "cli_version=$CLI_VERSION" >> $GITHUB_OUTPUT
echo "Bundled CLI version: $CLI_VERSION"

- name: Download all wheel artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -181,8 +178,8 @@ jobs:
git checkout -b "$BRANCH_NAME"

# Commit version changes
git add pyproject.toml src/claude_agent_sdk/_version.py src/claude_agent_sdk/_cli_version.py
git commit -m "chore: bump version to ${{ env.VERSION }} with CLI ${{ github.event.inputs.claude_code_version }}"
git add pyproject.toml src/claude_agent_sdk/_version.py
git commit -m "chore: release v${{ env.VERSION }}"

- name: Update changelog with Claude
continue-on-error: true
Expand All @@ -207,12 +204,11 @@ jobs:
## Changes
- Updated version in \`pyproject.toml\` to ${{ env.VERSION }}
- Updated version in \`src/claude_agent_sdk/_version.py\` to ${{ env.VERSION }}
- Updated bundled CLI version in \`src/claude_agent_sdk/_cli_version.py\` to ${{ github.event.inputs.claude_code_version }}
- Updated \`CHANGELOG.md\` with release notes

## Release Information
- Published to PyPI: https://pypi.org/project/claude-agent-sdk/${{ env.VERSION }}/
- Bundled CLI version: ${{ github.event.inputs.claude_code_version }}
- Bundled CLI version: ${{ steps.cli_version.outputs.cli_version }}
- Install with: \`pip install claude-agent-sdk==${{ env.VERSION }}\`

🤖 Generated by GitHub Actions"
Expand Down
Loading