Skip to content
Open
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
45 changes: 45 additions & 0 deletions .github/workflows/release-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,3 +202,48 @@ jobs:
run: |
uv pip install --upgrade twine
twine upload --skip-existing *.whl

discord-notify:
name: Discord Release Notification
runs-on: ubuntu-latest
needs: [release]
if: always() && needs.release.result == 'success'
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and send Discord notification
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
run: |
if [[ "$GITHUB_REF" != refs/tags/v* ]]; then
echo "::warning::GITHUB_REF ($GITHUB_REF) is not a tag push — skipping Discord notification"
exit 0
fi

VERSION="${GITHUB_REF#refs/tags/v}"
PREV_TAG=$(git tag --sort=-v:refname | grep -E '^v[0-9]' | sed -n '2p')

if [ -z "$PREV_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s" --no-merges -20 | grep -v "^- Release " || true)
else
CHANGELOG=$(git log "${PREV_TAG}..HEAD" --pretty=format:"- %s" --no-merges | grep -v "^- Release " || true)
fi

read -r -d '' MESSAGE << EOM || true
Hey @everyone 👋

**Release Robyn v${VERSION}**

${CHANGELOG}

Upgrade: \`pip install --upgrade robyn\`

https://github.com/sparckles/Robyn/releases/tag/v${VERSION}
EOM

PAYLOAD=$(jq -n --arg msg "$MESSAGE" '{content: $msg}')

curl -f -H "Content-Type: application/json" \
-d "$PAYLOAD" \
"$DISCORD_WEBHOOK_URL"
Loading