Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

ci: add publish failure coordination (#2932)

LearningCircuited8b9a374ea8
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 3f90c5a43d..2b3f08cc07 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -402,6 +402,8 @@ jobs:
environment: release
permissions:
contents: read
+ outputs:
+ dispatch_time: ${{ steps.dispatch-time.outputs.timestamp }}
steps:
- name: Harden the runner (Audit all outbound calls)
@@ -409,6 +411,12 @@ jobs:
with:
egress-policy: audit
+ # Recorded BEFORE the dispatches so monitor-publish can filter on createdAt
+ # without missing runs created during this job.
+ - name: Record dispatch time
+ id: dispatch-time
+ run: echo "timestamp=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> "$GITHUB_OUTPUT"
+
- name: Trigger Docker publish workflow
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
env:
@@ -455,3 +463,109 @@ jobs:
echo "Sigstore bundles (.bundle) attached for verification (contain signature + certificate)"
echo "SLSA provenance (provenance.intoto.jsonl) attached for supply chain security"
echo "Check the releases page: https://github.com/LearningCircuit/local-deep-research/releases"
+
+ # Monitor publish workflows and create issue on partial failure
+ monitor-publish:
+ needs: [build, trigger-workflows]
+ if: ${{ !cancelled() && needs.trigger-workflows.result == 'success' }}
+ runs-on: ubuntu-latest
+ timeout-minutes: 90
+ permissions:
+ contents: read
+ actions: read # Required for gh run list
+ issues: write
+
+ steps:
+ - name: Harden the runner (Audit all outbound calls)
+ uses: step-security/harden-runner@fa2e9d605c4eeb9fcad4c99c224cee0c6c7f3594 # v2.16.0
+ with:
+ egress-policy: audit
+
+ - name: Wait for publish workflows to complete
+ env:
+ GH_TOKEN: ${{ github.token }}
+ RELEASE_TAG: ${{ needs.build.outputs.tag }}
+ DISPATCH_TIME: ${{ needs.trigger-workflows.outputs.dispatch_time }}
+ run: |
+ echo "Monitoring publish workflows for tag $RELEASE_TAG (dispatched at $DISPATCH_TIME)..."
+
+ # Wait for workflows to start (repository_dispatch is async)
+ sleep 30
+
+ check_workflow() {
+ local workflow_name="$1"
+ local max_wait=2400 # 40 minutes
+ local elapsed=0
+ local run status conclusion
+
+ while [ "$elapsed" -lt "$max_wait" ]; do
+ # Compare timestamps numerically — lexicographic comparison breaks
+ # when GitHub returns sub-second precision (e.g. "...:56.500Z"
+ # sorts before "...:56Z"). fromdateiso8601 doesn't accept
+ # fractional seconds, so strip them first. The 60s buffer
+ # tolerates minor clock skew between the runner and GitHub's API.
+ run=$(gh run list --workflow="$workflow_name" --limit=20 --json status,conclusion,createdAt 2>/dev/null \
+ | jq -r --arg since "$DISPATCH_TIME" '
+ def to_epoch: sub("\\.[0-9]+Z$"; "Z") | fromdateiso8601;
+ (($since | to_epoch) - 60) as $s
+ | [.[] | select((.createdAt | to_epoch) >= $s)] | .[0]
+ ')
+
+ if [ "$run" = "null" ] || [ -z "$run" ]; then
+ echo "$workflow_name: waiting for run to appear..." >&2
+ sleep 30
+ elapsed=$((elapsed + 30))
+ continue
+ fi
+
+ status=$(echo "$run" | jq -r '.status')
+ conclusion=$(echo "$run" | jq -r '.conclusion')
+
+ if [ "$status" = "completed" ]; then
+ echo "$workflow_name: $conclusion" >&2
+ echo "$conclusion"
+ return
+ fi
+
+ sleep 30
+ elapsed=$((elapsed + 30))
+ done
+
+ echo "$workflow_name: timed out after ${max_wait}s" >&2
+ echo "timed_out"
+ }
+
+ DOCKER_RESULT=$(check_workflow "docker-publish.yml")
+ PYPI_RESULT=$(check_workflow "publish.yml")
+
+ # Mark that monitoring completed (distinguishes from infra failure)
+ {
+ echo "monitor_completed=true"
+ echo "docker_result=$DOCKER_RESULT"
+ echo "pypi_result=$PYPI_RESULT"
+ } >> "$GITHUB_ENV"
+
+ if [ "$DOCKER_RESULT" = "success" ] && [ "$PYPI_RESULT" = "success" ]; then
+ echo "Both publish workflows completed successfully!"
+ else
+ echo "::warning::Partial publish failure detected"
+ fi
+
+ - name: Create issue on partial failure
+ if: env.monitor_completed == 'true' && (env.docker_result != 'success' || env.pypi_result != 'success')
+ uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
+ env:
+ RELEASE_TAG: ${{ needs.build.outputs.tag }}
+ with:
+ script: |
+ const tag = process.env.RELEASE_TAG;
+ const docker = process.env.docker_result || 'unknown';
+ const pypi = process.env.pypi_result || 'unknown';
+
+ await github.rest.issues.create({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ title: `Partial publish failure for ${tag}`,
+ body: `## Publish Status for ${tag}\n\n| Target | Result |\n|--------|--------|\n| Docker | ${docker} |\n| PyPI | ${pypi} |\n\nPlease investigate and re-trigger the failed publish workflow(s).`,
+ labels: ['ci-cd']
+ });