mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2026-02-15 09:12:39 +00:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
96 lines
2.2 KiB
YAML
96 lines
2.2 KiB
YAML
name: UI Build
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
pull_request:
|
|
branches: [master]
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: packages/ui
|
|
|
|
jobs:
|
|
files-changed:
|
|
name: Detect File Changes
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
ui: ${{ steps.changes.outputs.ui }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Check for file changes
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
|
id: changes
|
|
with:
|
|
token: ${{ github.token }}
|
|
filters: .github/file-filters.yml
|
|
|
|
build:
|
|
name: Build
|
|
if: needs.files-changed.outputs.ui == 'true'
|
|
needs: files-changed
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: 'packages/ui/.tool-versions'
|
|
cache: 'npm'
|
|
cache-dependency-path: packages/ui/package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci
|
|
|
|
- name: Build library
|
|
run: npm run build
|
|
|
|
- name: Verify build output
|
|
run: |
|
|
echo "Checking build output..."
|
|
|
|
# Check that dist directory exists
|
|
if [ ! -d "dist" ]; then
|
|
echo "::error::dist directory not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Check required files exist
|
|
FILES=(
|
|
"dist/index.mjs"
|
|
"dist/index.cjs"
|
|
"dist/index.d.ts"
|
|
"dist/index.d.cts"
|
|
"dist/tailwind.preset.mjs"
|
|
"dist/tailwind.preset.cjs"
|
|
"dist/tailwind.preset.d.ts"
|
|
"dist/tailwind.preset.d.cts"
|
|
"dist/style.css"
|
|
)
|
|
|
|
for file in "${FILES[@]}"; do
|
|
if [ ! -f "$file" ]; then
|
|
echo "::error::Missing required file: $file"
|
|
exit 1
|
|
fi
|
|
echo "✓ $file"
|
|
done
|
|
|
|
echo ""
|
|
echo "All build outputs verified!"
|
|
|
|
- name: Validate package
|
|
run: npm run validate
|
|
|
|
- name: Upload build artifacts
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: dist
|
|
path: packages/ui/dist/
|
|
retention-days: 7
|