From 944e2677958705abc101aa70eb87d6dabbbb8339 Mon Sep 17 00:00:00 2001 From: txyyh Date: Wed, 20 Jul 2022 19:22:59 +0800 Subject: [PATCH] Separate different action (#107) * Rename ci action * Separate push and pull request action * Change README CI shield * Rename artifact to right name --- .github/workflows/{android.yml => ci.yml} | 6 +-- .github/workflows/pull_request.yml | 54 +++++++++++++++++++++++ README.md | 4 +- 3 files changed, 59 insertions(+), 5 deletions(-) rename .github/workflows/{android.yml => ci.yml} (94%) create mode 100644 .github/workflows/pull_request.yml diff --git a/.github/workflows/android.yml b/.github/workflows/ci.yml similarity index 94% rename from .github/workflows/android.yml rename to .github/workflows/ci.yml index e3d220b98..542af51cf 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ -name: EhViewer +name: CI -on: [push, pull_request] +on: [push] jobs: linux: @@ -32,7 +32,7 @@ jobs: - name: Update ARM64 uses: actions/upload-artifact@v3 with: - name: arm64-${{ github.sha }} + name: arm64-v8a-${{ github.sha }} path: app/build/outputs/apk/release/app-arm64-v8a-release.apk - name: Update x86_64 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 000000000..b16e68732 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,54 @@ +name: Pull Request Check + +on: [pull_request] + +jobs: + linux: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Java 11 + uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 11 + + - name: Setup Android SDK Tools + uses: android-actions/setup-android@v2 + + - name: Install NDK + run: | + echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;25.0.8775105" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null + + - name: Gradle Build + uses: gradle/gradle-build-action@v2 + - run: | + git submodule update --init --recursive + gradle assembleRelease + + - name: Update ARM64 + uses: actions/upload-artifact@v3 + with: + name: arm64-v8a-${{ github.sha }} + path: app/build/outputs/apk/release/app-arm64-v8a-release.apk + + - name: Update x86_64 + uses: actions/upload-artifact@v3 + with: + name: x86_64-${{ github.sha }} + path: app/build/outputs/apk/release/app-x86_64-release.apk + + - name: Update ARM32 + uses: actions/upload-artifact@v3 + with: + name: armeabi-v7a-${{ github.sha }} + path: app/build/outputs/apk/release/app-armeabi-v7a-release.apk + + - name: Update x86 + uses: actions/upload-artifact@v3 + with: + name: x86-${{ github.sha }} + path: app/build/outputs/apk/release/app-x86-release.apk diff --git a/README.md b/README.md index e3292c945..8ef9fff15 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@

- - Github Actions + + Github Actions LICENSE