Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 95 additions & 0 deletions .github/workflows/deploy-docs-netlify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Build and Deploy to Netlify
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Setup Rust nightly for WASM
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2025-11-15
target: wasm32-unknown-unknown
override: true

- name: Cache Rust dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
ahnlich/target/
key: ${{ runner.os }}-cargo-wasm-${{ hashFiles('**/Cargo.lock') }}

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Install esbuild
run: npm install -g esbuild

- name: Build SDK (for protobuf types)
run: |
cd sdk/ahnlich-client-node
npm install
npm run build
echo "SDK built at sdk/ahnlich-client-node/dist/"

- name: Generate protobuf entry point
run: |
cat > ahnlich/wasm-db/protobuf-entry.js << 'EOF'
// Import and re-export with namespaces to avoid conflicts
import * as queryPb from '../../sdk/ahnlich-client-node/dist/grpc/db/query_pb.js';
import * as serverPb from '../../sdk/ahnlich-client-node/dist/grpc/db/server_pb.js';
import * as keyvalPb from '../../sdk/ahnlich-client-node/dist/grpc/keyval_pb.js';
import * as metadataPb from '../../sdk/ahnlich-client-node/dist/grpc/metadata_pb.js';
import * as predicatePb from '../../sdk/ahnlich-client-node/dist/grpc/predicate_pb.js';

// Export all individual types from keyval, metadata, predicate (no conflicts)
export * from '../../sdk/ahnlich-client-node/dist/grpc/keyval_pb.js';
export * from '../../sdk/ahnlich-client-node/dist/grpc/metadata_pb.js';
export * from '../../sdk/ahnlich-client-node/dist/grpc/predicate_pb.js';

// Export query and server as namespaces to avoid conflicts
export { queryPb, serverPb };
EOF
echo "Protobuf entry point generated"

- name: Build WASM package
run: |
cd ahnlich/wasm-db
chmod +x build.sh
./build.sh
echo "WASM package built at ahnlich/wasm-db/pkg/"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
cache-dependency-path: web/ahnlich-web/yarn.lock

- name: Install and Build Docusaurus 🔧
working-directory: web/ahnlich-web
run: |
export G_TRACKING_ID=${{ secrets.G_TRACKING_ID }}
yarn install --frozen-lockfile
yarn run build
touch build/.nojekyll
cp netlify.toml build/netlify.toml

- name: Deploy to gh-pages-netlify 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: web/ahnlich-web/build
branch: gh-pages-netlify
clean: true
28 changes: 0 additions & 28 deletions .github/workflows/pages.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,36 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
shell: bash

build_wasm_and_publish:
needs: prebuild_preparation
name: Build WASM package
runs-on: ubuntu-latest
if: ${{needs.prebuild_preparation.outputs.bin_name == 'ahnlich-db'}}
steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: Get Cargo toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: 1.97.1
target: wasm32-unknown-unknown

- name: Install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh

- name: Build WASM package
working-directory: ./ahnlich/wasm-db
run: |
wasm-pack build --target web --out-dir pkg
tar -cvzf ahnlich-wasm-db.tar.gz pkg/

- name: Upload WASM package to release
working-directory: ./ahnlich/wasm-db
run: gh release upload ${{github.event.release.tag_name}} ahnlich-wasm-db.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

push_to_registries:
needs: prebuild_preparation
name: Push Docker image to multiple registries
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ jobs:
working-directory: ./ahnlich
run: cargo nextest run --workspace --exclude ai --no-capture


- name: Upload Test Results
uses: actions/upload-artifact@v4
if: always()
Expand All @@ -113,6 +112,7 @@ jobs:
path: ahnlich/target/nextest/default/rust.xml



run-python-tests:
if: always()
runs-on: ubuntu-latest
Expand Down Expand Up @@ -361,6 +361,12 @@ jobs:
name: node
path: ./node

- name: Download WASM Test Output
uses: actions/download-artifact@v4
with:
name: wasm
path: ./wasm

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: always()
Expand All @@ -370,3 +376,4 @@ jobs:
python/*.xml
go/*.xml
node/*.xml
wasm/*.xml
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<p align="left"><img src="assets/logo.jpg" alt="ahnlich" height="120px"></p>

[![All Test](https://github.com/deven96/ahnlich/actions/workflows/test.yml/badge.svg)](https://github.com/deven96/ahnlich/actions/workflows/test.yml)
[![Netlify Status](https://api.netlify.com/api/v1/badges/3ba5137a-7488-4539-a037-7e73f0ed06a8/deploy-status)](https://app.netlify.com/projects/unrivaled-toffee-172de7/deploys)

⚠️ **Note:** Ahnlich continues to evolve **rapidly**, and while stable for most use cases, it may still receive occasional breaking updates as features improve.

Expand Down
18 changes: 0 additions & 18 deletions TODO.md

This file was deleted.

76 changes: 73 additions & 3 deletions ahnlich/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions ahnlich/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ members = [
"tracer",
"utils",
"types",
"wasm-db",
]
resolver = "2"

Expand All @@ -28,6 +29,7 @@ pretty_assertions = "1.4.0"
tracing = "0.1"
thiserror = "1.0"
ahash = "0.8"
getrandom = { version = "0.3", features = ["wasm_js"] }
tokio = { version = "1.37.0", features = [
"net",
"macros",
Expand Down
Loading
Loading