✨ refactor: restructure API with engine, error, runtime, and source m… #37
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: Precompile Binaries | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| TAG: | |
| description: 'Set a Tag' | |
| required: true | |
| default: '' | |
| push: | |
| env: | |
| GITHUB_REPOSITORY: fluttercandies/fjs | |
| RUST_CRATE_DIR: libfjs | |
| NDK_VERSION: 27.0.12077973 | |
| jobs: | |
| precompile: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Dart | |
| uses: dart-lang/setup-dart@v1 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install Linux dependencies | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev | |
| - name: Setup Java (for Android) | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Setup Android SDK (Ubuntu) | |
| if: matrix.os == 'ubuntu-latest' | |
| uses: android-actions/setup-android@v3 | |
| - name: Accept Android SDK licenses | |
| if: matrix.os == 'ubuntu-latest' | |
| run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses | |
| - name: Install Android NDK | |
| if: matrix.os == 'ubuntu-latest' | |
| run: | | |
| $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager "ndk;${{ env.NDK_VERSION }}" | |
| - name: Setup build_tool dependencies | |
| run: | | |
| cd cargokit/build_tool | |
| dart pub get | |
| - name: Precompile binaries (macOS) | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| export IPHONEOS_DEPLOYMENT_TARGET=12.0 | |
| export MACOSX_DEPLOYMENT_TARGET=12.0 | |
| # Set environment variables that work for both iOS device and simulator builds | |
| export BINDGEN_EXTRA_CLANG_ARGS="-target aarch64-apple-ios12.0" | |
| dart run cargokit/build_tool/bin/build_tool.dart precompile-binaries -v --manifest-dir=${{ env.RUST_CRATE_DIR }} --repository=${{ env.GITHUB_REPOSITORY }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PRIVATE_KEY: ${{ secrets.PRECOMPILE_BINARIES_PRIVATE_KEY }} | |
| - name: Precompile binaries (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: dart run cargokit/build_tool/bin/build_tool.dart precompile-binaries -v --manifest-dir=${{ env.RUST_CRATE_DIR }} --repository=${{ env.GITHUB_REPOSITORY }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PRIVATE_KEY: ${{ secrets.PRECOMPILE_BINARIES_PRIVATE_KEY }} | |
| - name: Precompile binaries (Ubuntu with Android) | |
| if: matrix.os == 'ubuntu-latest' | |
| run: dart run cargokit/build_tool/bin/build_tool.dart precompile-binaries -v --manifest-dir=${{ env.RUST_CRATE_DIR }} --repository=${{ env.GITHUB_REPOSITORY }} --android-sdk-location=$ANDROID_HOME --android-ndk-version=${{ env.NDK_VERSION }} --android-min-sdk-version=21 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| PRIVATE_KEY: ${{ secrets.PRECOMPILE_BINARIES_PRIVATE_KEY }} |