Przeglądaj źródła

fix(ci): dist embebido deja de trackearse — el placeholder rompía goreleaser --clean (árbol sucio / tag≠HEAD)

gnacho 4 miesięcy temu
rodzic
commit
da8d5dc278

+ 0 - 5
.github/workflows/release.yml

@@ -38,11 +38,6 @@ jobs:
           npm ci --no-audit --no-fund --prefix app
           npm run build --prefix app
           rm -rf server-go/internal/staticspa/dist && cp -r app/dist server-go/internal/staticspa/dist
-          # dist/index.html está trackeado (placeholder para checkout fresco):
-          # commitear el dist real para que goreleaser --clean no falle por árbol sucio
-          git config user.email ci@netpulse.local && git config user.name ci
-          git add -f server-go/internal/staticspa/dist
-          git commit -q -m "ci: dist embebido del build" || true
 
       - name: Tests Go (ambos módulos)
         run: |

+ 0 - 6
.gitignore

@@ -15,9 +15,3 @@ server/.env
 # Notas locales con credenciales
 *_user.txt
 v2/
-
-# Placeholder del dist embebido: un checkout fresco debe compilar server-go
-# (el dist real lo genera CI antes del build; no commitear el resto del dist)
-!server-go/internal/staticspa/dist/
-server-go/internal/staticspa/dist/*
-!server-go/internal/staticspa/dist/index.html

+ 3 - 2
ARCHITECTURE.md

@@ -125,8 +125,9 @@ con backup atómico (marca `kv.go_migration`).
 `internal/staticspa` sirve el `dist` embebido (override con `STATIC_DIR`).
 Fallback a `index.html` para rutas no-API; `404 Not Found` plano (text/plain)
 para `/api/*` desconocidas, `/assets/*` inexistentes y métodos no-GET.
-El repo commitea un `dist/index.html` placeholder para que un checkout fresco
-compile; el dist real lo genera CI antes del build de Go.
+El `dist` embebido NO se commitea (gitignored): un checkout fresco necesita
+`npm run build --prefix app && cp -r app/dist server-go/internal/staticspa/dist`
+(o `STATIC_DIR`) antes de compilar Go; la CI lo hace siempre antes del build.
 
 ## Variables de entorno
 

+ 3 - 2
server-go/README.md

@@ -18,8 +18,9 @@ cd server-go
 go build -trimpath -ldflags "-s -w" -o netpulse ./cmd/netpulse
 ```
 
-El binario embebe `internal/staticspa/dist` (en el repo hay un placeholder;
-**la CI copia `app/dist` ahí antes de compilar** — ver `.github/workflows/go.yml`).
+El binario embebe `internal/staticspa/dist` (gitignored; **la CI copia `app/dist`
+ahí antes de compilar** — ver `.github/workflows/go.yml`; en local hay que hacer lo
+mismo una vez o el build de Go falla).
 Para desarrollo, `STATIC_DIR=../app/dist` tiene prioridad sobre el embed.
 
 ## Run

+ 0 - 1
server-go/internal/staticspa/dist/index.html

@@ -1 +0,0 @@
-<!doctype html><html><head><meta charset="utf-8"><title>NetPulse</title></head><body><p>Placeholder del dist embebido. CI construye el frontend real antes de compilar server-go.</p></body></html>