diff --git a/.gitea/workflows/ci-dev.yaml b/.gitea/workflows/ci-dev.yaml index 3fbc045..51e0b83 100644 --- a/.gitea/workflows/ci-dev.yaml +++ b/.gitea/workflows/ci-dev.yaml @@ -45,6 +45,20 @@ jobs: echo "gen2 (self-hosted) elc built" dist/platform/elc --version || true + # Build elb (needed for Artifact Registry publish and downstream CI) + - name: Build elb + run: | + mkdir -p dist/bin + dist/platform/elc elb.el > dist/elb.c + gcc -O2 \ + -I el-compiler/runtime \ + dist/elb.c \ + el-compiler/runtime/el_runtime.c \ + -lcurl -lssl -lcrypto -lpthread -lm \ + -o dist/bin/elb + chmod +x dist/bin/elb + echo "elb built" + - name: Run tests - text run: | ELC="$(pwd)/dist/platform/elc" \ @@ -183,6 +197,14 @@ jobs: --version="${VERSION}" \ --source=dist/platform/elc + gcloud artifacts generic upload \ + --repository=foundation-dev \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el-elb \ + --version="${VERSION}" \ + --source=dist/bin/elb + gcloud artifacts generic upload \ --repository=foundation-dev \ --location=us-central1 \ @@ -199,5 +221,13 @@ jobs: --version="${VERSION}" \ --source=el-compiler/runtime/el_runtime.h + gcloud artifacts generic upload \ + --repository=foundation-dev \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el-runtime-js \ + --version="${VERSION}" \ + --source=el-compiler/runtime/el_runtime.js + echo "Published El SDK version=${VERSION} to foundation-dev" rm -f /tmp/gcp-key.json diff --git a/.gitea/workflows/sdk-release.yaml b/.gitea/workflows/sdk-release.yaml index b9ce931..c326259 100644 --- a/.gitea/workflows/sdk-release.yaml +++ b/.gitea/workflows/sdk-release.yaml @@ -305,6 +305,14 @@ jobs: --version="${VERSION}" \ --source=dist/platform/elc + gcloud artifacts generic upload \ + --repository=foundation-prod \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el-elb \ + --version="${VERSION}" \ + --source=dist/bin/elb + gcloud artifacts generic upload \ --repository=foundation-prod \ --location=us-central1 \ @@ -321,7 +329,62 @@ jobs: --version="${VERSION}" \ --source=el-compiler/runtime/el_runtime.h + gcloud artifacts generic upload \ + --repository=foundation-prod \ + --location=us-central1 \ + --project=neuron-785695 \ + --package=el-runtime-js \ + --version="${VERSION}" \ + --source=el-compiler/runtime/el_runtime.js + echo "Published El SDK version=${VERSION} to foundation-prod" + # Keep key alive for the ci-base rebuild step below + # (deleted in that step after docker push) + + - name: Rebuild ci-base with fresh El SDK + # Patches ci-base:latest in-place: pulls the existing image (which has all + # system deps — Node, Go, gcloud, Docker CLI, etc.) and overlays the freshly + # built El SDK on top. Keeps the full ci-base rebuild fast and incremental. + if: github.event_name == 'push' + env: + GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }} + run: | + set -euo pipefail + CI_BASE="us-central1-docker.pkg.dev/neuron-785695/neuron-ci/ci-base" + SHA="${GITHUB_SHA:0:8}" + + echo "${GCP_SA_KEY}" > /tmp/gcp-key.json + gcloud auth activate-service-account --key-file=/tmp/gcp-key.json + gcloud config set project neuron-785695 + gcloud auth configure-docker us-central1-docker.pkg.dev --quiet + + # Pull existing ci-base (system deps stay cached in the base layer) + docker pull "${CI_BASE}:latest" + + # Inline Dockerfile — only replaces the El SDK layer + cat > /tmp/Dockerfile.ci-base-patch << 'EOF' + ARG BASE + FROM ${BASE} + COPY dist/platform/elc /opt/el/dist/platform/elc + COPY dist/bin/elb /opt/el/dist/bin/elb + COPY el-compiler/runtime/el_runtime.c /opt/el/el-compiler/runtime/el_runtime.c + COPY el-compiler/runtime/el_runtime.h /opt/el/el-compiler/runtime/el_runtime.h + COPY el-compiler/runtime/el_runtime.js /opt/el/el-compiler/runtime/el_runtime.js + RUN chmod +x /opt/el/dist/platform/elc /opt/el/dist/bin/elb + EOF + + docker build \ + --build-arg BASE="${CI_BASE}:latest" \ + --build-arg BUILDKIT_INLINE_CACHE=1 \ + -f /tmp/Dockerfile.ci-base-patch \ + -t "${CI_BASE}:latest" \ + -t "${CI_BASE}:${SHA}" \ + . + + docker push "${CI_BASE}:latest" + docker push "${CI_BASE}:${SHA}" + + echo "ci-base rebuilt: ${CI_BASE}:latest (${SHA})" rm -f /tmp/gcp-key.json - name: Dispatch el-sdk-updated to downstream repos @@ -330,7 +393,7 @@ jobs: GITEA_TOKEN: ${{ secrets.GIT_TOKEN }} GITEA_API: https://git.neuralplatform.ai/api/v1 run: | - for repo in neuron-technologies/forge; do + for repo in neuron-technologies/forge neuron-technologies/neuron-web; do curl -sf -X POST \ -H "Authorization: token ${GITEA_TOKEN}" \ -H "Content-Type: application/json" \