From 4e11523ab11558b47a1aaab1b71804615cf4a537 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 15 Jan 2024 18:22:41 +0800 Subject: [PATCH] test --- .github/workflows/build.yml | 26 +++++++++++--------------- apk/app/build.gradle.kts | 4 ++-- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cf898e5a99..c7d3cce974 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -179,7 +179,7 @@ jobs: abi: armeabi-v7a env: EXTRA_FLAGS: 'target_cpu="${{ matrix.arch }}" target_os="android"' - BUNDLE: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }} + BUNDLE: naiveproxy-plugin-${{ github.event.release.tag_name }}-${{ matrix.abi }}.apk steps: - uses: actions/checkout@v4 - name: Cache toolchains (Linux, OpenWrt, Android) @@ -229,32 +229,28 @@ jobs: - run: ../tests/basic.sh out/Release/naive - name: Create APK working-directory: apk - run: | + env: APK_ABI=${{ matrix.abi }} APK_VERSION_NAME=${{ github.event.release.tag_name }} - APK_VERSION_NAME=${APK_VERSION_NAME#v} + KEYSTORE_PASS=${{ secrets.KEYSTORE_PASS }} + run: | mkdir -p app/libs/$APK_ABI cp ../src/out/Release/naive app/libs/$APK_ABI/libnaive.so - env - KEYSTORE_PASS=${{ secrets.KEYSTORE_PASS }} APK_VERSION_NAME=$APK_VERSION_NAME APK_ABI=$APK_ABI ./gradlew :apk:app:assembleRelease - - APK_NAME=naiveproxy-plugin-$APK_VERSION_NAME-$APK_ABI.apk - mv app/build/outputs/apk/release/$APK_NAME . - openssl sha256 $APK_NAME >sha256sum.txt + ./gradlew :app:assembleRelease + openssl sha256 app/build/outputs/apk/release/${{ env.BUNDLE }} >sha256sum.txt echo "SHA256SUM=$(cut -d' ' -f2 sha256sum.txt)" >>$GITHUB_ENV - echo "APK_NAME=$APK_NAME" >>$GITHUB_ENV - uses: actions/upload-artifact@v3 with: - name: ${{ env.APK_NAME }} sha256 ${{ env.SHA256SUM }} + name: ${{ env.BUNDLE }} sha256 ${{ env.SHA256SUM }} path: apk/sha256sum.txt - uses: actions/upload-artifact@v3 with: - name: ${{ env.APK_NAME }} - path: apk/${{ env.APK_NAME }} + name: ${{ env.BUNDLE }} + path: apk/app/build/outputs/apk/release/${{ env.BUNDLE }} - name: Upload naiveproxy assets if: ${{ github.event_name == 'release' }} - working-directory: apk - run: gh release upload "${GITHUB_REF##*/}" ${{ env.APK_NAME }} --clobber + working-directory: apk/app/build/outputs/apk/release + run: gh release upload "${GITHUB_REF##*/}" ${{ env.BUNDLE }} --clobber env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} win: diff --git a/apk/app/build.gradle.kts b/apk/app/build.gradle.kts index 1aa0cdfa0f..0d845857e6 100644 --- a/apk/app/build.gradle.kts +++ b/apk/app/build.gradle.kts @@ -33,8 +33,8 @@ android { targetSdk = 33 applicationId = "moe.matsuri.exe.naive" - versionCode = System.getenv("APK_VERSION_NAME").split(".")[0].toInt() - versionName = System.getenv("APK_VERSION_NAME") + versionCode = System.getenv("APK_VERSION_NAME").removePrefix("v").split(".")[0].toInt() + versionName = System.getenv("APK_VERSION_NAME").removePrefix("v") splits.abi { isEnable = true isUniversalApk = false