Parcourir la source

ci(github-actions): add telegram dm for artifacts and conditionally send notification

TheWildJames il y a 8 mois
Parent
commit
15606cd8c6
1 fichiers modifiés avec 17 ajouts et 1 suppressions
  1. 17 1
      .github/workflows/main.yml

+ 17 - 1
.github/workflows/main.yml

@@ -345,8 +345,24 @@ jobs:
           echo "Uploading ${artifact_name}.zip..."
           echo "Uploading ${artifact_name}.zip..."
           gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
           gh release upload "${{ env.NEW_TAG }}" "${artifact_name}.zip" --clobber
         done
         done
-          
+
+    - name: DM Artifacts
+      if: always()
+      run: |
+        # Check for TheWildJames and Normal artifacts
+        for file in ./*TheWildJames*.zip ./*Normal*.zip; do
+          if [ -f "$file" ]; then
+            echo "Sending $file to Telegram DM..."
+            curl -F chat_id="${{ secrets.TELEGRAM_USER_ID }}" \
+                 -F document=@"$file" \
+                 -F caption="📦 **Build**: $file" \
+                 -F parse_mode="Markdown" \
+                 https://api.telegram.org/bot${{ secrets.TELEGRAM_BOT_TOKEN }}/sendDocument
+          fi
+        done
+
     - name: Send Telegram Notification
     - name: Send Telegram Notification
+      if: inputs.release_type != 'Actions'
       run: |
       run: |
         RELEASE_TYPE_TEXT=""
         RELEASE_TYPE_TEXT=""
         if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then
         if [ "${{ inputs.release_type }}" == "Pre-Release" ]; then