1 Commits

Author SHA1 Message Date
Will Anderson 4303c82e18 add gitflow CI for dev/stage/prod environments 2026-05-04 08:55:33 -05:00
2 changed files with 251 additions and 0 deletions
+127
View File
@@ -0,0 +1,127 @@
name: ELP CI — dev
on:
push:
branches:
- dev
pull_request:
branches:
- dev
jobs:
build-and-test:
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
- name: Install El SDK from dev registry
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
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-dev \
--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-dev \
--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 "https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest/elc" \
-o /usr/local/bin/elc
chmod +x /usr/local/bin/elc
fi
RELEASE_BASE="https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest"
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
# Build ELP binary (Engram Language Protocol — 31 language NLG engine)
# Source order is defined in manifest.el
- name: Build ELP binary
run: |
mkdir -p dist
cat src/language-profile.el \
src/vocabulary.el \
src/morphology.el \
src/morphology-es.el src/morphology-fr.el src/morphology-de.el \
src/morphology-ru.el src/morphology-ja.el src/morphology-fi.el \
src/morphology-ar.el src/morphology-hi.el src/morphology-sw.el \
src/morphology-la.el src/morphology-he.el src/morphology-grc.el \
src/morphology-ang.el src/morphology-sa.el src/morphology-got.el \
src/morphology-non.el src/morphology-enm.el src/morphology-pi.el \
src/morphology-fro.el src/morphology-goh.el src/morphology-sga.el \
src/morphology-txb.el src/morphology-peo.el src/morphology-akk.el \
src/morphology-uga.el src/morphology-egy.el src/morphology-sux.el \
src/morphology-gez.el src/morphology-cop.el \
src/grammar.el \
src/realizer.el \
src/semantics.el \
src/elp.el \
> /tmp/elp-combined.el
elc /tmp/elp-combined.el > dist/elp.c
cc -std=c11 -O2 \
-I /usr/local/lib/el \
-o dist/elp \
dist/elp.c \
/usr/local/lib/el/el_runtime.c \
-lcurl -lpthread
chmod +x dist/elp
echo "Built dist/elp"
ls -lh dist/elp
# Run the acceptance test corpus
- name: Run tests
run: |
ELC=/usr/local/bin/elc \
EL_HOME="$(pwd)" \
bash tests/run.sh
- name: Publish ELP to Artifact Registry (dev)
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
run: |
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
VERSION="${GITEA_SHA:0:8}"
gcloud artifacts generic upload \
--repository=foundation-dev \
--location=us-central1 \
--project=neuron-785695 \
--package=elp/elp \
--version="${VERSION}" \
--source=dist/elp
echo "Published elp version=${VERSION} to foundation-dev/elp/elp"
rm -f /tmp/gcp-key.json
+124
View File
@@ -0,0 +1,124 @@
name: ELP CI — stage
on:
push:
branches:
- stage
pull_request:
branches:
- stage
jobs:
build-and-test:
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
- name: Install El SDK from stage registry
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
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-stage \
--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-stage \
--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 "https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest/elc" \
-o /usr/local/bin/elc
chmod +x /usr/local/bin/elc
fi
RELEASE_BASE="https://git.neuralplatform.ai/neuron-technologies/el/releases/download/latest"
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
- name: Build ELP binary
run: |
mkdir -p dist
cat src/language-profile.el \
src/vocabulary.el \
src/morphology.el \
src/morphology-es.el src/morphology-fr.el src/morphology-de.el \
src/morphology-ru.el src/morphology-ja.el src/morphology-fi.el \
src/morphology-ar.el src/morphology-hi.el src/morphology-sw.el \
src/morphology-la.el src/morphology-he.el src/morphology-grc.el \
src/morphology-ang.el src/morphology-sa.el src/morphology-got.el \
src/morphology-non.el src/morphology-enm.el src/morphology-pi.el \
src/morphology-fro.el src/morphology-goh.el src/morphology-sga.el \
src/morphology-txb.el src/morphology-peo.el src/morphology-akk.el \
src/morphology-uga.el src/morphology-egy.el src/morphology-sux.el \
src/morphology-gez.el src/morphology-cop.el \
src/grammar.el \
src/realizer.el \
src/semantics.el \
src/elp.el \
> /tmp/elp-combined.el
elc /tmp/elp-combined.el > dist/elp.c
cc -std=c11 -O2 \
-I /usr/local/lib/el \
-o dist/elp \
dist/elp.c \
/usr/local/lib/el/el_runtime.c \
-lcurl -lpthread
chmod +x dist/elp
echo "Built dist/elp"
ls -lh dist/elp
- name: Run tests
run: |
ELC=/usr/local/bin/elc \
EL_HOME="$(pwd)" \
bash tests/run.sh
- name: Publish ELP to Artifact Registry (stage)
env:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
run: |
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
VERSION="${GITEA_SHA:0:8}"
gcloud artifacts generic upload \
--repository=foundation-stage \
--location=us-central1 \
--project=neuron-785695 \
--package=elp/elp \
--version="${VERSION}" \
--source=dist/elp
echo "Published elp version=${VERSION} to foundation-stage/elp/elp"
rm -f /tmp/gcp-key.json