name: Release on: push: tags: - 'v*' jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip pip install requests beautifulsoup4 pip install pytest if [ -f mcp/requirements.txt ]; then pip install -r mcp/requirements.txt; fi - name: Run tests run: | python -m pytest tests/ -v - name: Extract version from tag id: get_version run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT - name: Create Release Notes id: release_notes run: | if [ -f CHANGELOG.md ]; then # Extract changelog for this version sed -n "/## \[${{ steps.get_version.outputs.VERSION }}\]/,/## \[/p" CHANGELOG.md | sed '$d' > release_notes.md else echo "Release ${{ steps.get_version.outputs.VERSION }}" > release_notes.md fi - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: body_path: release_notes.md draft: false prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}