Skip to content

Commit

Permalink
Update embed
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexNijjar committed Nov 7, 2023
1 parent a42e653 commit 1b26860
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
MAVEN_PASS: ${{ secrets.MAVEN_PASSWORD }}

- name: Upload Forge Releases (Curse/Modrinth/Github)
id: forge_release
if: contains(steps.properties.outputs.enabledPlatforms, 'forge')
uses: Kir-Antipov/[email protected]
with:
Expand All @@ -60,6 +61,7 @@ jobs:
resourceful-lib | depends | *
- name: Upload Fabric Releases (Curse/Modrinth/Github)
id: fabric_release
if: contains(steps.properties.outputs.enabledPlatforms, 'fabric')
uses: Kir-Antipov/[email protected]
with:
Expand All @@ -84,6 +86,9 @@ jobs:
- name: Generate Discord Embed
run: ./gradlew injectEmbed
env:
FORGE_RELEASE_URL: ${{ steps.forge_release.outputs.modrinth-url }}
FABRIC_RELEASE_URL: ${{ steps.fabric_release.outputs.modrinth-url }}

- name: Upload Discord Embed
uses: tsickert/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,16 @@ resourcefulGradle {
val minecraftVersion: String by project
val version: String by project
val changelog: String = file("changelog.md").readText(Charsets.UTF_8)
val fabricLink: String? = System.getenv("FABRIC_RELEASE_URL")
val forgeLink: String? = System.getenv("FORGE_RELEASE_URL")

source.set(file("templates/embed.json.template"))
injectedValues.set(mapOf(
"minecraft" to minecraftVersion,
"version" to version,
"changelog" to StringEscapeUtils.escapeJava(changelog),
"fabric_link" to fabricLink,
"forge_link" to forgeLink,
))
}
}
Expand Down
36 changes: 27 additions & 9 deletions templates/embed.json.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
{
"components": [
{
"type": 1,
"components": [
{
"type": 2,
"label": "Fabric",
"style": 5,
"url": "${fabric_link}"
},
{
"type": 2,
"label": "Forge",
"style": 5,
"url": "${forge_link}"
}
]

}
],
"embeds": [
{
"title": "Argonauts",
Expand All @@ -7,23 +27,21 @@
"fields": [
{
"name": "Minecraft Version",
"value": "${minecraft}"
"value": "${minecraft}",
"inline": true
},
{
"name": "Mod Version",
"value": "${version}"
},
{
"name": "Download",
"value": "<:modrinth:1083795635414773760> [Modrinth](https://modrinth.com/mod/argonauts)\\n<:curseforge:978684543026462790> [Curseforge](https://www.curseforge.com/minecraft/mc-mods/argonauts)"
"value": "${version}",
"inline": true
}
],
"footer": {
"text": "Want to support us? Check out our Ko-fi! http://kofi.terrarium.earth",
"icon_url": "https://media.discordapp.net/attachments/881367981463072809/1044025688719626250/61e1116779fc0a9bd5bdbcc7_Frame_6.png"
"text": "Follow the project on Modrinth at mods.gay/argonauts",
"icon_url": "https://i.imgur.com/3hVj8nM.png"
},
"thumbnail": {
"url": "https://cdn.discordapp.com/attachments/1094731881590833203/1106096454864486422/Argonauts_image.png"
"url": "https://cdn.modrinth.com/data/bb2EpKpx/a1bd657608a465ee17d88307b936eb41bcdad502.png"
}
}
],
Expand Down

0 comments on commit 1b26860

Please sign in to comment.