@@ -50,13 +50,107 @@ jobs:
5050 VERSION="${{ steps.version.outputs.version }}"
5151 sed -i "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" sentience/__init__.py
5252
53+ - name : Verify extension files are present
54+ run : |
55+ echo "🔍 Verifying extension files are included..."
56+
57+ # Check required extension files exist
58+ REQUIRED_FILES=(
59+ "sentience/extension/manifest.json"
60+ "sentience/extension/content.js"
61+ "sentience/extension/background.js"
62+ "sentience/extension/injected_api.js"
63+ "sentience/extension/pkg/sentience_core.js"
64+ "sentience/extension/pkg/sentience_core_bg.wasm"
65+ )
66+
67+ MISSING_FILES=()
68+ for file in "${REQUIRED_FILES[@]}"; do
69+ if [ ! -f "$file" ]; then
70+ MISSING_FILES+=("$file")
71+ fi
72+ done
73+
74+ if [ ${#MISSING_FILES[@]} -ne 0 ]; then
75+ echo "❌ Error: Missing required extension files:"
76+ printf ' - %s\n' "${MISSING_FILES[@]}"
77+ echo ""
78+ echo "Please ensure the extension is synced before releasing."
79+ echo "Run the sync-extension workflow or manually sync extension files."
80+ exit 1
81+ fi
82+
83+ # Verify findTextRect function exists in injected_api.js
84+ if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
85+ echo "❌ Error: findTextRect function not found in injected_api.js"
86+ echo "The extension may be out of date. Please sync the extension before releasing."
87+ exit 1
88+ fi
89+
90+ echo "✅ All extension files verified"
91+ echo "📦 Extension files that will be included:"
92+ find sentience/extension -type f | sort
93+
5394 - name : Build package
5495 run : |
5596 python -m build
5697
5798 - name : Check package
5899 run : |
59100 twine check dist/*
101+
102+ - name : Verify extension files in built package
103+ run : |
104+ echo "🔍 Verifying extension files are included in the built package..."
105+
106+ # Extract wheel to check contents
107+ WHEEL_FILE=$(ls dist/*.whl | head -1)
108+ WHEEL_PATH=$(realpath "$WHEEL_FILE")
109+ echo "Checking wheel: $WHEEL_PATH"
110+
111+ # Create temp directory for extraction
112+ TEMP_DIR=$(mktemp -d)
113+ cd "$TEMP_DIR"
114+
115+ # Extract wheel (it's a zip file)
116+ unzip -q "$WHEEL_PATH"
117+
118+ # Check for required extension files in the wheel
119+ REQUIRED_IN_WHEEL=(
120+ "sentience/extension/manifest.json"
121+ "sentience/extension/injected_api.js"
122+ "sentience/extension/pkg/sentience_core.js"
123+ "sentience/extension/pkg/sentience_core_bg.wasm"
124+ )
125+
126+ MISSING_IN_WHEEL=()
127+ for file in "${REQUIRED_IN_WHEEL[@]}"; do
128+ if [ ! -f "$file" ]; then
129+ MISSING_IN_WHEEL+=("$file")
130+ fi
131+ done
132+
133+ if [ ${#MISSING_IN_WHEEL[@]} -ne 0 ]; then
134+ echo "❌ Error: Extension files missing from built wheel:"
135+ printf ' - %s\n' "${MISSING_IN_WHEEL[@]}"
136+ echo ""
137+ echo "This indicates a packaging configuration issue."
138+ echo "Check MANIFEST.in and pyproject.toml package-data settings."
139+ exit 1
140+ fi
141+
142+ # Verify findTextRect is in the packaged injected_api.js
143+ if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
144+ echo "❌ Error: findTextRect not found in packaged injected_api.js"
145+ exit 1
146+ fi
147+
148+ echo "✅ All extension files verified in built package"
149+ echo "📦 Extension files found in wheel:"
150+ find sentience/extension -type f | sort
151+
152+ # Cleanup
153+ rm -rf "$TEMP_DIR"
60154
61155 - name : Publish to PyPI
62156 env :
0 commit comments