-
Notifications
You must be signed in to change notification settings - Fork 2
lexe #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lexe #50
Changes from 6 commits
83f81bd
7e5df68
d5fa4ab
e3d5660
0613984
0e626b3
15e4394
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
| command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-checkout' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; } | ||
| git lfs post-checkout "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
| command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-commit' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; } | ||
| git lfs post-commit "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
| command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'post-merge' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; } | ||
| git lfs post-merge "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
| command -v git-lfs >/dev/null 2>&1 || { printf >&2 "\n%s\n\n" "This repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting the 'pre-push' file in the hooks directory (set by 'core.hookspath'; usually '.git/hooks')."; exit 2; } | ||
| git lfs pre-push "$@" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,169 @@ | ||
| name: Build react-native-lni-lexe | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.github/workflows/build-react-native-lexe.yml' | ||
| - 'Cargo.toml' | ||
| - 'crates/lni/**' | ||
| - 'bindings/react-native-lexe/**' | ||
| push: | ||
| branches: [master, main] | ||
| tags: | ||
| - 'react-native-lni-lexe-v*' | ||
| paths: | ||
| - '.github/workflows/build-react-native-lexe.yml' | ||
| - 'Cargo.toml' | ||
| - 'crates/lni/**' | ||
| - 'bindings/react-native-lexe/**' | ||
| workflow_dispatch: | ||
|
|
||
| concurrency: | ||
| group: react-native-lni-lexe-${{ github.ref }} | ||
| cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }} | ||
|
|
||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| ANDROID_NDK_VERSION: 27.1.12297006 | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build native package | ||
| runs-on: macos-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| # actions/checkout@v4 | ||
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Setup Node.js | ||
| # actions/setup-node@v4 | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install Rust targets | ||
| # dtolnay/rust-toolchain@stable | ||
| uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 | ||
| with: | ||
| toolchain: stable | ||
| targets: >- | ||
| aarch64-apple-ios, | ||
| aarch64-apple-ios-sim, | ||
| aarch64-linux-android, | ||
| armv7-linux-androideabi, | ||
| i686-linux-android, | ||
| x86_64-linux-android | ||
|
|
||
| - name: Install native build dependencies | ||
| run: | | ||
| brew install protobuf | ||
| cargo install cargo-ndk --version 4.1.2 --locked | ||
| "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;$ANDROID_NDK_VERSION" >/dev/null | ||
| test -d "$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" | ||
| echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" >> "$GITHUB_ENV" | ||
| echo "ANDROID_NDK_ROOT=$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" >> "$GITHUB_ENV" | ||
| echo "NDK_HOME=$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Install JavaScript dependencies | ||
| working-directory: bindings/react-native-lexe | ||
| run: | | ||
| corepack enable | ||
| yarn install --immutable | ||
|
|
||
| - name: Verify Rust dependency lockfile | ||
| run: cargo metadata --locked --format-version 1 --no-deps >/dev/null | ||
|
|
||
| - name: Build iOS and Android bindings | ||
| working-directory: bindings/react-native-lexe | ||
| run: | | ||
| yarn ubrn:ios | ||
| yarn ubrn:android | ||
| yarn verify:native | ||
|
|
||
| - name: Verify generated source is current | ||
| run: git diff --exit-code -- bindings/react-native-lexe | ||
|
|
||
| - name: Build JavaScript package | ||
| working-directory: bindings/react-native-lexe | ||
| run: yarn build | ||
|
|
||
| - name: Lint and typecheck JavaScript package | ||
| working-directory: bindings/react-native-lexe | ||
| run: | | ||
| yarn lint | ||
| yarn typecheck | ||
|
|
||
| - name: Link Android example (arm64-v8a) | ||
| working-directory: bindings/react-native-lexe | ||
| run: yarn verify:android | ||
|
|
||
| - name: Validate release tag | ||
| if: startsWith(github.ref, 'refs/tags/react-native-lni-lexe-v') | ||
| working-directory: bindings/react-native-lexe | ||
| run: | | ||
| package_version=$(node -p "require('./package.json').version") | ||
| tag_version=${GITHUB_REF_NAME#react-native-lni-lexe-v} | ||
| if [ "$package_version" != "$tag_version" ]; then | ||
| echo "::error::Tag version $tag_version does not match package version $package_version" | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Create and inspect npm tarball | ||
| working-directory: bindings/react-native-lexe | ||
| run: | | ||
| package_dir="$RUNNER_TEMP/react-native-lni-lexe-package" | ||
| mkdir -p "$package_dir" | ||
| npm pack --pack-destination "$package_dir" | ||
| package=$(find "$package_dir" -maxdepth 1 -name '*.tgz' -print -quit) | ||
| test -n "$package" | ||
| while IFS= read -r artifact; do | ||
| tar -tzf "$package" "package/$artifact" >/dev/null | ||
| done < <(node scripts/verify-native-artifacts.mjs --list) | ||
|
|
||
| - name: Upload npm tarball | ||
| # actions/upload-artifact@v4 | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | ||
| with: | ||
| name: react-native-lni-lexe-npm | ||
| path: ${{ runner.temp }}/react-native-lni-lexe-package/*.tgz | ||
| if-no-files-found: error | ||
| retention-days: 14 | ||
|
|
||
| publish: | ||
| name: Publish npm package | ||
| if: startsWith(github.ref, 'refs/tags/react-native-lni-lexe-v') | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Setup Node.js | ||
| # actions/setup-node@v4 | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: '22' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Download npm tarball | ||
| # actions/download-artifact@v4 | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 | ||
| with: | ||
| name: react-native-lni-lexe-npm | ||
| path: package | ||
|
|
||
| - name: Publish to npm | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: | | ||
| if [ -z "$NODE_AUTH_TOKEN" ]; then | ||
| echo "::error::NPM_TOKEN is not configured" | ||
| exit 1 | ||
| fi | ||
| package=$(find package -maxdepth 1 -name '*.tgz' -print -quit) | ||
| test -n "$package" | ||
| npm publish "$package" --access public | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,5 @@ | ||||||
| # Ignore Cargo-specific files | ||||||
| # Keep the workspace lockfile for reproducible CI and release builds. | ||||||
| **/target/ | ||||||
| /Cargo.lock | ||||||
|
|
||||||
| # Ignore Rust-specific files | ||||||
| **/*.rs.bk | ||||||
|
|
@@ -128,3 +127,17 @@ bindings/lni_react_native/src/generated/** | |||||
| bindings/lni_react_native/cpp/generated/** | ||||||
|
|
||||||
| **/lni_react_native_old/** | ||||||
|
|
||||||
| # Keep the React Native package's Android source tree; the broad Android | ||||||
| # patterns above otherwise hide it. | ||||||
| !bindings/react-native-lexe/android/ | ||||||
| !bindings/react-native-lexe/example/android/ | ||||||
|
|
||||||
| # The example uses Gradle's standard per-developer debug signing key. Do not | ||||||
| # commit an additional private key from the generated project scaffold. | ||||||
| bindings/react-native-lexe/example/android/app/debug.keystore | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Missing This line explicitly ignores the Given the context, it appears the ♻️ Proposed fix-bindings/react-native-lexe/example/android/app/debug.keystore
+!bindings/react-native-lexe/example/android/app/debug.keystore📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
|
|
||||||
| # Release CI builds these and adds them to the npm tarball. They are not | ||||||
| # versioned because each build is hundreds of megabytes across all targets. | ||||||
| bindings/react-native-lexe/ReactNativeLexeFramework.xcframework/ | ||||||
| bindings/react-native-lexe/android/src/main/jniLibs/ | ||||||
Uh oh!
There was an error while loading. Please reload this page.