Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

release: pin release-notes compare base to the previous v-tag

xerj-org3f11566b2fce
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 6f6cc56cf..8b1a8267c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -272,6 +272,18 @@ jobs:
timeout-minutes: 15
if: startsWith(github.ref, 'refs/tags/v')
steps:
+ # Must be the FIRST step of this job: actions/checkout wipes the
+ # workspace when it is not already a matching git repo
+ # (prepareExistingDirectory -> rmRF every entry), so running it after
+ # download-artifact would delete dist/ and ship a release with no
+ # assets. Full history so the generate-notes step below sees every
+ # v-tag (the repo clones at ~110 MB; seconds against this job's
+ # 15-min budget).
+ - name: Checkout (full history, for the release-notes tag list)
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
@@ -281,6 +293,43 @@ jobs:
- name: List artifacts
run: ls -la dist/
+ # GitHub anchors auto-generated release notes ("Full Changelog") on the
+ # most recently *published* release. Since the daily pack-rust-vulns-*
+ # corpus-pack releases started, that anchor is a corpus pack, not the
+ # previous engine release: v1.0.0-rc.78 shipped comparing
+ # pack-rust-vulns-2026-09-29...v1.0.0-rc.78 and had to be hand-patched
+ # via REST. So the compare base is computed here and pinned explicitly,
+ # instead of trusting auto-detection at publish time.
+ - name: Generate release notes (compare base pinned to previous v-tag)
+ id: relnotes
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ set -euo pipefail
+ CURRENT="${GITHUB_REF_NAME}"
+ # Highest version tag that is not the one being cut: --sort=-v:refname
+ # orders v1.0.0-rc.78 > v1.0.0-rc.77 > ... (and v1.0.0 > v1.0.0-rc.N,
+ # so a future final sorts above its rcs). pack-rust-vulns-*, backup/*
+ # and rb* tags never match the v[0-9]* glob.
+ PREV="$(git tag -l 'v[0-9]*' --sort=-v:refname | grep -vxF "${CURRENT}" | head -n1 || true)"
+ if [ -n "${PREV}" ]; then
+ echo "release-notes compare base: ${PREV}...${CURRENT}"
+ # Renders the notes without creating anything; previous_tag_name
+ # pins the compare range. (The path is .../generate-notes — the
+ # older .../generate-release-notes spelling 404s.)
+ gh api --method POST \
+ "/repos/${GITHUB_REPOSITORY}/releases/generate-notes" \
+ -f tag_name="${CURRENT}" \
+ -f previous_tag_name="${PREV}" \
+ --jq '.body' > release-notes.md
+ echo "prev=${PREV}" >> "${GITHUB_OUTPUT}"
+ else
+ # First-ever v-tag: no predecessor to pin against; the publish
+ # step falls back to GitHub's auto-generated notes.
+ echo "no previous v-tag found - falling back to auto-generated notes"
+ echo "prev=" >> "${GITHUB_OUTPUT}"
+ fi
+
- name: Publish release
uses: softprops/action-gh-release@v2
with:
@@ -288,7 +337,14 @@ jobs:
name: xerj ${{ github.ref_name }}
draft: false
prerelease: false
- generate_release_notes: true
+ # Notes were pre-generated above against the pinned compare base.
+ # When no previous v-tag exists (prev empty) both inputs invert to
+ # the pre-fix behaviour: auto-generated notes, no body file. Both
+ # halves are safe with this action — the @v2 dist ignores an empty
+ # body_path (`if (input_body_path)`) and compares
+ # generate_release_notes to the exact string "true".
+ body_path: ${{ steps.relnotes.outputs.prev && 'release-notes.md' || '' }}
+ generate_release_notes: ${{ steps.relnotes.outputs.prev && 'false' || 'true' }}
files: |
dist/*.tar.gz
dist/*.zip