Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,107 @@ jobs:
VERSION="${{ steps.version.outputs.version }}"
sed -i "s/^__version__ = \".*\"/__version__ = \"$VERSION\"/" sentience/__init__.py

- name: Verify extension files are present
run: |
echo "🔍 Verifying extension files are included..."

# Check required extension files exist
REQUIRED_FILES=(
"sentience/extension/manifest.json"
"sentience/extension/content.js"
"sentience/extension/background.js"
"sentience/extension/injected_api.js"
"sentience/extension/pkg/sentience_core.js"
"sentience/extension/pkg/sentience_core_bg.wasm"
)

MISSING_FILES=()
for file in "${REQUIRED_FILES[@]}"; do
if [ ! -f "$file" ]; then
MISSING_FILES+=("$file")
fi
done

if [ ${#MISSING_FILES[@]} -ne 0 ]; then
echo "❌ Error: Missing required extension files:"
printf ' - %s\n' "${MISSING_FILES[@]}"
echo ""
echo "Please ensure the extension is synced before releasing."
echo "Run the sync-extension workflow or manually sync extension files."
exit 1
fi

# Verify findTextRect function exists in injected_api.js
if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
echo "❌ Error: findTextRect function not found in injected_api.js"
echo "The extension may be out of date. Please sync the extension before releasing."
exit 1
fi

echo "✅ All extension files verified"
echo "📦 Extension files that will be included:"
find sentience/extension -type f | sort

- name: Build package
run: |
python -m build

- name: Check package
run: |
twine check dist/*

- name: Verify extension files in built package
run: |
echo "🔍 Verifying extension files are included in the built package..."

# Extract wheel to check contents
WHEEL_FILE=$(ls dist/*.whl | head -1)
WHEEL_PATH=$(realpath "$WHEEL_FILE")
echo "Checking wheel: $WHEEL_PATH"

# Create temp directory for extraction
TEMP_DIR=$(mktemp -d)
cd "$TEMP_DIR"

# Extract wheel (it's a zip file)
unzip -q "$WHEEL_PATH"

# Check for required extension files in the wheel
REQUIRED_IN_WHEEL=(
"sentience/extension/manifest.json"
"sentience/extension/injected_api.js"
"sentience/extension/pkg/sentience_core.js"
"sentience/extension/pkg/sentience_core_bg.wasm"
)

MISSING_IN_WHEEL=()
for file in "${REQUIRED_IN_WHEEL[@]}"; do
if [ ! -f "$file" ]; then
MISSING_IN_WHEEL+=("$file")
fi
done

if [ ${#MISSING_IN_WHEEL[@]} -ne 0 ]; then
echo "❌ Error: Extension files missing from built wheel:"
printf ' - %s\n' "${MISSING_IN_WHEEL[@]}"
echo ""
echo "This indicates a packaging configuration issue."
echo "Check MANIFEST.in and pyproject.toml package-data settings."
exit 1
fi

# Verify findTextRect is in the packaged injected_api.js
if ! grep -q "findTextRect:" sentience/extension/injected_api.js; then
echo "❌ Error: findTextRect not found in packaged injected_api.js"
exit 1
fi

echo "✅ All extension files verified in built package"
echo "📦 Extension files found in wheel:"
find sentience/extension -type f | sort

# Cleanup
rm -rf "$TEMP_DIR"

- name: Publish to PyPI
env:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "sentienceapi"
version = "0.90.8"
version = "0.90.9"
description = "Python SDK for Sentience AI Agent Browser Automation"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion sentience/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
)
from .wait import wait_for

__version__ = "0.90.8"
__version__ = "0.90.9"

__all__ = [
# Core SDK
Expand Down