Skip to content

Add e2e test and example for filesystem-based agents #178

Add e2e test and example for filesystem-based agents

Add e2e test and example for filesystem-based agents #178

name: Create Release Tag
on:
pull_request:
types: [closed]
branches: [main]
jobs:
create-tag:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Extract version from branch name
id: extract_version
run: |
BRANCH_NAME="${{ github.event.pull_request.head.ref }}"
VERSION="${BRANCH_NAME#release/v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create and push tag
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
# Create annotated tag
git tag -a "v${{ steps.extract_version.outputs.version }}" \
-m "Release v${{ steps.extract_version.outputs.version }}"
# Push tag
git push origin "v${{ steps.extract_version.outputs.version }}"
- name: Create GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.extract_version.outputs.version }}"
# Extract changelog section for this version to a temp file
awk -v ver="$VERSION" '
/^## / {
if (found) exit
if ($2 == ver) found=1
next
}
found { print }
' CHANGELOG.md > release_notes.md
# Append install instructions
cat >> release_notes.md << 'EOF'
---
**PyPI:** https://pypi.org/project/claude-agent-sdk/VERSION/

Check failure on line 60 in .github/workflows/create-release-tag.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/create-release-tag.yml

Invalid workflow file

You have an error in your yaml syntax on line 60
```bash
pip install claude-agent-sdk==VERSION
```
EOF
# Replace VERSION placeholder
sed -i "s/VERSION/$VERSION/g" release_notes.md
# Create release with notes from file
gh release create "v$VERSION" \
--title "v$VERSION" \
--notes-file release_notes.md