-
Notifications
You must be signed in to change notification settings - Fork 6
79 lines (62 loc) · 1.95 KB
/
build_xray_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
name: android-xray
on: [push]
jobs:
Build-Libs-XRay-Android:
name: 'Build-Libs-XRay-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-xray]') ||
contains(github.event.head_commit.message, '[xray]')
env:
JAVA_VERSION: '17'
ANDROID_NDK_VERSION: 'r26b'
steps:
- name: 'Setup Java'
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: ${{ env.JAVA_VERSION }}
- name: 'Setup Android NDK'
uses: nttld/setup-ndk@v1
with:
ndk-version: ${{ env.ANDROID_NDK_VERSION }}
- name: 'Get Amnezia-libxray'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amnezia-libxray
ref: main
- name: 'Setup Go'
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: 'Build libxray binary'
run: ./build.sh
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: libxray-android
path: libxray.aar
github-release:
name: GitHub Release
needs: Build-Libs-XRay-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 '*.aar' ); 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: libxray-android.zip
tag: ${{ github.ref }}
overwrite: true
file_glob: true