name: ElQL Release on: push: branches: - main repository_dispatch: types: - el-sdk-updated - engram-updated # ElQL is a set of standalone El programs run against a live Engram server. # Release validates that all .el files parse and compile (emit valid C) using # the prod-level El SDK. No compiled binary is produced or published. jobs: build-and-release: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Enforce source branch (main ← stage only) if: github.event_name == 'pull_request' run: | SOURCE="${GITHUB_HEAD_REF}" if [ "${SOURCE}" != "stage" ]; then echo "ERROR: Main branch only accepts PRs from 'stage'. Source was: '${SOURCE}'" exit 1 fi echo "Source branch check passed: ${SOURCE} → main" - name: Install build dependencies run: | apt-get update -qq apt-get install -y gcc libcurl4-openssl-dev # Install El SDK — try GCP Artifact Registry prod first, fall back to Gitea release - name: Install El SDK env: GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} RELEASE_BASE: https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest run: | echo "${GCP_SA_KEY}" > /tmp/gcp-key.json apt-get install -y -qq apt-transport-https ca-certificates gnupg curl curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" > /etc/apt/sources.list.d/google-cloud-sdk.list apt-get update -qq && apt-get install -y google-cloud-cli gcloud auth activate-service-account --key-file=/tmp/gcp-key.json gcloud config set project neuron-785695 mkdir -p /usr/local/bin /usr/local/lib/el LATEST_VERSION=$(gcloud artifacts versions list \ --repository=foundation-prod \ --location=us-central1 \ --project=neuron-785695 \ --package=el/elc \ --format="value(name)" 2>/dev/null | sort | tail -1 | sed 's|.*/||' || true) if [ -n "${LATEST_VERSION}" ]; then gcloud artifacts generic download \ --repository=foundation-prod \ --location=us-central1 \ --project=neuron-785695 \ --package=el/elc \ --version="${LATEST_VERSION}" \ --destination=/usr/local/bin/elc chmod +x /usr/local/bin/elc else echo "Falling back to Gitea latest release..." curl -fsSL "${RELEASE_BASE}/elc" -o /usr/local/bin/elc chmod +x /usr/local/bin/elc fi curl -fsSL "${RELEASE_BASE}/el_runtime.c" -o /usr/local/lib/el/el_runtime.c curl -fsSL "${RELEASE_BASE}/el_runtime.h" -o /usr/local/lib/el/el_runtime.h echo "El SDK installed:"; elc --version || true rm -f /tmp/gcp-key.json # Compile-check all standalone .el programs - name: Compile-check all El programs run: | PASS=0; FAIL=0 for f in studio/studio.el test/field_test.el test/language_features_test.el test/llm_test.el studio.el; do [ -f "$f" ] || continue echo -n "Compiling $f ... " if elc "$f" > /dev/null 2>&1; then echo "OK" PASS=$((PASS+1)) else echo "FAIL" elc "$f" 2>&1 FAIL=$((FAIL+1)) fi done echo "Passed: ${PASS}, Failed: ${FAIL}" [ "${FAIL}" -eq 0 ] # Dispatch elql-updated to downstream dependents (none yet — placeholder) - name: Dispatch elql-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 "elql-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":"elql-updated","inputs":{"elql_version":"latest","commit":"'"${GITHUB_SHA}"'"}}'