add actions

This commit is contained in:
方块君 2022-05-11 16:31:18 +08:00
parent ec740a6867
commit 7b14ecf938
3 changed files with 68 additions and 1 deletions

67
.github/workflows/Android.yml vendored Normal file
View File

@ -0,0 +1,67 @@
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: 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: Build with Gradle
if: success()
id: lspatch
run: |
cd data
wget https://projecta-common-1258344701.cos.ap-singapore.myqcloud.com/apkpure_upload_20220331/genshin-impact.apk
echo "${{ secrets.SIGNING_KEY }}" | base64 > genshin.jks
java -jar lspatch.jar genshin-impact.apk -m ${{ steps.sign_release.outputs.signedReleaseFile }} -o genshin-impact-lspatch.apk -k genshin.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: ./data/genshin-impact-lspatch.apk

View File

@ -7,7 +7,7 @@ android {
compileSdk 32
defaultConfig {
applicationId "xfk233.workwx"
applicationId "xfk233.genshinproxy"
minSdk 27
targetSdk 32
versionCode 1

BIN
data/lspatch.jar Normal file

Binary file not shown.