2022-11-22 09:16:08 +00:00
|
|
|
name: Android CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "master" ]
|
|
|
|
pull_request:
|
|
|
|
branches: [ "master" ]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2022-11-23 02:03:50 +00:00
|
|
|
build:
|
2022-11-22 09:16:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK 11
|
|
|
|
uses: actions/setup-java@v3
|
|
|
|
with:
|
|
|
|
java-version: '11'
|
|
|
|
distribution: 'temurin'
|
|
|
|
cache: gradle
|
|
|
|
- name: Grant execute permission for gradlew
|
|
|
|
run: chmod +x gradlew
|
|
|
|
- name: Build with Gradle
|
|
|
|
run: ./gradlew assembleRelease
|
2022-11-22 09:26:19 +00:00
|
|
|
- run: sudo apt-get install -y jq
|
2022-11-22 09:16:08 +00:00
|
|
|
- name: Download package
|
|
|
|
run: "curl -H 'x-rpc-client_type: 2' -H 'x-rpc-app_version: 2.37.1' -H 'x-rpc-channel: miyousheluodi' https://api-takumi.mihoyo.com/ptolemaios/api/getLatestRelease | jq --raw-output '.data.package_url' | xargs curl -o origin.apk"
|
|
|
|
- name: Patch package
|
2022-11-23 02:03:50 +00:00
|
|
|
run: "java -jar gradle/lspatch/jar-v0.5.1-361-release.jar -f -l 2 -m app/build/outputs/apk/release/app-release.apk -o pout origin.apk"
|
2022-11-22 09:16:08 +00:00
|
|
|
- name: Upload build artifacts
|
2022-11-22 09:26:19 +00:00
|
|
|
uses: actions/upload-artifact@v3.1.0
|
2022-11-22 09:16:08 +00:00
|
|
|
with:
|
|
|
|
name: Artifacts
|
|
|
|
path: app/build/outputs/apk/release/app-release-unsigned.apk
|
|
|
|
- name: Upload patched package
|
2022-11-22 09:26:19 +00:00
|
|
|
uses: actions/upload-artifact@v3.1.0
|
2022-11-22 09:16:08 +00:00
|
|
|
with:
|
|
|
|
name: Artifacts
|
|
|
|
path: pout
|