From fe127d879bbe63c0004ec527f86c3fbf617b56a4 Mon Sep 17 00:00:00 2001 From: LoveSy Date: Tue, 26 Jan 2021 16:38:49 +0800 Subject: [PATCH] Add CI for manager --- .github/workflows/{android.yml => core.yml} | 26 ++++------- .github/workflows/manager.yml | 50 +++++++++++++++++++++ 2 files changed, 58 insertions(+), 18 deletions(-) rename .github/workflows/{android.yml => core.yml} (58%) create mode 100644 .github/workflows/manager.yml diff --git a/.github/workflows/android.yml b/.github/workflows/core.yml similarity index 58% rename from .github/workflows/android.yml rename to .github/workflows/core.yml index 9b89b904..e430cf3c 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/core.yml @@ -1,6 +1,12 @@ -name: Android CI +name: Core -on: [push, pull_request] +on: + push: + paths-ignore: + - 'app/**' + pull_request: + paths-ignore: + - 'app/**' jobs: build: @@ -38,19 +44,3 @@ jobs: with: name: LSPosed-debug path: './LSPosed-debug/*' -# - name: Prepare publish artifact -# if: ${{ github.event_name == 'push' && success() }} -# run: mkdir -p to_publish && mv edxp-core/release/EdXposed-YAHFA-v*-release.zip to_publish/EdXposed-YAHFA-release.zip && mv edxp-core/release/EdXposed-SandHook-v*-release.zip to_publish/EdXposed-SandHook-release.zip && echo $APPVEYOR_BUILD_NUMBER > to_publish/version -# - name: Publish build -# if: ${{ github.event_name == 'push' && success() }} -# uses: dmnemec/copy_file_to_another_repo_action@v1.0.4 -# env: -# API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} -# with: -# source_file: 'to_publish/*' -# destination_repo: 'ElderDrivers/Repository-Website' -# destination_folder: 'assets' -# user_email: 'mlgmxyysd@meowcat.org' -# user_name: 'MlgmXyysd' - - diff --git a/.github/workflows/manager.yml b/.github/workflows/manager.yml new file mode 100644 index 00000000..584b3ca6 --- /dev/null +++ b/.github/workflows/manager.yml @@ -0,0 +1,50 @@ +name: Manager + +on: + push: + paths: + - 'app/**' +# TODO: debug apk for pr +# pull_request: +# paths: +# - 'app/**' + +jobs: + build: + runs-on: ubuntu-latest + if: ${{ !startsWith(github.event.head_commit.message, '[skip ci]') }} + + steps: + - uses: actions/checkout@v2 + with: + submodules: 'recursive' + - name: set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Get version code + run: echo APPVEYOR_BUILD_NUMBER=$(expr $GITHUB_RUN_NUMBER + 4999) >> $GITHUB_ENV + - name: Build with Gradle + env: + KEYSTORE_PASS: ${{ secrets.KEYSTORE_PASS }} + ALIAS_NAME: ${{ secrets.ALIAS_NAME }} + ALIAS_PASS: ${{ secrets.ALIAS_PASS }} + run: bash ./gradlew :app:assembleRelease + - name: Sign Manager Release + if: ${{ github.event_name == 'push' && success() }} + id: sign + uses: r0adkll/sign-android-release@v1.0.4 + env: + BUILD_TOOLS_VERSION: "30.0.2" + with: + releaseDirectory: app/build/outputs/apk/release + signingKeyBase64: ${{ secrets.SIGNING_KEY }} + alias: ${{ secrets.ALIAS }} + keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} + keyPassword: ${{ secrets.KEY_PASSWORD }} + - name: Upload built apk + if: success() + uses: actions/upload-artifact@v2 + with: + name: manager + path: ${{ steps.sign.outputs.signedReleaseFile }}