From dd5d908e4320deff354d7ad895149c503fe2b0e3 Mon Sep 17 00:00:00 2001 From: t3hn3rd Date: Sun, 23 Mar 2025 00:31:20 +0000 Subject: [PATCH 1/5] DroneCI config updated to push to discord webhook - `.drone.yml` updated to push notifications to the discord webhook. --- .drone.yml | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index f868f1a8..771e5a7b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: - find . -type f -print0 | xargs -0 dos2unix - chmod +x /drone/src/*.sh - /drone/src/compile.sh - + - name: upload-iso-artifact image: alpine/git depends_on: @@ -49,4 +49,26 @@ steps: -H "Authorization: token $GITEA_TOKEN" || echo "No previous latest version found." - | curl -X PUT https://gitea.spexeah.com/api/packages/Spexeah/generic/asuro-iso/latest/Asuro.iso \ - -H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso" \ No newline at end of file + -H "Authorization: token $GITEA_TOKEN" --upload-file "Asuro-$(git rev-parse --short HEAD).iso" + + - name: msg status + image: appleboy/drone-discord + when: + status: [success, failure, changed] + settings: + webhook_id: + from_secret: discord_webhook_id + webhook_token: + from_secret: discord_webhook_secret + message: > + **Drone CI - Asuro Build** + {{#success build.status}} + ✅ Build successful! + {{else}} + ❌ Build failed! + {{/success}} + Repository: `[{{repo.namespace}}/{{repo.name}}]` + Branch: {{build.branch}} + Commit: {{build.commit}} + Author: `[{{commit.author}} / {{commit.email}}]` + Message: {{commit.message}} \ No newline at end of file From e64a59714ad4fcc8b640a7f9995b4b7f61880160 Mon Sep 17 00:00:00 2001 From: t3hn3rd Date: Sun, 23 Mar 2025 00:41:22 +0000 Subject: [PATCH 2/5] Formatting Fixes Formatting was off for the message posted to Discord, it also triggered at the start of the pipeline. - Fixed formatting with an attempt to use newlines. - Added a depends_on `compile`. --- .drone.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.drone.yml b/.drone.yml index 771e5a7b..bda42d0f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -53,6 +53,8 @@ steps: - name: msg status image: appleboy/drone-discord + depends_on: + - compile when: status: [success, failure, changed] settings: @@ -61,14 +63,17 @@ steps: webhook_token: from_secret: discord_webhook_secret message: > - **Drone CI - Asuro Build** + **Drone CI - Asuro Build**\n {{#success build.status}} - ✅ Build successful! + ✅ Build successful!\n {{else}} - ❌ Build failed! + ❌ Build failed!\n {{/success}} - Repository: `[{{repo.namespace}}/{{repo.name}}]` - Branch: {{build.branch}} - Commit: {{build.commit}} - Author: `[{{commit.author}} / {{commit.email}}]` - Message: {{commit.message}} \ No newline at end of file + Repository: `{{repo.namespace}}/{{repo.name}}`\n + Branch: `{{commit.branch}}`\n + Commit: `{{commit.sha}} ({{commit.link}})`\n + Author: `{{commit.author}} <{{commit.email}}>`\n + Message: + ```\n + {{commit.message}}\n + ``` \ No newline at end of file From 5963504f6b8bf3d85244672275f1e6283d3f3d72 Mon Sep 17 00:00:00 2001 From: t3hn3rd Date: Sun, 23 Mar 2025 00:48:31 +0000 Subject: [PATCH 3/5] More attempts at format fixes Formatting still off, condensing to one line to see if the escaped newlines will work. YAML is wild. --- .drone.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index bda42d0f..99be1dd5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,18 +62,4 @@ steps: from_secret: discord_webhook_id webhook_token: from_secret: discord_webhook_secret - message: > - **Drone CI - Asuro Build**\n - {{#success build.status}} - ✅ Build successful!\n - {{else}} - ❌ Build failed!\n - {{/success}} - Repository: `{{repo.namespace}}/{{repo.name}}`\n - Branch: `{{commit.branch}}`\n - Commit: `{{commit.sha}} ({{commit.link}})`\n - Author: `{{commit.author}} <{{commit.email}}>`\n - Message: - ```\n - {{commit.message}}\n - ``` \ No newline at end of file + message: "**Drone CI - Asuro Build**\n{{#success build.status}}✅ Build successful!\n{{else}}❌ Build failed!\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}} ({{commit.link}})`\nAuthor: `{{commit.author}} <{{commit.email}}>`\nMessage: ```\n{{commit.message}}\n```" \ No newline at end of file From c842d9774fbe5ac6dae40d0bc1551586823102c7 Mon Sep 17 00:00:00 2001 From: t3hn3rd Date: Sun, 23 Mar 2025 00:59:36 +0000 Subject: [PATCH 4/5] Formatting Fixed - Enchancing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Formatting is now fixed & newlines are working correctly, shame the YAML looks w?*! 🤣 - Added sections to the message for links to Gitea & Drone. --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 99be1dd5..db867ad8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,4 +62,4 @@ steps: from_secret: discord_webhook_id webhook_token: from_secret: discord_webhook_secret - message: "**Drone CI - Asuro Build**\n{{#success build.status}}✅ Build successful!\n{{else}}❌ Build failed!\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}} ({{commit.link}})`\nAuthor: `{{commit.author}} <{{commit.email}}>`\nMessage: ```\n{{commit.message}}\n```" \ No newline at end of file + message: "**Asuro Build**\n{{#success build.status}}✅ Build successful!\n{{else}}❌ Build failed!\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}}`\nGitea Diff: [Link]({{commit.link}})\nDrone Build: [Link]({{build.link}})\nAuthor: `{{commit.author}} <{{commit.email}}>`\nMessage: {{commit.message}}" \ No newline at end of file From 2d7c51ed15ae8bba9d2114e474eed30a6ee45fe9 Mon Sep 17 00:00:00 2001 From: t3hn3rd Date: Sun, 23 Mar 2025 01:14:28 +0000 Subject: [PATCH 5/5] Further formatting cleanups - Attempted to remove automatic discord embeds by surrounding any markdown links with `<` `>`. - Corrected some spacing. --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index db867ad8..b4bfefec 100644 --- a/.drone.yml +++ b/.drone.yml @@ -62,4 +62,4 @@ steps: from_secret: discord_webhook_id webhook_token: from_secret: discord_webhook_secret - message: "**Asuro Build**\n{{#success build.status}}✅ Build successful!\n{{else}}❌ Build failed!\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}}`\nGitea Diff: [Link]({{commit.link}})\nDrone Build: [Link]({{build.link}})\nAuthor: `{{commit.author}} <{{commit.email}}>`\nMessage: {{commit.message}}" \ No newline at end of file + message: "**Asuro Build**\n\n{{#success build.status}}✅ Build successful!\n\n{{else}}❌ Build failed!\n\n{{/success}}Repository: `{{repo.namespace}}/{{repo.name}}`\nBranch: `{{commit.branch}}`\nCommit: `{{commit.sha}}`\nAuthor: `{{commit.author}} <{{commit.email}}>`\n\nGitea Diff: [Link](<{{commit.link}}>)\nDrone Build: [Link](<{{build.link}}>)\n\nMessage: {{commit.message}}" \ No newline at end of file