name: Android CI on: push: branches: [ main ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' distribution: 'adopt' cache: gradle - uses: actions/cache@v2 with: path: | ~/.gradle/caches ~/.gradle/wrapper !~/.gradle/caches/build-cache-* key: gradle-deps-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} restore-keys: gradle-deps - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Create key file run: echo -n "${{ secrets.SIGNING_KEY }}" | base64 -d > signingKey.jks - name: Build with Gradle run: | bash ./gradlew assembleRelease - name: Sign Release APK if: success() id: sign_release uses: r0adkll/sign-android-release@v1.0.4 with: releaseDirectory: ./app/build/outputs/apk/release signingKeyBase64: ${{ secrets.SIGNING_KEY }} alias: key0 keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} keyPassword: ${{ secrets.KEY_STORE_PASSWORD }} - name: Download Genshin if: success() id: download_genshin run: | wget https://projecta-common-1258344701.cos.ap-singapore.myqcloud.com/apkpure_upload_20220331/genshin-impact.apk - name: Lspatch if: success() id: lspatch run: | java -jar lspatch.jar genshin-impact.apk -m ${{ steps.sign_release.outputs.signedReleaseFile }} -k ./app/build/outputs/apk/release/signingKey.jks ${{ secrets.KEY_STORE_PASSWORD }} key0 ${{ secrets.KEY_STORE_PASSWORD }} - name: Upload Release APK uses: actions/upload-artifact@v2 with: name: GenshinProxy_release path: ${{ steps.sign_release.outputs.signedReleaseFile }} - name: Upload Lspatch APK uses: actions/upload-artifact@v2 with: name: GenshinProxy_release_lspatch path: ./genshin-impact-lv0-lspatched.apk