Skip to content

Commit

Permalink
Refactor android awg build script
Browse files Browse the repository at this point in the history
[awg]
  • Loading branch information
albexk committed Feb 12, 2024
1 parent 2b536c3 commit fe09248
Showing 1 changed file with 23 additions and 44 deletions.
67 changes: 23 additions & 44 deletions .github/workflows/build_awg_android.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: android-awg

on: [push]


jobs:

Expand All @@ -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/[email protected]

- 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
Expand All @@ -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
Expand All @@ -95,5 +75,4 @@ jobs:
file: awg-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true

file_glob: true

0 comments on commit fe09248

Please sign in to comment.