Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit 8e579c5

Browse files
committed
FIX MAC AUTO BUILD AND ADD AUTO REPORT TO DISCORD TO ME
1 parent bf2612c commit 8e579c5

File tree

1 file changed

+63
-16
lines changed

1 file changed

+63
-16
lines changed

.github/workflows/main.yml

Lines changed: 63 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,35 +86,82 @@ jobs:
8686

8787
buildMac:
8888
name: 🌟 Build on macOS
89-
runs-on: macos-15
89+
runs-on: macos-13
9090

9191
steps:
92-
- name: Checkout Code
93-
uses: actions/checkout@v4.1.7
94-
95-
- name: Setup Haxe
96-
uses: krdlab/setup-haxe@master
92+
- uses: actions/checkout@v4.1.7
93+
- uses: krdlab/setup-haxe@master
9794
with:
9895
haxe-version: 4.3.6
99-
100-
- name: Install Dependencies & Setup
96+
- name: Install Haxelib
10197
run: |
10298
haxelib setup ~/haxelib
103-
haxelib install hxcpp --quiet
99+
haxelib install hxcpp > /dev/null --quiet
100+
haxelib install lime --quiet
101+
haxelib run lime rebuild lime mac -arch arm64
104102
chmod +x ./setup/unix.sh
105-
./setup/unix.sh
106-
103+
sh ./setup/unix.sh
107104
- name: Skip SScript setup mode
108105
run: echo 'oy9:showMacroty8:loopCosti25y10:includeAllfg' >> ~/settings.cocoa
109106

110107
- name: Create Version Tag
111108
run: echo "${{ github.run_id }}" > VERSION
112-
113-
- name: Compile for macOS
114-
run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" -D officialBuild
115-
116-
- name: Upload Artifact
109+
- name: Compile
110+
run: haxelib run lime build mac --app-version="4.0.0-${{ github.run_id }}" -D officialBuild
111+
- name: Publish Artifact
117112
uses: actions/upload-artifact@v4.3.4
118113
with:
119114
name: macBuild
120115
path: export/release/macos/bin
116+
117+
notifyDiscord:
118+
name: 📣 Notify Discord
119+
runs-on: ubuntu-latest
120+
if: always()
121+
needs: [buildLinux, buildWindows, buildMac]
122+
steps:
123+
- name: Send Discord Notification
124+
env:
125+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
126+
RUN_URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
127+
run: |
128+
STATUS_LINUX="${{ needs.buildLinux.result }}"
129+
STATUS_WIN="${{ needs.buildWindows.result }}"
130+
STATUS_MAC="${{ needs.buildMac.result }}"
131+
132+
msg_linux="LINUX: ❎ Build Error"
133+
msg_win="WIN: ❎ Build Error"
134+
msg_mac="MAC: ❎ Build Error"
135+
136+
[[ "$STATUS_LINUX" == "success" ]] && msg_linux="LINUX: ✅ Build Completed"
137+
[[ "$STATUS_WIN" == "success" ]] && msg_win="WIN: ✅ Build Completed"
138+
[[ "$STATUS_MAC" == "success" ]] && msg_mac="MAC: ✅ Build Completed"
139+
140+
if [[ "$STATUS_LINUX" == "success" && "$STATUS_WIN" == "success" && "$STATUS_MAC" == "success" ]]; then
141+
TITLE="✅ Build Successful"
142+
COLOR=65280
143+
else
144+
TITLE="❎ Build Error"
145+
COLOR=16711680
146+
fi
147+
148+
DESCRIPTION="$msg_linux\n$msg_win\n$msg_mac"
149+
150+
curl -H "Content-Type: application/json" \
151+
-X POST \
152+
-d "{
153+
\"username\": \"Github Action Report\",
154+
\"embeds\": [{
155+
\"title\": \"$TITLE\",
156+
\"description\": \"$DESCRIPTION\",
157+
\"color\": $COLOR,
158+
\"fields\": [
159+
{ \"name\": \"🔗 Workflow Run\", \"value\": \"[View on GitHub]($RUN_URL)\" }
160+
],
161+
\"footer\": {
162+
\"text\": \"GitHub Actions • ${{ github.repository }}\"
163+
},
164+
\"timestamp\": \"$(date -u +%Y-%m-%dT%H:%M:%SZ)\"
165+
}]
166+
}" \
167+
$DISCORD_WEBHOOK

0 commit comments

Comments
 (0)