c24197516f
Forge Release / build-and-release (push) Failing after 3s
- forge.el: add import statements for schema/probe/compiler/install - All files: arg(n)/arg_count() → get(args(),n)/len(args()) - compiler.el: llm_call_system (utility cap violation) → http_post_with_headers - install.el: http_post_auth_json → http_post_json (_auth already in body) - Makefile: local dev build using installed El SDK - .gitea/workflows/forge-release.yaml: CI build on push + el-sdk-updated dispatch - dist/forge: builds and runs
126 lines
4.3 KiB
YAML
126 lines
4.3 KiB
YAML
name: Forge Release
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
repository_dispatch:
|
|
types:
|
|
- el-sdk-updated
|
|
|
|
jobs:
|
|
build-and-release:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install build dependencies
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y gcc libcurl4-openssl-dev
|
|
|
|
# Install El SDK from the latest release
|
|
- name: Install El SDK
|
|
env:
|
|
RELEASE_BASE: https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest
|
|
run: |
|
|
mkdir -p /usr/local/bin /usr/local/lib/el
|
|
|
|
echo "Downloading elc..."
|
|
curl -fsSL "${RELEASE_BASE}/elc" -o /usr/local/bin/elc
|
|
chmod +x /usr/local/bin/elc
|
|
|
|
echo "Downloading el_runtime.c..."
|
|
curl -fsSL "${RELEASE_BASE}/el_runtime.c" -o /usr/local/lib/el/el_runtime.c
|
|
|
|
echo "Downloading el_runtime.h..."
|
|
curl -fsSL "${RELEASE_BASE}/el_runtime.h" -o /usr/local/lib/el/el_runtime.h
|
|
|
|
echo "El SDK installed:"
|
|
elc --version || true
|
|
|
|
# Compile forge.el → dist/forge.c
|
|
- name: Compile forge.el
|
|
run: |
|
|
mkdir -p dist
|
|
elc src/forge.el > dist/forge.c
|
|
echo "Compiled src/forge.el → dist/forge.c"
|
|
|
|
# Link to produce the forge binary
|
|
- name: Link forge binary
|
|
run: |
|
|
cc -std=c11 -O2 \
|
|
-I /usr/local/lib/el \
|
|
-o dist/forge \
|
|
dist/forge.c \
|
|
/usr/local/lib/el/el_runtime.c \
|
|
-lcurl -lpthread
|
|
echo "Linked dist/forge"
|
|
ls -lh dist/forge
|
|
|
|
# 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/forge
|
|
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\": \"Forge (latest)\",
|
|
\"body\": \"Latest Forge 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 forge binary
|
|
echo "Uploading forge binary..."
|
|
curl -sf -X POST \
|
|
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
-F "attachment=@dist/forge;filename=forge" \
|
|
"${GITEA_API}/repos/${REPO}/releases/${RELEASE_ID}/assets"
|
|
|
|
echo "Release published successfully"
|
|
|
|
# Dispatch forge-updated to any downstream dependents
|
|
- name: Dispatch forge-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 "forge-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":"forge-updated","inputs":{"forge_version":"latest","commit":"'"${GITHUB_SHA}"'"}}'
|