-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrelease_notifications.gradle
39 lines (35 loc) · 1.53 KB
/
release_notifications.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import groovy.json.JsonOutput
def ENV = System.getenv()
task release_webhook(dependsOn: publishModrinth) {
doLast {
String id = tasks.publishModrinth.uploadInfo.id
String changelog = ENV["CHANGELOG"]
String webhook_message = JsonOutput.toJson([
username: "Mod Updates",
avatar_url: "https://cdn.discordapp.com/attachments/813009929744678933/828641737920348210/crash_avatar.png",
embeds: [
[
author: [
name: "TomsServerUtils"
],
title: "TomsServerUtils v${project.version} released!",
color: 0x3166b0,
fields: [
[
name: "Changes",
value: changelog,
inline: false
],
[
name: "Downloads",
value: "<:modrinth:814242433986330644> [Modrinth](https://modrinth.com/mod/toms-server-utils/version/${id})\n<:github:814242466999304233> [GitHub](https://github.com/Geek202/TomsServerUtils/releases/tag/v0.4.0)",
inline: false
]
]
]
]
])
file("webhook_data.json").write(webhook_message)
"./send_webhook.sh".execute()
}
}