diff --git a/.github/workflows/build-kernel.yml b/.github/workflows/build-kernel.yml index 9e5ab0e..6ce923b 100644 --- a/.github/workflows/build-kernel.yml +++ b/.github/workflows/build-kernel.yml @@ -6,7 +6,7 @@ on: config: description: '📄 Kernel config name (ej: config-6.18.2-debian13 from configs/)' required: true - default: 'config-6.18.2-debian13' + default: 'config-6.19.11-debian13-ryzen9' patch: description: '🧩 Optional patch name (from patchs/ in repo)' required: false @@ -119,7 +119,7 @@ jobs: - name: 🐧 Build kernel run: | cd kernel_build - make -j$(nproc) bindeb-pkg LOCALVERSION=${{ inputs.localversion }} KDEB_PKGVERSION=1 + make -j$(nproc) bindeb-pkg LOCALVERSION=${{ inputs.localversion }} KDEB_PKGVERSION=1 2>&1 | tee ../build.log - name: 🆔 Get compiled kernel version id: get_version @@ -222,6 +222,10 @@ jobs: cat release.md >> $GITHUB_OUTPUT echo "EOF" >> $GITHUB_OUTPUT + echo "description<> $GITHUB_OUTPUT + echo "$DESCRIPTION" >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + - name: 🚀 Upload Linux Kernel uses: softprops/action-gh-release@v2 with: @@ -240,18 +244,62 @@ jobs: TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} TELEGRAM_CHATID: ${{ secrets.TELEGRAM_CHATID }} GITHUB_RUN_ID: ${{ github.run_id }} + GITHUB_REPO: ${{ github.repository }} BUILD_STATUS: ${{ job.status }} KERNEL_VERSION: ${{ steps.get_version.outputs.version }} + PKG_DESCRIPTION: ${{ steps.release_body.outputs.description }} + INPUT_CONFIG: ${{ inputs.config }} + INPUT_LOCALVERSION: ${{ inputs.localversion }} + INPUT_TAG: ${{ inputs.tag }} + INPUT_URL: ${{ inputs.url }} + INPUT_PATCH: ${{ inputs.patch }} run: | - STATUS_EMOJI="✅" - if [ "$BUILD_STATUS" != "success" ]; then - STATUS_EMOJI="❌" - fi + RUN_URL="https://github.com/${GITHUB_REPO}/actions/runs/${GITHUB_RUN_ID}" + + if [ "$BUILD_STATUS" = "success" ]; then + CLEAN_DESC=$(echo "$PKG_DESCRIPTION" | sed 's/&/\&/g; s//\>/g') + if [ -z "$CLEAN_DESC" ]; then + CLEAN_DESC=" - No disponible" + fi + + MESSAGE="🐧 Linux Kernel Build ✅ Success + +🏷️ Versión: ${KERNEL_VERSION:-Desconocida} + +📦 Ficheros: +${CLEAN_DESC} + +🏷️ Workflow: +🔗 Ver detalles en GitHub" - MESSAGE=$(printf " 🐧 Linux Kernel Build %s %s\n\n \ - 🏷️ Versión: %s\n \ - 🔗 Ver detalles en GitHub" \ - "$STATUS_EMOJI" "${BUILD_STATUS^}" "$KERNEL_VERSION" "${{ github.repository_owner }}" "${{ github.repository }}" "$GITHUB_RUN_ID") + else + ERROR_LOG="" + if [ -f build.log ]; then + ERROR_SNIPPET=$(tail -n 12 build.log | sed 's/&/\&/g; s//\>/g') + ERROR_LOG=" +📋 Últimas líneas del log de error: +
${ERROR_SNIPPET}
" + fi + + SRC_INFO="${INPUT_TAG}" + if [ -z "$SRC_INFO" ]; then + SRC_INFO="${INPUT_URL}" + fi + if [ -z "$SRC_INFO" ]; then + SRC_INFO="No especificado" + fi + + MESSAGE="🐧 Linux Kernel Build ❌ Fallido (${BUILD_STATUS^}) + +⚠️ Parámetros de la ejecución: + • Config: ${INPUT_CONFIG:-N/A} + • Origen: ${SRC_INFO} + • Localversion: ${INPUT_LOCALVERSION:-Ninguna} + • Parche: ${INPUT_PATCH:-Ninguno}${ERROR_LOG} + +🏷️ Workflow: +🔗 Ver logs completos en GitHub Actions" + fi curl -s -X POST "https://api.telegram.org/bot${TELEGRAM_TOKEN}/sendMessage" \ --data-urlencode "chat_id=${TELEGRAM_CHATID}" \