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
68 changes: 68 additions & 0 deletions .github/workflows/_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ jobs:
rustup default stable
cargo --version

- name: 🦀 Install cross-compilation tools
if: ${{ inputs.release }}
run: |
# Install cross for easy cross-compilation
cargo install cross --locked

# Add required targets
rustup target add x86_64-unknown-linux-gnu
rustup target add aarch64-unknown-linux-gnu
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin

- name: ☕ Setup Java
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
with:
Expand Down Expand Up @@ -226,11 +238,67 @@ jobs:
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}

- name: 🔨 Build native binaries for GitHub Release
if: ${{ inputs.release }}
run: |
set -euo pipefail
cd clients/agent-runtime
mkdir -p dist

# Build for Linux x64 using cross
echo "Building for Linux x64..."
cross build --release --target x86_64-unknown-linux-gnu
cp target/x86_64-unknown-linux-gnu/release/corvus dist/corvus-linux-x64

# Build for Linux arm64 using cross
echo "Building for Linux arm64..."
cross build --release --target aarch64-unknown-linux-gnu
cp target/aarch64-unknown-linux-gnu/release/corvus dist/corvus-linux-arm64

# Build for macOS x64 using cross
echo "Building for macOS x64..."
if cross build --release --target x86_64-apple-darwin 2>/dev/null; then
cp target/x86_64-apple-darwin/release/corvus dist/corvus-darwin-x64
else
echo "⚠️ Cross-compilation for macOS x64 not available, skipping..."
echo "Note: macOS binaries must be built on macOS runners or with special tooling"
fi

# Build for macOS arm64 using cross
echo "Building for macOS arm64..."
if cross build --release --target aarch64-apple-darwin 2>/dev/null; then
cp target/aarch64-apple-darwin/release/corvus dist/corvus-darwin-arm64
else
echo "⚠️ Cross-compilation for macOS arm64 not available, skipping..."
echo "Note: macOS binaries must be built on macOS runners or with special tooling"
fi

ls -la dist/

- name: 📋 Generate SHA256 checksums
if: ${{ inputs.release }}
run: |
set -euo pipefail
cd clients/agent-runtime/dist

for binary in corvus-*; do
if [ -f "$binary" ] && [[ ! "$binary" == *.sha256 ]] && [[ ! "$binary" == *.skip ]]; then
echo "Generating checksum for $binary..."
sha256sum "$binary" > "$binary.sha256"
cat "$binary.sha256"
fi
done

echo "Checksum files generated:"
ls -la *.sha256 || echo "No checksum files found"

- name: 🚀 Create GitHub Release
if: ${{ inputs.release }}
uses: softprops/action-gh-release@5be0e66d93ac7ed76da52eca8bb058f665c3a5fe # v2.4.2
with:
body: ${{ steps.changelog.outputs.changelog }}
generate_release_notes: true
files: |
clients/agent-runtime/dist/corvus-*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 3 additions & 4 deletions clients/agent-runtime/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ default_temperature = 0.7

[gateway]
port = 3000
host = "[::]"
allow_public_bind = true
host = "127.0.0.1"
EOF

RUN chown -R 65534:65534 /corvus-data
Expand Down Expand Up @@ -82,7 +81,7 @@ WORKDIR /corvus-data
USER 65534:65534
EXPOSE 3000
ENTRYPOINT ["corvus"]
CMD ["gateway", "--port", "3000", "--host", "[::]"]
CMD ["gateway", "--port", "3000", "--host", "127.0.0.1"]

# ── Stage 4: Production Runtime (Distroless) ─────────────────
FROM gcr.io/distroless/cc-debian13:nonroot AS release
Expand All @@ -104,4 +103,4 @@ WORKDIR /corvus-data
USER 65534:65534
EXPOSE 3000
ENTRYPOINT ["corvus"]
CMD ["gateway", "--port", "3000", "--host", "[::]"]
CMD ["gateway", "--port", "3000", "--host", "127.0.0.1"]
82 changes: 37 additions & 45 deletions clients/web/README.md
Original file line number Diff line number Diff line change
@@ -1,80 +1,72 @@
# Corvus Web Monorepo

Estructura multi-app para proyectos web de Corvus.
Monorepo para apps web de Corvus, incluyendo docs, marketing y futuros frontends.

## 📁 Estructura

```
apps/web/
```text
clients/web/
├── apps/
│ ├── docs/ # Documentación Starlight (actual)
│ ├── landing/ # Landing page (futuro)
│ └── dashboard/ # Frontend web (futuro)
│ ├── docs/ # Documentación (Astro + Starlight)
│ ├── marketing/ # Landing y páginas de marketing (Astro)
│ └── dashboard/ # Dashboard web (pendiente)
├── packages/
│ └── shared/ # Componentes/utilidades compartidas
├── package.json # Workspace root
└── pnpm-workspace.yaml # Configuración pnpm workspace
│ └── shared/ # Utilidades compartidas
├── package.json
└── pnpm-workspace.yaml
```

## 🚀 Apps

### docs
- **Framework**: Astro + Starlight
- **Puerto**: 4321
- **Uso**: Documentación del proyecto

### landing (futuro)
- **Framework**: Astro/Vue/React (por definir)
- **Puerto**: 4322
- **Uso**: Landing page marketing
- Framework: Astro + Starlight
- Puerto por defecto: 4321

### marketing

- Framework: Astro
- URL configurable con `MARKETING_URL` (dev default: `http://localhost:9988`)
- Incluye script público de instalación en `/install`

