From dbec48df95b53cb3f9e05f55a7d196bf6160a821 Mon Sep 17 00:00:00 2001 From: Greyson Lalonde Date: Fri, 13 Mar 2026 02:22:32 -0400 Subject: [PATCH] ci: add slack notification on successful pypi publish --- .github/workflows/publish.yml | 39 +++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1b3000647..265727c93 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -93,3 +93,42 @@ jobs: echo "Some packages failed to publish" exit 1 fi + + - name: Extract version and release notes + if: success() + id: release-info + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + version=$(uv run python -c "import tomllib; print(tomllib.load(open('lib/crewai/pyproject.toml','rb'))['project']['version'])") + echo "version=$version" >> $GITHUB_OUTPUT + + tag="${{ inputs.release_tag }}" + if [ -z "$tag" ]; then + tag="$version" + fi + + # Fetch release body and convert GitHub markdown to Slack mrkdwn + notes=$(gh release view "$tag" --json body -q '.body' 2>/dev/null || echo "") + if [ -n "$notes" ]; then + notes=$(echo "$notes" \ + | sed 's/^### \(.*\)/*\1*/g' \ + | sed 's/^## \(.*\)/*\1*/g' \ + | sed 's/\*\*\([^*]*\)\*\*/*\1*/g' \ + | sed 's/^- /• /g') + fi + + { + echo "notes<> $GITHUB_OUTPUT + + - name: Notify Slack + if: success() + uses: slackapi/slack-github-action@v2.1.0 + with: + webhook: ${{ secrets.SLACK_WEBHOOK_URL }} + webhook-type: incoming-webhook + payload: | + text: ":rocket: *crewAI v${{ steps.release-info.outputs.version }}* published to \n\n${{ steps.release-info.outputs.notes }}"