From d9542d6a9cbacdc036887f70e142297f4b0c0123 Mon Sep 17 00:00:00 2001 From: weishu Date: Fri, 6 Jan 2023 16:18:17 +0800 Subject: [PATCH] Fix ci for manager (#28) --- .github/workflows/build-ksud.yml | 35 +++++++++++++++++++ .github/workflows/build-manager.yml | 20 ++++++++++- .../{build-userspace.yml => build-su.yml} | 12 +++---- 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build-ksud.yml rename .github/workflows/{build-userspace.yml => build-su.yml} (76%) diff --git a/.github/workflows/build-ksud.yml b/.github/workflows/build-ksud.yml new file mode 100644 index 00000000..6c76ef01 --- /dev/null +++ b/.github/workflows/build-ksud.yml @@ -0,0 +1,35 @@ +name: Build KSUD +on: + push: + branches: [ "main" ] + paths: + - '.github/workflows/build-ksud.yml' + - 'userspace/ksud/**' + pull_request: + branches: [ "main" ] + paths: + - 'userspace/ksud/**' +jobs: + build: + name: Build KSUD + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build arm64 ksud + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target aarch64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml + - name: Build x86_64 ksud + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target x86_64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml + - name: Upload ksud Artifact + uses: actions/upload-artifact@v3 + with: + name: ksud + path: ./userspace/ksud/target/**/release/ksud + diff --git a/.github/workflows/build-manager.yml b/.github/workflows/build-manager.yml index a7167fcf..a6c3c397 100644 --- a/.github/workflows/build-manager.yml +++ b/.github/workflows/build-manager.yml @@ -33,10 +33,28 @@ jobs: echo KEYSTORE_FILE='../key.jks' >> sign.properties echo ${{ secrets.KEYSTORE }} | base64 --decode > key.jks fi + - name: Build arm64 ksud + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target aarch64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml + - name: Build x86_64 ksud + uses: actions-rs/cargo@v1 + with: + use-cross: true + command: build + args: --target x86_64-linux-android --release --manifest-path ./userspace/ksud/Cargo.toml + - name: Copy ksud to app jniLibs + run: | + mkdir -p app/src/main/jniLibs/arm64-v8a + mkdir -p app/src/main/jniLibs/x86_64 + cp -f ../userspace/ksud/target/aarch64-linux-android/release/ksud ../manager/app/src/main/jniLibs/arm64-v8a/libksud.so + cp -f ../userspace/ksud/target/x86_64-linux-android/release/ksud ../manager/app/src/main/jniLibs/x86_64/libksud.so - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Build with Gradle - run: ./gradlew build + run: ./gradlew clean assembleRelease - name: Upload build artifact uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/build-userspace.yml b/.github/workflows/build-su.yml similarity index 76% rename from .github/workflows/build-userspace.yml rename to .github/workflows/build-su.yml index b1496463..1640db3a 100644 --- a/.github/workflows/build-userspace.yml +++ b/.github/workflows/build-su.yml @@ -1,4 +1,4 @@ -name: Build Userspace +name: Build SU on: push: branches: [ "main" ] @@ -10,7 +10,8 @@ on: paths: - 'userspace/**' jobs: - build: + build-su: + name: Build userspace su runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -18,12 +19,11 @@ jobs: with: ndk-version: r25b local-cache: true - - name: Build with NDK - working-directory: ./userspace + - name: Build su + working-directory: ./userspace/su run: ndk-build - name: Upload a Build Artifact uses: actions/upload-artifact@v3 with: name: su - path: ./userspace/libs - + path: ./userspace/su/libs \ No newline at end of file