docs: update canonical site URL and CI path filters (#21) #69
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
| name: CI Expo | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'libraries/expo-ondevice-ai/**' | |
| - '!libraries/expo-ondevice-ai/**/*.md' | |
| - '!libraries/expo-ondevice-ai/**/*.mdx' | |
| - '!libraries/expo-ondevice-ai/example/app/(tabs)/settings.tsx' | |
| - '.github/workflows/ci-expo.yml' | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - 'libraries/expo-ondevice-ai/**' | |
| - '!libraries/expo-ondevice-ai/**/*.md' | |
| - '!libraries/expo-ondevice-ai/**/*.mdx' | |
| - '!libraries/expo-ondevice-ai/example/app/(tabs)/settings.tsx' | |
| - '.github/workflows/ci-expo.yml' | |
| jobs: | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| library: ${{ steps.filter.outputs.library }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Filter changed files | |
| id: filter | |
| uses: dorny/paths-filter@v3 | |
| with: | |
| filters: | | |
| library: | |
| - '.github/workflows/ci-expo.yml' | |
| - 'libraries/expo-ondevice-ai/**' | |
| - '!libraries/expo-ondevice-ai/**/*.md' | |
| - '!libraries/expo-ondevice-ai/**/*.mdx' | |
| - '!libraries/expo-ondevice-ai/example/app/(tabs)/settings.tsx' | |
| lint-and-test: | |
| name: Lint & Test | |
| needs: changes | |
| if: needs.changes.outputs.library == 'true' | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: libraries/expo-ondevice-ai | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.1.38' | |
| - name: Cache Bun dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.bun/install/cache | |
| key: ${{ runner.os }}-bun-${{ hashFiles('libraries/expo-ondevice-ai/bun.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-bun- | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Lint | |
| run: bun run lint:ci | |
| - name: Test | |
| run: bun run test:coverage | |
| - name: Build | |
| run: bun run build | |
| - name: Verify build output | |
| run: | | |
| if [ ! -f "build/index.js" ] || [ ! -f "build/index.d.ts" ]; then | |
| echo "Build output missing!" | |
| exit 1 | |
| fi | |
| build-android: | |
| name: Build Android | |
| needs: changes | |
| if: needs.changes.outputs.library == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.1.38' | |
| - name: Install library dependencies | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun install | |
| - name: Build library and plugin | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun run build | |
| - name: Install example dependencies | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bun install | |
| - name: Prebuild Android | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bunx expo prebuild --platform android --clean | |
| - name: Build Android | |
| working-directory: libraries/expo-ondevice-ai/example/android | |
| run: ./gradlew assembleDebug --no-daemon | |
| build-ios: | |
| name: Build iOS | |
| needs: changes | |
| if: needs.changes.outputs.library == 'true' | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.1.38' | |
| - name: Install library dependencies | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun install | |
| - name: Build library and plugin | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun run build | |
| - name: Install example dependencies | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bun install | |
| - name: Prebuild iOS | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bunx expo prebuild --platform ios --clean | |
| - name: Cache CocoaPods | |
| uses: actions/cache@v4 | |
| with: | |
| path: libraries/expo-ondevice-ai/example/ios/Pods | |
| key: ${{ runner.os }}-pods-expo-${{ hashFiles('libraries/expo-ondevice-ai/example/ios/Podfile.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pods-expo- | |
| - name: Install CocoaPods | |
| working-directory: libraries/expo-ondevice-ai/example/ios | |
| run: pod install --no-repo-update | |
| - name: Build iOS | |
| working-directory: libraries/expo-ondevice-ai/example/ios | |
| run: | | |
| xcodebuild \ | |
| -workspace expoondeviceaiexample.xcworkspace \ | |
| -scheme expoondeviceaiexample \ | |
| -destination 'generic/platform=iOS Simulator' \ | |
| -configuration Debug \ | |
| build \ | |
| CODE_SIGNING_ALLOWED=NO | |
| build-web: | |
| name: Build Web | |
| needs: changes | |
| if: needs.changes.outputs.library == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: '1.1.38' | |
| - name: Install library dependencies | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun install | |
| - name: Build library | |
| working-directory: libraries/expo-ondevice-ai | |
| run: bun run build | |
| - name: Install example dependencies | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bun install | |
| - name: Export Web | |
| working-directory: libraries/expo-ondevice-ai/example | |
| run: bunx expo export --platform web |