Selaa lähdekoodia

ci: fall back manager link to latest dev build when stock commit has no run

TheWildJames 3 viikkoa sitten
vanhempi
sitoutus
2b9a92786d

+ 1 - 1
.github/config/RELEASE_NOTES.md

@@ -25,7 +25,7 @@ A kernel-based root solution for Android devices.
 > [!WARNING]
 > This release uses the [pershoot/KernelSU-Next](https://github.com/pershoot/KernelSU-Next) fork. The fork maintainer has said it is not ready for production use, so treat it as use at your own risk.
 
-Manager: {{KSU_MANAGER}}
+Manager: {{KSU_MANAGER}} {{KSU_MANAGER_NOTE}}
 
 > [!IMPORTANT]
 > For best compatiblity ensure your Manager Version and Kernel Version match eg. 30100 = 30100.

+ 1 - 0
.github/scripts/render_release_body.py

@@ -10,6 +10,7 @@ PLACEHOLDERS = {
     "{{KSUN_BRANCH}}": lambda: os.environ.get("KSUN_BRANCH", "dev"),
     "{{KSUN_COMMIT}}": lambda: os.environ.get("KSUN_COMMIT", "unknown"),
     "{{KSU_MANAGER}}": lambda: os.environ.get("KSU_MANAGER", "Placeholder"),
+    "{{KSU_MANAGER_NOTE}}": lambda: os.environ.get("KSU_MANAGER_NOTE", ""),
     "{{SUSFS_BRANCHES}}": lambda: os.environ.get("SUSFS_COMMIT", "latest on auto-derived gki-{version} branch"),
     "{{SUSFS_BRANCHS}}": lambda: os.environ.get("SUSFS_COMMIT", "latest on auto-derived gki-{version} branch"),
 }

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

@@ -841,8 +841,20 @@ jobs:
         MANAGER_RUN_ID=$(curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?head_sha=${STOCK_COMMIT}" | jq -r '.workflow_runs[0].id // empty')
         if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
           KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
+          KSU_MANAGER_NOTE="exact build for initialized commit ${STOCK_COMMIT:0:12}"
         else
-          KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
+          # No run indexed for the stock commit (e.g. official dev was force-pushed/rebase).
+          # Fall back to the build-manager run for the CURRENT official dev tip so the
+          # release still gets a real manager build to link to.
+          echo "No manager run found for stock commit ${STOCK_COMMIT}; falling back to latest dev tip." >&2
+          MANAGER_RUN_ID=$(curl -fsSL --retry 5 --retry-delay 5 --retry-all-errors "https://api.github.com/repos/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml/runs?branch=dev" | jq -r '.workflow_runs[0].id // empty')
+          if [[ -n "${MANAGER_RUN_ID:-}" ]]; then
+            KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/runs/${MANAGER_RUN_ID}"
+            KSU_MANAGER_NOTE="latest official dev branch build-manager run (fallback)"
+          else
+            KSU_MANAGER="https://github.com/KernelSU-Next/KernelSU-Next/actions/workflows/build-manager-ci.yml"
+            KSU_MANAGER_NOTE="no manager run found"
+          fi
         fi
 
         echo "Commits count: $COMMITS_COUNT"
@@ -857,6 +869,7 @@ jobs:
         echo "KSU_VERSION=$KSU_VERSION" >> $GITHUB_ENV
         echo "KSU_GIT_TAG=$KSU_GIT_TAG" >> $GITHUB_ENV
         echo "KSU_MANAGER=$KSU_MANAGER" >> $GITHUB_ENV
+        echo "KSU_MANAGER_NOTE=${KSU_MANAGER_NOTE:-}" >> $GITHUB_ENV
 
     - name: Set release body
       run: |