Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
klzgrad committed Jan 14, 2024
1 parent 3a11ca8 commit a716d0e
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,6 @@ env:
CCACHE_MAXFILES: 0
SCCACHE_CACHE_SIZE: 200M
jobs:
apk:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: gradle/gradle-build-action@v2
- run: KEYSTORE_PASS=${{ secrets.KEYSTORE_PASS }} APK_VERSION_NAME=120.1.2.3-2 APK_ABI=arm64-v8a ./gradlew :apk:app:assembleRelease
cache-toolchains-posix:
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -174,7 +168,15 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [x64, x86, arm64, arm]
include:
- arch: x64
abi: x86_64
- arch: x86
abi: x86
- arch: arm64
abi: arm64-v8a
- arch: arm
abi: armeabi-v7a
env:
EXTRA_FLAGS: 'target_cpu="${{ matrix.arch }}" target_os="android"'
BUNDLE: naiveproxy-${{ github.event.release.tag_name }}-${{ github.job }}-${{ matrix.arch }}
Expand Down Expand Up @@ -225,20 +227,29 @@ jobs:
- run: ccache -s
- run: ./get-android-sys.sh
- run: ../tests/basic.sh out/Release/naive
- name: Pack naiveproxy assets
- name: Create APK
working-directory: apk
run: |
mkdir ${{ env.BUNDLE }}
cp out/Release/naive config.json ../LICENSE ../USAGE.txt ${{ env.BUNDLE }}
tar cJf ${{ env.BUNDLE }}.tar.xz ${{ env.BUNDLE }}
openssl sha256 out/Release/naive >sha256sum.txt
export APK_ABI=${{ matrix.abi }}
APK_VERSION_NAME=${{ github.event.release.tag_name }}
export APK_VERSION_NAME=${APK_VERSION_NAME#v}
mkdir -p app/libs/$APK_ABI
cp ../src/out/Release/naive app/libs/$APK_ABI/libnaive.so
KEYSTORE_PASS=${{ secrets.KEYSTORE_PASS }} ./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
echo "SHA256SUM=$(cut -d' ' -f2 sha256sum.txt)" >>$GITHUB_ENV
echo "APK_NAME=$APK_NAME" >>$GITHUB_ENV
- uses: actions/upload-artifact@v3
with:
name: ${{ env.BUNDLE }}.tar.xz naive executable sha256 ${{ env.SHA256SUM }}
path: src/sha256sum.txt
name: ${{ env.APK_NAME }} sha256 ${{ env.SHA256SUM }}
path: apk/sha256sum.txt
- name: Upload naiveproxy assets
if: ${{ github.event_name == 'release' }}
run: gh release upload "${GITHUB_REF##*/}" ${{ env.BUNDLE }}.tar.xz --clobber
working-directory: apk
run: gh release upload "${GITHUB_REF##*/}" ${{ env.APK_NAME }} --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
win:
Expand Down

0 comments on commit a716d0e

Please sign in to comment.