From fe0924892ce6088f18b92abc95c9c9d8579131ac Mon Sep 17 00:00:00 2001 From: albexk Date: Mon, 12 Feb 2024 13:15:01 +0300 Subject: [PATCH] Refactor android awg build script [awg] --- .github/workflows/build_awg_android.yml | 67 +++++++++---------------- 1 file changed, 23 insertions(+), 44 deletions(-) diff --git a/.github/workflows/build_awg_android.yml b/.github/workflows/build_awg_android.yml index 63bc6e5..910ee08 100644 --- a/.github/workflows/build_awg_android.yml +++ b/.github/workflows/build_awg_android.yml @@ -1,7 +1,7 @@ name: android-awg on: [push] - + jobs: @@ -15,59 +15,39 @@ jobs: contains(github.event.head_commit.message, '[awg]') steps: - + - name: 'Setup Java' - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' - - name: 'Setup Android' - run: | - export NDK_VERSION=23c - export ANDROID_NDK_PLATFORM=android-23 - export ANDROID_NDK_HOME=${{ runner.temp }}/android-ndk-r${NDK_VERSION} - export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME - export ANDROID_CURRENT_ARCH=${{ matrix.arch }} - - if [ ! -f $ANDROID_NDK_ROOT/ndk-build ]; then - wget https://dl.google.com/android/repository/android-ndk-r${NDK_VERSION}-linux.zip -qO ${{ runner.temp }}/ndk.zip && - unzip -q -d ${{ runner.temp }} ${{ runner.temp }}/ndk.zip ; - fi - - - name: 'Install GO' - uses: actions/setup-go@v2 + - name: 'Setup Android NDK' + id: setup-ndk + uses: nttld/setup-ndk@v1 with: - go-version: 1.20.3 + ndk-version: 'r26b' - - name: 'Setup ccache' - uses: hendrikmuhs/ccache-action@v1.2 - - name: 'Get sources' - uses: actions/checkout@v3 - with: - submodules: 'true' - fetch-depth: 10 - - - name: 'Get Wireguard' - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: 'Get AmneziaWG' + uses: actions/checkout@v4 with: repository: amnezia-vpn/amneziawg-android - ref: master - path: android/wireguard-android + ref: fix/android + path: android/amneziawg-android + submodules: true - - name: 'Build Wireguard binary' - working-directory: android/wireguard-android - run: | - git submodule update --init --recursive - echo "y" | /usr/local/lib/android/sdk/cmdline-tools/latest/bin/sdkmanager "build-tools;34.0.0-rc3" - ./gradlew assembleRelease + - name: 'Build AmneziaWG binary' + working-directory: android/amneziawg-android + run: ./gradlew :tunnel:stripReleaseDebugSymbols - name: Archive artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: wg-android - path: android/wireguard-android/tunnel/build/intermediates/stripped_native_libs/release/out/lib/* + name: awg-android + path: android/amneziawg-android/tunnel/build/intermediates/stripped_native_libs/release/out/lib/* github-release: name: GitHub Release @@ -77,10 +57,10 @@ jobs: steps: - name: Setup | Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup | Artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Setup | Checksums run: for file in $(find ./ -name '*.so' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done @@ -95,5 +75,4 @@ jobs: file: awg-android.zip tag: ${{ github.ref }} overwrite: true - file_glob: true - + file_glob: true