diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 1e6465a..b4a78d0 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -9,61 +9,54 @@ on: jobs: e2e: - runs-on: macos-latest + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 + - id: yarn-cache + uses: actions/cache@v3 with: path: | - ~/.gradle/caches - ~/.gradle/wrapper - key: gradle - - uses: actions/cache@v3 - id: avd-cache - with: - path: | - ~/.android/avd/* - ~/.android/adb* - key: avd + **/node_modules + .yarn/install-state.gz + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} + ${{ runner.os }}-yarn- - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: '11' + java-version: '17' - uses: android-actions/setup-android@v2 - - name: Android Deps - run: | - rm -rf ~/Library/Android/sdk/ndk || echo "skipped" - rm -rf ~/Library/Android/sdk/ndk-bundle || echo "skipped" - uses: nttld/setup-ndk@v1 id: setup-ndk with: ndk-version: r21d - - name: Set up Node - run: | + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + - run: | npm install -g detox-cli npm install -g yarn - - run: yarn + npm install -g node-gyp + - if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --immutable + shell: bash - run: yarn example build:android env: ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + - run: | + rm -rf ~/.gradle + rm -rf /usr/local/lib/android/sdk/ndk/ - run: yarn example start & timeout-minutes: 10 - - if: steps.avd-cache.outputs.cache-hit != 'true' - uses: reactivecircus/android-emulator-runner@v2 - with: - api-level: 29 - avd-name: PhoneAPI30 - arch: x86_64 - force-avd-creation: false - emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none - disable-animations: false - script: echo "Generated AVD snapshot for caching." + - name: Enable KVM + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm - uses: reactivecircus/android-emulator-runner@v2 with: api-level: 29 avd-name: PhoneAPI30 - arch: x86_64 - force-avd-creation: false - emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none disable-animations: true script: yarn example test:android diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 4022d5b..0ef1a4b 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -2,32 +2,40 @@ name: iOS on: workflow_dispatch: -# pull_request: -# push: -# tags: -# - 'v*' + pull_request: + push: + tags: + - 'v*' jobs: e2e: runs-on: macos-latest steps: - uses: actions/checkout@v3 - - uses: actions/cache@v3 - id: ios-cache + - id: yarn-cache + uses: actions/cache@v3 with: path: | - example/ios/build/* - example/ios/Pods/* - key: ios - - name: Set up Node - run: | + **/node_modules + .yarn/install-state.gz + key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }} + restore-keys: | + ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} + ${{ runner.os }}-yarn- + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + - run: | npm install -g detox-cli npm install -g yarn + npm install -g node-gyp - name: Install Detox run: | brew tap wix/brew brew install applesimutils - - run: yarn + - if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn install --immutable + shell: bash - run: yarn example build:ios - run: yarn example start & timeout-minutes: 20 diff --git a/ios/FastOpenpgp.h b/ios/FastOpenpgp.h index 9f00308..9324250 100644 --- a/ios/FastOpenpgp.h +++ b/ios/FastOpenpgp.h @@ -2,15 +2,9 @@ #import "react-native-fast-openpgp.h" #endif -#ifdef RCT_NEW_ARCH_ENABLED -#import "RNFastOpenpgpSpec.h" - -@interface FastOpenpgp : NSObject -#else #import @interface FastOpenpgp : NSObject -#endif @property (nonatomic, assign) BOOL setBridgeOnMainQueue; @end diff --git a/package.json b/package.json index 31d3cc5..8d4c379 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-fast-openpgp", - "version": "2.7.3", + "version": "2.7.4", "description": "library for use openPGP", "main": "lib/commonjs/index", "module": "lib/module/index", @@ -166,5 +166,15 @@ "dependencies": { "big-integer": "^1.6.51", "flatbuffers": "2.0.6" + }, + "codegenConfig": { + "name": "RNFastOpenpgpSpec", + "type": "modules", + "jsSrcsDir": "src" + }, + "create-react-native-library": { + "type": "module-mixed", + "languages": "cpp", + "version": "0.38.2" } } diff --git a/react-native-fast-openpgp.podspec b/react-native-fast-openpgp.podspec index 07b031a..6700041 100644 --- a/react-native-fast-openpgp.podspec +++ b/react-native-fast-openpgp.podspec @@ -14,7 +14,7 @@ Pod::Spec.new do |s| s.platforms = { :ios => "11.0" } s.source = { :git => "https://github.com/jerson/react-native-fast-openpgp.git", :tag => "#{s.version}" } - s.source_files = "ios/**/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}" + s.source_files = "ios/*.{h,m,mm}", "cpp/**/*.{hpp,cpp,c,h}" s.vendored_framework = 'ios/Openpgp.xcframework' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' }