-
Notifications
You must be signed in to change notification settings - Fork 5
99 lines (79 loc) · 3.05 KB
/
build_ss_android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
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