Skip to content

Refactor Android AWG build script (#1) #55

Refactor Android AWG build script (#1)

Refactor Android AWG build script (#1) #55

name: android-awg
on: [push]
jobs:
Build-Libs-AWG-Android:
name: 'Build-Libs-AWG-Android'
runs-on: ubuntu-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[android]') ||
contains(github.event.head_commit.message, '[android-awg]') ||
contains(github.event.head_commit.message, '[awg]')
steps:
- name: 'Setup Java'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: 'Setup Android NDK'
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: 'r26b'
- name: 'Get sources'
uses: actions/checkout@v4
- name: 'Get AmneziaWG'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-android
ref: master
path: android/amneziawg-android
submodules: true
- name: 'Build AmneziaWG binary'
working-directory: android/amneziawg-android
run: ./gradlew :tunnel:stripReleaseDebugSymbols
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-android
path: android/amneziawg-android/tunnel/build/intermediates/stripped_native_libs/release/out/lib/*
github-release:
name: GitHub Release
needs: Build-Libs-AWG-Android
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup | Checkout
uses: actions/checkout@v4
- name: Setup | Artifacts
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
- name: Zip ALL
run: for file in *; do zip -r ${file%.*}.zip $file; done
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: awg-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true