Compare commits
2
Commits
v0.0.1-beta
...
v1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f4c3a3e21 | ||
|
|
44a30c4a8a |
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
# bark-notify.sh — push a notification to the local Bark server.
|
||||
#
|
||||
# Usage: bark-notify.sh <title> <body>
|
||||
#
|
||||
# The Bark endpoint, device_key, and group are pinned in this script
|
||||
# (it is a deployment detail, not a secret). The group is "Gitea" —
|
||||
# change it here if you want to sort notifications by category.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$#" -ne 2 ]; then
|
||||
echo "usage: $0 <title> <body>" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
TITLE="$1"
|
||||
BODY="$2"
|
||||
|
||||
PAYLOAD=$(cat <<EOF
|
||||
{
|
||||
"device_key": "6ZFVsxM95cuAjYoNLWSWaN",
|
||||
"title": "${TITLE}",
|
||||
"body": "${BODY}",
|
||||
"group": "Gitea",
|
||||
"isArchive": 1,
|
||||
"ttl": 3600
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
curl -s \
|
||||
-X POST http://101.43.40.124:81/push \
|
||||
-H "Content-Type: application/json; charset=utf-8" \
|
||||
-d "${PAYLOAD}"
|
||||
|
||||
echo "bark notified: ${TITLE}"
|
||||
+22
-17
@@ -49,6 +49,19 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Notify CI via Bark
|
||||
if: always()
|
||||
run: |
|
||||
REF_NAME="${{ github.ref_name }}"
|
||||
STATUS="${{ job.status }}"
|
||||
if [ "${STATUS}" = "success" ]; then
|
||||
EMOJI="✅"
|
||||
else
|
||||
EMOJI="❌"
|
||||
fi
|
||||
BODY="${EMOJI} ${REF_NAME} ${STATUS}: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${{ github.run_id }}"
|
||||
bash .github/scripts/bark-notify.sh "CI ${REF_NAME} ${STATUS}" "${BODY}"
|
||||
|
||||
release:
|
||||
name: Release
|
||||
needs: ci
|
||||
@@ -106,22 +119,14 @@ jobs:
|
||||
-F "attachment=@spark-mcp-linux-amd64"
|
||||
|
||||
- name: Notify release via Bark
|
||||
if: success()
|
||||
if: always()
|
||||
run: |
|
||||
TITLE="${{ github.ref_name }}"
|
||||
BODY="spark-mcp ${TITLE} released: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TITLE}"
|
||||
PAYLOAD=$(cat <<EOF
|
||||
{
|
||||
"device_key": "6ZFVsxM95cuAjYoNLWSWaN",
|
||||
"title": "${TITLE}",
|
||||
"body": "${BODY}",
|
||||
"group": "release",
|
||||
"isArchive": 1,
|
||||
"ttl": 3600
|
||||
}
|
||||
EOF
|
||||
)
|
||||
curl -s \
|
||||
-X POST http://101.43.40.124:81/push \
|
||||
-H "Content-Type: application/json; charset=utf-8" \
|
||||
-d "${PAYLOAD}"
|
||||
STATUS="${{ job.status }}"
|
||||
if [ "${STATUS}" = "success" ]; then
|
||||
EMOJI="✅"
|
||||
else
|
||||
EMOJI="❌"
|
||||
fi
|
||||
BODY="${EMOJI} spark-mcp ${TITLE} ${STATUS}: ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/releases/tag/${TITLE}"
|
||||
bash .github/scripts/bark-notify.sh "${TITLE} ${STATUS}" "${BODY}"
|
||||
|
||||
Reference in New Issue
Block a user