Skip to content

Commit 3791202

Browse files
grdsdevclaude
andcommitted
feat(ci): add Slack notifications for releases
Added comprehensive Slack notification system for release workflows, matching the implementation pattern from supabase-js repository. **New Workflow:** - Created `.github/workflows/slack-notify.yml` reusable workflow - Sends formatted Slack messages with rich content blocks - Includes status indicators (✅/❌/ℹ️), repository info, commit details - Supports success, failure, and info notification types - Displays version and package information - Provides action buttons to view workflow run and commit **Integration:** - Updated `release-publish.yml` to notify on success/failure - Sends notification after package publishing completes - Includes package version in notification - Updated `release-tag.yml` to notify on success/failure - Sends notification after release tags are created - Helps track release pipeline progress **Configuration:** - Uses `secrets.SLACK_CLIENT_LIBS_WEBHOOK` for Slack webhook URL - Must be configured in repository secrets to enable notifications - Notifications only sent if secret is available **Additional:** - Added dependency-scan workflow badge to README This enables real-time visibility into release status via Slack, improving team awareness and enabling faster response to release issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 40e8086 commit 3791202

File tree

4 files changed

+175
-1
lines changed

4 files changed

+175
-1
lines changed

.github/workflows/release-publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,25 @@ jobs:
7878
else
7979
echo "⚠️ Some steps failed. Please review the logs above." >> $GITHUB_STEP_SUMMARY
8080
fi
81+
82+
notify-success:
83+
name: Notify Slack on Success
84+
needs: publish-packages
85+
if: ${{ needs.publish-packages.result == 'success' }}
86+
uses: ./.github/workflows/slack-notify.yml
87+
secrets: inherit
88+
with:
89+
title: 'Package Release'
90+
status: 'success'
91+
version: ${{ github.ref_name }}
92+
93+
notify-failure:
94+
name: Notify Slack on Failure
95+
needs: publish-packages
96+
if: ${{ always() && needs.publish-packages.result == 'failure' }}
97+
uses: ./.github/workflows/slack-notify.yml
98+
secrets: inherit
99+
with:
100+
title: 'Package Release'
101+
status: 'failure'
102+
version: ${{ github.ref_name }}

.github/workflows/release-tag.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,24 @@ jobs:
6161
fi
6262
echo "" >> $GITHUB_STEP_SUMMARY
6363
echo "**Commit:** ${{ github.event.head_commit.message }}" >> $GITHUB_STEP_SUMMARY
64-
echo "**Ref:** ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
64+
echo "**Ref:** ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
65+
66+
notify-success:
67+
name: Notify Slack on Success
68+
needs: create-tags
69+
if: ${{ needs.create-tags.result == 'success' }}
70+
uses: ./.github/workflows/slack-notify.yml
71+
secrets: inherit
72+
with:
73+
title: 'Release Tags Created'
74+
status: 'success'
75+
76+
notify-failure:
77+
name: Notify Slack on Failure
78+
needs: create-tags
79+
if: ${{ always() && needs.create-tags.result == 'failure' }}
80+
uses: ./.github/workflows/slack-notify.yml
81+
secrets: inherit
82+
with:
83+
title: 'Release Tags Creation'
84+
status: 'failure'

.github/workflows/slack-notify.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
name: Slack Notification (Reusable)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
title:
7+
required: true
8+
type: string
9+
description: 'Notification title (e.g., "Package Release", "Release Tags Created")'
10+
status:
11+
required: false
12+
type: string
13+
default: 'info'
14+
description: 'Notification status: success, failure, or info'
15+
version:
16+
required: false
17+
type: string
18+
description: 'Version string to display (e.g., "supabase-v2.0.0")'
19+
package:
20+
required: false
21+
type: string
22+
description: 'Package name (e.g., "gotrue", "postgrest")'
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
notify:
29+
name: Send Slack Notification
30+
runs-on: ubuntu-latest
31+
timeout-minutes: 5
32+
33+
steps:
34+
- name: Send Slack notification
35+
run: |
36+
# Determine status emoji and color
37+
if [ "${{ inputs.status }}" == "success" ]; then
38+
STATUS_EMOJI="✅"
39+
COLOR="#36a64f"
40+
elif [ "${{ inputs.status }}" == "failure" ]; then
41+
STATUS_EMOJI="❌"
42+
COLOR="#ff0000"
43+
else
44+
STATUS_EMOJI="ℹ️"
45+
COLOR="#3498db"
46+
fi
47+
48+
# Build version text
49+
VERSION_TEXT=""
50+
if [ -n "${{ inputs.version }}" ]; then
51+
VERSION_TEXT="\n*Version:* \`${{ inputs.version }}\`"
52+
fi
53+
54+
# Build package text
55+
PACKAGE_TEXT=""
56+
if [ -n "${{ inputs.package }}" ]; then
57+
PACKAGE_TEXT="\n*Package:* \`${{ inputs.package }}\`"
58+
fi
59+
60+
# Build Slack message payload
61+
PAYLOAD=$(cat <<EOF
62+
{
63+
"blocks": [
64+
{
65+
"type": "header",
66+
"text": {
67+
"type": "plain_text",
68+
"text": "${STATUS_EMOJI} ${{ inputs.title }} - ${{ inputs.status }}"
69+
}
70+
},
71+
{
72+
"type": "section",
73+
"fields": [
74+
{
75+
"type": "mrkdwn",
76+
"text": "*Repository:*\n<https://github.com/${{ github.repository }}|${{ github.repository }}>"
77+
},
78+
{
79+
"type": "mrkdwn",
80+
"text": "*Workflow:*\n${{ github.workflow }}"
81+
},
82+
{
83+
"type": "mrkdwn",
84+
"text": "*Branch:*\n\`${{ github.ref_name }}\`"
85+
},
86+
{
87+
"type": "mrkdwn",
88+
"text": "*Triggered by:*\n${{ github.actor }}"
89+
}
90+
]
91+
},
92+
{
93+
"type": "section",
94+
"text": {
95+
"type": "mrkdwn",
96+
"text": "*Commit:*\n<https://github.com/${{ github.repository }}/commit/${{ github.sha }}|\`${GITHUB_SHA:0:7}\`> - ${{ github.event.head_commit.message }}${VERSION_TEXT}${PACKAGE_TEXT}"
97+
}
98+
},
99+
{
100+
"type": "actions",
101+
"elements": [
102+
{
103+
"type": "button",
104+
"text": {
105+
"type": "plain_text",
106+
"text": "View Workflow Run"
107+
},
108+
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
109+
},
110+
{
111+
"type": "button",
112+
"text": {
113+
"type": "plain_text",
114+
"text": "View Commit"
115+
},
116+
"url": "https://github.com/${{ github.repository }}/commit/${{ github.sha }}"
117+
}
118+
]
119+
}
120+
]
121+
}
122+
EOF
123+
)
124+
125+
# Send to Slack
126+
curl -X POST "${{ secrets.SLACK_CLIENT_LIBS_WEBHOOK }}" \
127+
-H "Content-Type: application/json" \
128+
-d "$PAYLOAD"
129+
130+
echo "Slack notification sent successfully"

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# `Supabase Flutter`
44

5+
[![Dependency Scan](https://github.com/supabase/supabase-flutter/actions/workflows/dependency-scan.yml/badge.svg)](https://github.com/supabase/supabase-flutter/actions/workflows/dependency-scan.yml)
6+
57
Flutter Client library for [Supabase](https://supabase.com/).
68

79
- Documentation: https://supabase.com/docs/reference/dart/introduction

0 commit comments

Comments
 (0)