Skip to content

Build MacOS NE plugin awg/xray #275

Build MacOS NE plugin awg/xray

Build MacOS NE plugin awg/xray #275

name: android-ss
on: [push]
jobs:
Build-Libs-ShadowSocks-Android:
name: 'Build-Libs-ShadowSocks-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-shadowsocks]') ||
contains(github.event.head_commit.message, '[shadowsocks]')
steps:
- name: 'Setup Java'
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- 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: 'Setup rust'
run: |
export RUST_VERSION=1.67.0
curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain $RUST_VERSION -y
export PATH=$HOME/.cargo/bin:$PATH
rustup target add armv7-linux-androideabi aarch64-linux-android i686-linux-android x86_64-linux-android
- name: 'Setup ccache'
uses: hendrikmuhs/[email protected]
- name: 'Get sources'
uses: actions/checkout@v3
with:
submodules: 'true'
fetch-depth: 10
- name: 'Get ShadowSocks'
uses: actions/checkout@v3
with:
repository: shadowsocks/shadowsocks-android
ref: master
path: android/shadowsocks-android
- name: 'Build ShadowSocks binary'
working-directory: android/shadowsocks-android
run: |
git submodule update --init --recursive
./gradlew assembleRelease
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
name: ss-android
path: android/shadowsocks-android/core/build/intermediates/stripped_native_libs/release/out/lib/*
github-release:
name: GitHub Release
needs: Build-Libs-ShadowSocks-Android
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Artifacts
uses: actions/download-artifact@v2
- 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: ss-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true