Skip to content

Commit 12f0dc6

Browse files
authored
Merge pull request #354 from lane711/docs-discord-notification
docs: add Discord release notification guide
2 parents 511b3ec + 07b4740 commit 12f0dc6

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Discord Release Notifications
2+
3+
This document describes how Discord notifications are sent when a new version of SonicJS is released.
4+
5+
## Overview
6+
7+
When a release is published, a notification is automatically posted to the SonicJS Discord server with details about the new version.
8+
9+
## Setup
10+
11+
### Discord Webhook URL
12+
13+
The notification requires a Discord webhook URL. Set it as an environment variable before running a release:
14+
15+
```bash
16+
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/..."
17+
```
18+
19+
### Current Webhook
20+
21+
The SonicJS Discord webhook URL:
22+
```
23+
https://discord.com/api/webhooks/1443339433318285442/lnxdw64Wze72PjY8EhxPYF6bLGjqBwOi8EqwOnZxUFPo82E37o6myjQ1aO-8dzvsaStN
24+
```
25+
26+
## Usage
27+
28+
### Automatic (During Release)
29+
30+
Discord notifications are automatically sent at the end of each release command:
31+
32+
```bash
33+
# Set the webhook URL
34+
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1443339433318285442/lnxdw64Wze72PjY8EhxPYF6bLGjqBwOi8EqwOnZxUFPo82E37o6myjQ1aO-8dzvsaStN"
35+
36+
# Run any release command - notification is sent automatically
37+
npm run release:patch
38+
npm run release:minor
39+
npm run release:major
40+
```
41+
42+
### Manual (Standalone)
43+
44+
To send a notification manually without publishing:
45+
46+
```bash
47+
export DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1443339433318285442/lnxdw64Wze72PjY8EhxPYF6bLGjqBwOi8EqwOnZxUFPo82E37o6myjQ1aO-8dzvsaStN"
48+
49+
npm run notify:discord
50+
```
51+
52+
Or as a one-liner:
53+
54+
```bash
55+
DISCORD_WEBHOOK_URL="https://discord.com/api/webhooks/1443339433318285442/lnxdw64Wze72PjY8EhxPYF6bLGjqBwOi8EqwOnZxUFPo82E37o6myjQ1aO-8dzvsaStN" node scripts/notify-discord.js
56+
```
57+
58+
## What Gets Posted
59+
60+
The notification includes:
61+
62+
- Version number (read from `packages/core/package.json`)
63+
- Install command (`npm create sonicjs@latest`)
64+
- Links to npm, GitHub, and documentation
65+
- Timestamp
66+
67+
Example Discord embed:
68+
69+
```
70+
🚀 SonicJS v2.3.2 Released!
71+
72+
A new version of SonicJS has been published to npm.
73+
74+
📦 Install
75+
npm create sonicjs@latest
76+
77+
📚 Links
78+
npm • GitHub • Docs
79+
```
80+
81+
## Files
82+
83+
- `scripts/notify-discord.js` - The notification script
84+
- `package.json` - Contains the npm scripts
85+
86+
## Troubleshooting
87+
88+
### "DISCORD_WEBHOOK_URL not set"
89+
90+
The script will warn and skip if the environment variable is not set. Make sure to export it before running.
91+
92+
### Notification Failed
93+
94+
Check that:
95+
1. The webhook URL is correct and active
96+
2. The Discord channel still exists
97+
3. You have internet connectivity
98+
99+
## Security Note
100+
101+
The webhook URL should be treated as a secret. Anyone with the URL can post messages to the Discord channel. Avoid committing it directly to version control.

0 commit comments

Comments
 (0)