Skip to content

v1.4.0

v1.4.0 #5

Workflow file for this run

name: Discord Release Notification
on:
release:
types: [published]
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send Discord embed
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_URL: ${{ github.event.release.html_url }}
RELEASE_BODY: ${{ github.event.release.body }}
run: |
BODY_SHORT=$(echo "$RELEASE_BODY" | head -c 750)
DOWNLOAD_LINE="[⬇ Download $RELEASE_TAG]($RELEASE_URL)"
PAYLOAD=$(jq -n \
--arg title "Mojo Input Manager $RELEASE_TAG" \
--arg url "$RELEASE_URL" \
--arg desc "$BODY_SHORT"$'\n\n'"$DOWNLOAD_LINE" \
--arg version "$RELEASE_TAG" \
--arg image "https://raw.githubusercontent.com/mojouto3/mojo-input-manager/main/assets/social-preview.png" \
'{
username: "Mojo Input Manager",
embeds: [{
title: $title,
url: $url,
description: $desc,
color: 4053821,
image: { url: $image },
fields: [
{ name: "Version", value: $version, inline: true },
{ name: "Platform", value: "Windows x64", inline: true }
],
footer: { text: "mojouto3/mojo-input-manager" }
}]
}')
curl -s -X POST "$DISCORD_WEBHOOK" \
-H "Content-Type: application/json" \
-d "$PAYLOAD"