From 30a86c78d2d5d6dc33dd2ac6acf4060377ed886b Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sat, 2 May 2026 17:46:00 -0500 Subject: [PATCH] =?UTF-8?q?add=20engram=20CI/CD=20pipeline=20=E2=80=94=20a?= =?UTF-8?q?uto-rebuild=20on=20push=20or=20el-sdk-updated?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- engram/.DS_Store | Bin 0 -> 10244 bytes engram/.gitea/workflows/engram-release.yaml | 126 ++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 engram/.DS_Store create mode 100644 engram/.gitea/workflows/engram-release.yaml diff --git a/engram/.DS_Store b/engram/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..f8575f51f6c921daee2b38af74f79d2eeecb8f64 GIT binary patch literal 10244 zcmeHM-A)rh6g~r0wgR&JRISluV{c3#kpc-Z#;_KQ5@H~Fs{&)5-O??4&83Z!J~q$%$Z~xe#15`Q z(PZpQHGV|CvNW8b`((2`oRq^A!KvNJa)jO_I6;e>IJoz6~87_-w;hlfcmmAP?i zwY1|^efC1cK;%9EgKaUrJRXo+-jxLj^1c<&7hP|KlswlzFnE4QA08PU9ve=jQWq{> zN?%T2De0rORoOA>5RM@Mb z&DhU@c)5E4rGC8L^7eK}qvA1ry`&F?<$!tK3JcxHW&ZkRh(s?&w7TeTGrZ$2lDu5w zQ{fs7Lc|WA;+ALG)LZs*EQ(ll-3kKBuh85cx8$ppnZFWHzEaUeoyU@y`zFZDm`g3? zx=?h;2nGKx>Ll}ln(<|_;9FIi%$O^3R)cZ40}o&gc3>Y~!E1N}@8BbRhOh9Q^pP~V zM#jkuxlQKCeX>ZFNP#>gkI9Dc?`gf&t8zUF#6jgKO?UHw?=ioEW86N0sapdI6I7t=TBp5&F`sMPJE)RphFEpg@EtUxiK7*Gr-1{4E|fz!l5uXtF4 z*Z=SS`TPHA3Q0YyVn8wQmkf}^LVh8KPOa)oyFahB8`z#= dist/engram.c + echo "Compiled src/server.el → dist/engram.c" + + # Link to produce the engram binary + - name: Link engram binary + run: | + cc -std=c11 -O2 \ + -I /usr/local/lib/el \ + -o dist/engram \ + dist/engram.c \ + /usr/local/lib/el/el_runtime.c \ + -lcurl -lpthread + echo "Linked dist/engram" + ls -lh dist/engram + + # Publish / update the `latest` release + - name: Publish latest release + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_API: https://git.neuralplatform.ai/api/v1 + REPO: neuron-technologies/engram + run: | + # Delete existing `latest` release if present + EXISTING_ID=$(curl -sf \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_API}/repos/${REPO}/releases/tags/latest" \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['id'])" 2>/dev/null || true) + + if [ -n "${EXISTING_ID}" ]; then + echo "Deleting existing release id=${EXISTING_ID}" + curl -sf -X DELETE \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_API}/repos/${REPO}/releases/${EXISTING_ID}" + fi + + # Remove stale tag + curl -sf -X DELETE \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${GITEA_API}/repos/${REPO}/tags/latest" || true + + # Create new release + RELEASE_ID=$(curl -sf -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + "${GITEA_API}/repos/${REPO}/releases" \ + -d "{ + \"tag_name\": \"latest\", + \"name\": \"Engram (latest)\", + \"body\": \"Latest Engram build from commit ${GITHUB_SHA}.\nBuilt $(date -u +%Y-%m-%dT%H:%M:%SZ).\", + \"draft\": false, + \"prerelease\": false + }" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") + + echo "Created release id=${RELEASE_ID}" + + # Upload engram binary + echo "Uploading engram binary..." + curl -sf -X POST \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -F "attachment=@dist/engram;filename=engram" \ + "${GITEA_API}/repos/${REPO}/releases/${RELEASE_ID}/assets" + + echo "Release published successfully" + + # Dispatch engram-updated to any downstream dependents + - name: Dispatch engram-updated to dependents + env: + GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} + GITEA_API: https://git.neuralplatform.ai/api/v1 + run: | + # Add downstream repos here as the dependency graph grows + echo "engram-updated dispatch ready (no downstream targets configured yet)" + # Example: + # curl -sf -X POST \ + # -H "Authorization: token ${GITEA_TOKEN}" \ + # -H "Content-Type: application/json" \ + # "${GITEA_API}/repos/neuron-technologies/some-service/dispatches" \ + # -d '{"type":"engram-updated","inputs":{"engram_version":"latest","commit":"'"${GITHUB_SHA}"'"}}'