mirror of
https://github.com/unclecode/crawl4ai.git
synced 2026-06-10 15:58:15 +00:00
Bug fixes: - Verify redirect targets are alive before returning from URL seeder (#1622) - Wire mean_delay/max_range from CrawlerRunConfig into dispatcher rate limiter (#1786) - Use DOMParser instead of innerHTML in process_iframes to prevent XSS (#1796) Security/Docker: - Require api_token for /token endpoint when configured (#1795) - Deep-crawl streaming now mirrors Python library behavior via arun() (#1798) CI: - Bump GitHub Actions to latest versions - checkout v6, setup-python v6, build-push-action v6, setup-buildx v4, login v4 (#1734) Features: - Support type-list pipeline in JsonCssExtractionStrategy for chained extraction like ["attribute", "regex"] (#1290) - Add --json-ensure-ascii CLI flag and JSON_ENSURE_ASCII config setting for Unicode preservation in JSON output (#1668)
114 lines
4.1 KiB
YAML
114 lines
4.1 KiB
YAML
name: Release Pipeline
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
- '!test-v*' # Exclude test tags
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # Required for creating releases
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: '3.12'
|
|
|
|
- name: Extract version from tag
|
|
id: get_version
|
|
run: |
|
|
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
echo "VERSION=$TAG_VERSION" >> $GITHUB_OUTPUT
|
|
echo "Releasing version: $TAG_VERSION"
|
|
|
|
- name: Install package dependencies
|
|
run: |
|
|
pip install -e .
|
|
|
|
- name: Check version consistency
|
|
run: |
|
|
TAG_VERSION=${{ steps.get_version.outputs.VERSION }}
|
|
PACKAGE_VERSION=$(python -c "from crawl4ai.__version__ import __version__; print(__version__)")
|
|
|
|
echo "Tag version: $TAG_VERSION"
|
|
echo "Package version: $PACKAGE_VERSION"
|
|
|
|
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
|
|
echo "❌ Version mismatch! Tag: $TAG_VERSION, Package: $PACKAGE_VERSION"
|
|
echo "Please update crawl4ai/__version__.py to match the tag version"
|
|
exit 1
|
|
fi
|
|
echo "✅ Version check passed: $TAG_VERSION"
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
pip install build twine
|
|
|
|
- name: Build package
|
|
run: python -m build
|
|
|
|
- name: Check package
|
|
run: twine check dist/*
|
|
|
|
- name: Upload to PyPI
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
|
run: |
|
|
echo "📦 Uploading to PyPI..."
|
|
twine upload dist/*
|
|
echo "✅ Package uploaded to https://pypi.org/project/crawl4ai/"
|
|
|
|
- name: Create GitHub Release
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
tag_name: v${{ steps.get_version.outputs.VERSION }}
|
|
name: Release v${{ steps.get_version.outputs.VERSION }}
|
|
body: |
|
|
## 🎉 Crawl4AI v${{ steps.get_version.outputs.VERSION }} Released!
|
|
|
|
### 📦 Installation
|
|
|
|
**PyPI:**
|
|
```bash
|
|
pip install crawl4ai==${{ steps.get_version.outputs.VERSION }}
|
|
```
|
|
|
|
**Docker:**
|
|
```bash
|
|
docker pull unclecode/crawl4ai:${{ steps.get_version.outputs.VERSION }}
|
|
docker pull unclecode/crawl4ai:latest
|
|
```
|
|
|
|
**Note:** Docker images are being built and will be available shortly.
|
|
Check the [Docker Release workflow](https://github.com/${{ github.repository }}/actions/workflows/docker-release.yml) for build status.
|
|
|
|
### 📝 What's Changed
|
|
See [CHANGELOG.md](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md) for details.
|
|
draft: false
|
|
prerelease: false
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Summary
|
|
run: |
|
|
echo "## 🚀 Release Complete!" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### 📦 PyPI Package" >> $GITHUB_STEP_SUMMARY
|
|
echo "- Version: ${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "- URL: https://pypi.org/project/crawl4ai/" >> $GITHUB_STEP_SUMMARY
|
|
echo "- Install: \`pip install crawl4ai==${{ steps.get_version.outputs.VERSION }}\`" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### 📋 GitHub Release" >> $GITHUB_STEP_SUMMARY
|
|
echo "- https://github.com/${{ github.repository }}/releases/tag/v${{ steps.get_version.outputs.VERSION }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "" >> $GITHUB_STEP_SUMMARY
|
|
echo "### 🐳 Docker Images" >> $GITHUB_STEP_SUMMARY
|
|
echo "Docker images are being built in a separate workflow." >> $GITHUB_STEP_SUMMARY
|
|
echo "Check: https://github.com/${{ github.repository }}/actions/workflows/docker-release.yml" >> $GITHUB_STEP_SUMMARY
|