### dashboard

### dashboard (futuro)
- **Framework**: Vue/React (por definir)
- **Puerto**: 4323
- **Uso**: Panel de administración
- Estado: placeholder
- Puerto por defecto: 4323

## 🛠️ Comandos

```bash
# Instalar dependencias en todas las apps
# Instalar dependencias workspace
pnpm install

# Build de todas las apps
pnpm build

# Build individual
pnpm build:docs
pnpm build:landing
pnpm build:marketing
pnpm build:dashboard

# Compatibilidad (alias antiguo)
pnpm build:landing

# Development
pnpm dev # docs por defecto
pnpm dev:landing
pnpm dev
pnpm dev:marketing
pnpm dev:dashboard

# Lint/Format
# Compatibilidad (alias antiguo)
pnpm dev:landing

# Quality
pnpm format
pnpm check
```

## 📦 Packages Compartidos

Los paquetes en `packages/` pueden ser importados por cualquier app:

```typescript
import { Button } from '@corvus/shared';
```

## 🏗️ Agregar una nueva app

1. Crear directorio en `apps/<nombre>/`
2. Agregar `package.json` con nombre `@corvus/<nombre>`
3. Ejecutar `pnpm install` desde root
4. Agregar scripts en `package.json` root si es necesario
5. Actualizar `build.gradle.kts` para incluir la nueva app

## 📝 Notas
## 📦 Añadir más proyectos web

- Cada app tiene su propio `node_modules` (a través de pnpm)
- Las dependencias compartidas se instalan en root y se symlinkan
- El build de Gradle construye todas las apps automáticamente
1. Crear `apps/<nombre>/` con su `package.json`
2. Ejecutar `pnpm install` en `clients/web`
3. Ajustar scripts en `clients/web/package.json` si aplica
4. Confirmar que `clients/web/build.gradle.kts` tenga el puerto/config correspondiente
21 changes: 0 additions & 21 deletions clients/web/apps/landing/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions clients/web/apps/landing/package.json

This file was deleted.

4 changes: 4 additions & 0 deletions clients/web/apps/marketing/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Marketing canonical URL used by Astro config
# Dev example: http://localhost:9988
# Prod example: https://profiletailors.com
MARKETING_URL=http://localhost:9988
57 changes: 57 additions & 0 deletions clients/web/apps/marketing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Marketing (Astro)

Sitio de marketing para Corvus.

## Objetivo

Este proyecto en `clients/web/apps/marketing` centraliza:

- Landing principal
- Páginas de campañas
- Script público de instalación (`/install`)

## Desarrollo

```bash
# Desde clients/web
pnpm dev:marketing

# Build estático
pnpm build:marketing

# Validaciones
pnpm --filter @corvus/marketing run check
```

## Configuración de dominio y puerto

- Dev default: `http://localhost:9988`
- Prod default: `https://profiletailors.com`
- El puerto de `dev/preview` se toma de `MARKETING_URL` si incluye puerto; si no, usa `9988`

Variable soportada:

```bash
# Forzar URL para cualquier entorno
MARKETING_URL=https://staging.profiletailors.com pnpm build:marketing
```

Puedes cargarla por entorno con archivos `.env`:

```bash
# .env.development
MARKETING_URL=http://localhost:9988

# .env.production
MARKETING_URL=https://profiletailors.com
```

## Instalador

Este proyecto publica el script wizard en:

```bash
curl -fsSL https://profiletailors.com/install | bash
```

Archivo fuente: `public/install`
39 changes: 39 additions & 0 deletions clients/web/apps/marketing/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { defineConfig } from "astro/config";
import { loadEnv } from "vite";
import { PORTS, getPortFromUrl, resolveSiteUrl } from "@corvus/shared/env";

const DEFAULT_DEV_URL = `http://localhost:${PORTS.MARKETING}`;
const DEFAULT_PROD_URL = "https://profiletailors.com";

export default defineConfig(({ command, mode }) => {
const env = loadEnv(mode, process.cwd(), "");
const isProdLike = mode === "production" || command === "build";
const marketingUrl = resolveSiteUrl({
env,
primaryKey: "MARKETING_URL",
localDefault: DEFAULT_DEV_URL,
productionDefault: DEFAULT_PROD_URL,
genericKeys: ["SITE_URL"],
providerKeys: {
cloudflare: "CF_PAGES_URL",
vercel: "VERCEL_URL",
netlify: "URL",
},
isProdLike,
});
const resolvedPort = getPortFromUrl(marketingUrl, PORTS.MARKETING);

return {
site: marketingUrl,
output: "static",
compressHTML: true,
server: {
host: true,
port: resolvedPort,
},
preview: {
host: true,
port: resolvedPort,
},
};
});
Loading
Loading