build-artifacts.ymlโข2.42 kB
---
name: Build Artifacts
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
permissions:
contents: read
env:
NODE_OPTIONS: --max-old-space-size=4096
CI: true
jobs:
build-artifacts:
name: Validate Build Artifacts
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'
cache-dependency-path: package-lock.json
- name: Cache TypeScript build
uses: actions/cache@v4
with:
path: |
dist/
build/
*.tsbuildinfo
key: typescript-build-${{ runner.os }}-20.x-${{ hashFiles('src/**/*.ts', 'tsconfig*.json', 'package.json', 'package-lock.json') }}
restore-keys: |
typescript-build-${{ runner.os }}-20.x-
typescript-build-${{ runner.os }}-
- name: Install dependencies
run: npm ci
- name: Build project
run: npm run build
- name: Verify build artifacts
shell: bash
run: |
echo "๐ Verifying build artifacts..."
# Check main build output
if [ -f "dist/index.js" ]; then
echo "โ
dist/index.js exists"
else
echo "โ Missing dist/index.js"
exit 1
fi
# Check TypeScript declarations
if [ -f "dist/index.d.ts" ]; then
echo "โ
dist/index.d.ts exists"
else
echo "โ Missing dist/index.d.ts"
exit 1
fi
# Check personas directory
if [ -d "data/personas" ]; then
echo "โ
data/personas directory exists"
else
echo "โ Missing data/personas directory"
exit 1
fi
# File size analysis
echo "๐ Build artifact sizes:"
ls -lh dist/
echo "โ
All build artifacts verified successfully!"
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
dist/
data/personas/
retention-days: 30