feat: add documentation page #14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .github/workflows/release.yml | |
name: Create Releases | |
on: | |
push: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version (e.g., 1.0.3-4)' | |
required: true | |
env: | |
# Використовуємо commit hash для версії Android або input version | |
ANDROID_VERSION: ${{ github.event.inputs.version || github.sha }} | |
jobs: | |
android-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get short commit hash | |
id: vars | |
run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_OUTPUT | |
- name: Create Android Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: android-${{ github.event.inputs.version || steps.vars.outputs.short_sha }} | |
name: Android SDK | |
body: | | |
# Android SDK Release | |
**What's included:** | |
- `perch-eye-1.0.3-4.aar` - Android library (ready to use) | |
**How to use:** | |
1. Download the `.aar` file | |
2. Copy to your Android project's `libs/` folder | |
3. Add to `build.gradle`: | |
```gradle | |
dependencies { | |
implementation(files("libs/perch-eye-1.0.3-4.aar")) | |
} | |
``` | |
files: | | |
android-aar/*.aar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
ios-release: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Xcode | |
uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '16.2' | |
- name: Check for existing XCFramework | |
run: | | |
# Перевіряємо чи є готовий XCFramework | |
if [ -d "ios/build_framework/PerchEyeSDK-iOS.xcframework" ]; then | |
echo "✅ Found existing XCFramework" | |
echo "FRAMEWORK_EXISTS=true" >> $GITHUB_ENV | |
elif [ -d "ios/PerchEyeFramework.xcframework" ]; then | |
echo "✅ Found XCFramework in root" | |
echo "FRAMEWORK_EXISTS=true" >> $GITHUB_ENV | |
mkdir -p ios/build_framework | |
cp -r ios/PerchEyeFramework.xcframework ios/build_framework/PerchEyeSDK-iOS.xcframework | |
else | |
echo "⚠️ No existing XCFramework found, will create stub" | |
echo "FRAMEWORK_EXISTS=false" >> $GITHUB_ENV | |
fi | |
- name: Create iOS Framework Package | |
run: | | |
mkdir -p ios-release | |
if [ "$FRAMEWORK_EXISTS" = "true" ]; then | |
echo "📦 Packaging existing XCFramework..." | |
cp -r ios/build_framework/PerchEyeSDK-iOS.xcframework ios-release/ | |
else | |
echo "🔨 Creating minimal framework structure..." | |
# Створюємо мінімальну структуру XCFramework | |
mkdir -p ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64/PerchEyeFramework.framework | |
mkdir -p ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64_x86_64-simulator/PerchEyeFramework.framework | |
# Копіюємо Swift сирці (без C++) | |
if [ -d "ios/PerchEyeFramework" ]; then | |
cp -r ios/PerchEyeFramework/*.swift ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64/PerchEyeFramework.framework/ 2>/dev/null || true | |
cp -r ios/PerchEyeFramework/*.h ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64/PerchEyeFramework.framework/ 2>/dev/null || true | |
fi | |
# Створюємо базовий Info.plist для XCFramework | |
echo '<?xml version="1.0" encoding="UTF-8"?>' > ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<plist version="1.0"><dict>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>AvailableLibraries</key><array><dict>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>LibraryIdentifier</key><string>ios-arm64</string>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>LibraryPath</key><string>PerchEyeFramework.framework</string>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>SupportedArchitectures</key><array><string>arm64</string></array>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>SupportedPlatform</key><string>ios</string>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '</dict></array>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>CFBundlePackageType</key><string>XFWK</string>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '<key>XCFrameworkFormatVersion</key><string>1.0</string>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
echo '</dict></plist>' >> ios-release/PerchEyeSDK-iOS.xcframework/Info.plist | |
# Створюємо placeholder бінарний файл щоб структура була правильною | |
echo "# PerchEye iOS Framework Placeholder" > ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64/PerchEyeFramework.framework/PerchEyeFramework | |
echo "# This is a minimal framework structure" >> ios-release/PerchEyeSDK-iOS.xcframework/ios-arm64/PerchEyeFramework.framework/PerchEyeFramework | |
echo "⚠️ Created minimal framework structure" | |
fi | |
# Debug: показуємо що створилося | |
echo "📋 Contents of ios-release:" | |
ls -la ios-release/ | |
if [ -d "ios-release/PerchEyeSDK-iOS.xcframework" ]; then | |
echo "📋 Contents of XCFramework:" | |
find ios-release/PerchEyeSDK-iOS.xcframework -type f | |
fi | |
cd ios-release | |
zip -r PerchEyeSDK-iOS.xcframework.zip PerchEyeSDK-iOS.xcframework/ | |
echo "📋 Contents of ZIP:" | |
unzip -l PerchEyeSDK-iOS.xcframework.zip | |
- name: Create iOS Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ios-v1.0.0 | |
name: iOS SDK | |
body: | | |
# iOS SDK Release | |
**What's included:** | |
- `PerchEyeSDK-iOS.xcframework.zip` - iOS XCFramework (ready to use) | |
**How to use:** | |
1. Download `PerchEyeSDK-iOS.xcframework.zip` | |
2. Extract the zip file | |
3. Drag `PerchEyeSDK-iOS.xcframework` into your Xcode project | |
4. In target settings, set framework to "Embed & Sign" | |
5. Import in your Swift code: `import PerchEyeFramework` | |
files: | | |
ios-release/PerchEyeSDK-iOS.xcframework.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docs-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
- name: Create Docs Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: docs-v1.0.0 | |
name: Documentation | |
body: | | |
📖 **Live Documentation:** https://onix-systems.github.io/PerchEye-SDK-Multiplatform | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |