name: ๐ข Discord Release Announcement
on:
release:
types: [published]
jobs:
announce-discord:
name: ๐ข Announce to Discord
runs-on: ubuntu-latest
steps:
- name: ๐ฆ Checkout repository
uses: actions/checkout@v4
- name: ๐ Extract release info
id: release
run: |
VERSION="${{ github.event.release.tag_name }}"
RELEASE_NAME="${{ github.event.release.name }}"
IS_PRERELEASE="${{ github.event.release.prerelease }}"
RELEASE_URL="${{ github.event.release.html_url }}"
# Get first 10 lines of changelog (Discord has char limits)
CHANGELOG=$(echo "${{ github.event.release.body }}" | grep "^- " | head -10)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "name=$RELEASE_NAME" >> $GITHUB_OUTPUT
echo "prerelease=$IS_PRERELEASE" >> $GITHUB_OUTPUT
echo "url=$RELEASE_URL" >> $GITHUB_OUTPUT
# Save changelog safely for multiline
{
echo 'changelog<<EOF'
echo "$CHANGELOG"
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: ๐ Announce to Discord
run: |
# Determine emoji based on release type
if [[ "${{ steps.release.outputs.prerelease }}" == "true" ]]; then
EMOJI="๐งช"
TYPE="Beta Release"
else
EMOJI="๐"
TYPE="New Release"
fi
# Get timestamp
TIMESTAMP=$(date -u +%Y-%m-%dT%H:%M:%S.000Z)
# Escape changelog for JSON (replace newlines with \n)
CHANGELOG_ESCAPED=$(echo "${{ steps.release.outputs.changelog }}" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
# Build JSON with jq for proper escaping
DISCORD_MESSAGE=$(jq -n \
--arg emoji "$EMOJI" \
--arg version "${{ steps.release.outputs.version }}" \
--arg type "$TYPE" \
--arg timestamp "$TIMESTAMP" \
--arg changelog "$CHANGELOG_ESCAPED" \
--arg url "${{ steps.release.outputs.url }}" \
'{
"content": null,
"embeds": [{
"title": "\($emoji) claude-faf-mcp \($version)",
"description": "**\($type)** - IANA-registered MCP Server for Claude Desktop",
"color": 16753920,
"fields": [
{
"name": "๐ฆ Install",
"value": "```bash\nnpm install -g claude-faf-mcp@\($version)\n```",
"inline": false
},
{
"name": "๐ง Add to Claude Desktop",
"value": "```json\n{\n \"mcpServers\": {\n \"faf\": {\n \"command\": \"npx\",\n \"args\": [\"claude-faf-mcp@\($version)\"]\n }\n }\n}\n```",
"inline": false
},
{
"name": "๐ What Changed",
"value": $changelog,
"inline": false
},
{
"name": "๐ Links",
"value": "[GitHub Release](\($url)) โข [npm Package](https://www.npmjs.com/package/claude-faf-mcp) โข [Docs](https://faf.one) โข [MCP Registry](https://github.com/modelcontextprotocol/servers)",
"inline": false
}
],
"footer": {
"text": "claude-faf-mcp โข Official Anthropic MCP Registry"
},
"timestamp": $timestamp
}]
}')
# Send to Discord webhook
curl -H "Content-Type: application/json" \
-X POST \
-d "$DISCORD_MESSAGE" \
${{ secrets.DISCORD_WEBHOOK_URL }}
echo "โ
Discord announcement sent!"
- name: ๐ Success
run: |
echo "๐ข Discord community notified of ${{ steps.release.outputs.version }}"
echo "๐ MCP release announcement complete!"