Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
klzgrad committed Jan 15, 2024
1 parent b3580bb commit 4e11523
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions apk/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4e11523

Please sign in to comment.