|
56 | 56 | env: |
57 | 57 | CI: true |
58 | 58 |
|
| 59 | + - name: Verify extension files are present |
| 60 | + run: | |
| 61 | + echo "🔍 Verifying extension files are included..." |
| 62 | + |
| 63 | + # Check required extension files exist |
| 64 | + REQUIRED_FILES=( |
| 65 | + "src/extension/manifest.json" |
| 66 | + "src/extension/content.js" |
| 67 | + "src/extension/background.js" |
| 68 | + "src/extension/injected_api.js" |
| 69 | + "src/extension/pkg/sentience_core.js" |
| 70 | + "src/extension/pkg/sentience_core_bg.wasm" |
| 71 | + ) |
| 72 | + |
| 73 | + MISSING_FILES=() |
| 74 | + for file in "${REQUIRED_FILES[@]}"; do |
| 75 | + if [ ! -f "$file" ]; then |
| 76 | + MISSING_FILES+=("$file") |
| 77 | + fi |
| 78 | + done |
| 79 | + |
| 80 | + if [ ${#MISSING_FILES[@]} -ne 0 ]; then |
| 81 | + echo "❌ Error: Missing required extension files:" |
| 82 | + printf ' - %s\n' "${MISSING_FILES[@]}" |
| 83 | + echo "" |
| 84 | + echo "Please ensure the extension is synced before releasing." |
| 85 | + echo "Run the sync-extension workflow or manually sync extension files." |
| 86 | + exit 1 |
| 87 | + fi |
| 88 | + |
| 89 | + # Verify findTextRect function exists in injected_api.js |
| 90 | + if ! grep -q "findTextRect:" src/extension/injected_api.js; then |
| 91 | + echo "❌ Error: findTextRect function not found in injected_api.js" |
| 92 | + echo "The extension may be out of date. Please sync the extension before releasing." |
| 93 | + exit 1 |
| 94 | + fi |
| 95 | + |
| 96 | + echo "✅ All extension files verified" |
| 97 | + echo "📦 Extension files that will be included:" |
| 98 | + find src/extension -type f | sort |
| 99 | +
|
59 | 100 | - name: Build package |
60 | 101 | run: | |
61 | 102 | npm run build |
| 103 | + |
| 104 | + - name: Verify extension files in built package |
| 105 | + run: | |
| 106 | + echo "🔍 Verifying extension files are included in the built package..." |
| 107 | + |
| 108 | + # Check that src/extension directory exists after build |
| 109 | + # (TypeScript build doesn't modify extension files, they should still be in src/) |
| 110 | + if [ ! -d "src/extension" ]; then |
| 111 | + echo "❌ Error: src/extension directory missing after build" |
| 112 | + exit 1 |
| 113 | + fi |
| 114 | + |
| 115 | + # Verify findTextRect is still in the extension after build |
| 116 | + if ! grep -q "findTextRect:" src/extension/injected_api.js; then |
| 117 | + echo "❌ Error: findTextRect not found in extension after build" |
| 118 | + exit 1 |
| 119 | + fi |
| 120 | + |
| 121 | + # Check package.json files array includes src/extension |
| 122 | + if ! grep -q '"src/extension"' package.json; then |
| 123 | + echo "⚠️ Warning: package.json files array may not include src/extension" |
| 124 | + echo "Current files array:" |
| 125 | + grep -A 5 '"files"' package.json || echo "files array not found" |
| 126 | + fi |
| 127 | + |
| 128 | + echo "✅ Extension files verified in package" |
| 129 | + echo "📦 Extension files that will be published:" |
| 130 | + find src/extension -type f | head -20 |
62 | 131 | |
63 | 132 | - name: Publish to npm |
64 | 133 | run: | |
|
0 commit comments