Skip to content

Commit bff7bc9

Browse files
authored
Refactor GitHub Actions for SkyblockTweaks
Updated Discord notification payload and build steps.
1 parent 96230a5 commit bff7bc9

1 file changed

Lines changed: 15 additions & 40 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
name: Build SkyblockTweaks
2-
on:
3-
push:
4-
branches:
5-
- '*'
6-
pull_request:
7-
branches:
8-
- '*'
9-
jobs:
10-
build-gradle-project:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/setup-java@v4.0.0
14-
with:
15-
distribution: zulu
16-
java-version: 17
17-
- name: Checkout repo
18-
uses: actions/checkout@v4.1.1
19-
- name: Make gradlew executable
20-
run: chmod +x ./gradlew
21-
- name: Setup Gradle and build jar
22-
uses: gradle/gradle-build-action@v2.11.1
23-
with:
24-
arguments: build
25-
- name: Upload SkyblockTweaks jar
26-
uses: actions/upload-artifact@v4.0.0
27-
with:
28-
name: SkyblockTweaks-Nightly
29-
path: build/libs/*.jar
301
send-to-discord:
312
if: github.event_name == 'push'
323
needs: build-gradle-project
@@ -53,26 +24,30 @@ jobs:
5324
COMMIT_URL="https://github.com/${{ github.repository }}/commit/${COMMIT_HASH}"
5425
BRANCH_NAME="${{ github.ref_name }}"
5526
27+
BUILD_TITLE="🚀 SkyblockTweaks Nightly Build #${BUILD_NUMBER} [${BRANCH_NAME}]"
28+
DESCRIPTION="***You must have a Github Account for this to work***\n\`\`\`${COMMIT_MESSAGE}\`\`\`"
29+
DOWNLOAD_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
30+
5631
EMBED_PAYLOAD=$(jq -n \
5732
--arg username "SkyblockTweaks Bot" \
58-
--arg avatar_url "https://cdn.modrinth.com/data/5SDy0bij/85f954e6f5727fa5f49425fc677b5ec663491a07_96.webp" \
59-
--arg title "🚀 SkyblockTweaks Nightly Build #${BUILD_NUMBER} [$BRANCH_NAME]" \
60-
--arg commit "**Commit:** [$COMMIT_MESSAGE]($COMMIT_URL)" \
61-
--arg timestamp "$(date -u +%Y-%m-%dT%H:%M:%S.000Z)" \
33+
--arg avatar_url "https://i.imgur.com/TtnRRnq.png" \
34+
--arg title "$BUILD_TITLE" \
35+
--arg description "$DESCRIPTION" \
36+
--arg url "$DOWNLOAD_URL" \
6237
'{
6338
username: $username,
6439
avatar_url: $avatar_url,
6540
embeds: [{
6641
title: $title,
67-
description: ($commit),
68-
color: 3447003,
69-
timestamp: $timestamp,
42+
description: $description,
43+
color: 0x00AE86,
44+
thumbnail: {
45+
url: "https://i.imgur.com/TtnRRnq.png"
46+
},
7047
footer: {
71-
text: "SkyblockTweaks Nightly Builds"
48+
text: "⚠️ Warning Developer Builds are extremely unstable and may cause crashes ⚠️"
7249
},
73-
thumbnail: {
74-
url: "https://cdn.modrinth.com/data/5SDy0bij/85f954e6f5727fa5f49425fc677b5ec663491a07_96.webp"
75-
}
50+
url: $url
7651
}]
7752
}')
7853

0 commit comments

Comments
 (0)