diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 7842991..664beb6 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -23,3 +23,19 @@ jobs:
- name: test
run: cargo test
+
+ - name: Notify Telegram on failure
+ if: failure()
+ continue-on-error: true
+ env:
+ TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
+ TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
+ run: |
+ if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then
+ echo "Telegram secrets not configured, skipping notification"
+ exit 0
+ fi
+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
+ -d chat_id="${TELEGRAM_CHAT_ID}" \
+ -d parse_mode="HTML" \
+ -d text="❌ CI failed on ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 259f7ff..2f1fd18 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -81,6 +81,20 @@ jobs:
${{ matrix.archive }}
${{ matrix.archive }}.sha256
+ - name: Notify Telegram on build failure
+ if: failure()
+ continue-on-error: true
+ shell: bash
+ env:
+ TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
+ TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
+ run: |
+ if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi
+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
+ -d chat_id="${TELEGRAM_CHAT_ID}" \
+ -d parse_mode="HTML" \
+ -d text="❌ Release build failed%0APlatform: ${{ matrix.target }}%0ATag: ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+
release:
needs: build
runs-on: ubuntu-latest
@@ -92,7 +106,34 @@ jobs:
path: artifacts
- uses: softprops/action-gh-release@v2
+ id: gh_release
with:
files: artifacts/**
fail_on_unmatched_files: false
generate_release_notes: true
+
+ - name: Notify Telegram on release published
+ if: success()
+ continue-on-error: true
+ env:
+ TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
+ TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
+ run: |
+ if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi
+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
+ -d chat_id="${TELEGRAM_CHAT_ID}" \
+ -d parse_mode="HTML" \
+ -d text="✅ Release published: ${{ github.ref_name }}%0A${{ steps.gh_release.outputs.url }}"
+
+ - name: Notify Telegram on release failure
+ if: failure()
+ continue-on-error: true
+ env:
+ TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
+ TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
+ run: |
+ if [ -z "$TELEGRAM_TOKEN" ] || [ -z "$TELEGRAM_CHAT_ID" ]; then exit 0; fi
+ curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \
+ -d chat_id="${TELEGRAM_CHAT_ID}" \
+ -d parse_mode="HTML" \
+ -d text="❌ Release job failed for tag ${{ github.ref_name }}%0A${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"