-
Notifications
You must be signed in to change notification settings - Fork 2
120 lines (103 loc) · 3.86 KB
/
build.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: Build APK TEST
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.MY_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: JDK Setup
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: "Gradle Wrapper validation"
uses: gradle/wrapper-validation-action@v2
- name: "Setup Gradle"
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: 8.7
build-root-directory: systems/commons
cache-disabled: false
cache-read-only: false
cache-write-only: false
cache-overwrite-existing: false
gradle-home-cache-includes: caches notifications
gradle-home-cache-cleanup: false
add-job-summary: always
add-job-summary-as-pr-comment: never
dependency-graph: disabled
dependency-graph-continue-on-failure: true
build-scan-publish: false
generate-job-summary: true
gradle-home-cache-strict-match: false
workflow-job-context: null
- name: "Setup matchers"
run: |
# Setting up matchers...
matchers_dir='${{ github.workspace }}/.github/matchers'
matcher_list()
{
echo 'gradle-build-matcher.json'
echo 'gradle-build-kotlin-error-matcher.json'
}
matcher_list | while IFS='' read -r NAME; do
if test -f "${matchers_dir:?}/${NAME:?}"; then
echo "::add-matcher::${matchers_dir:?}/${NAME:?}"
echo "Matcher configured: ${NAME:?}"
fi
done
- name: Clone
run: |
git clone https://Blawuken:$GH_TOKEN@github.com/Blawuken/v2rayNG
- name: Build project
run: |
cd ${{ github.workspace }}/v2rayNG
./gradlew --no-daemon build
- name: Build APK RELEASE
run: |
cd ${{ github.workspace }}/v2rayNG
./gradlew assembleRelease
- name: Sign APK
run: |
echo "=============================="
ls ${{ github.workspace }}/v2rayNG/
echo "=============================="
ls ${{ github.workspace }}/v2rayNG/app/build/outputs/apk/release/
echo "=============================="
echo ""
echo ""
sudo apt-get -y install apksigner
cd ${{ github.workspace }}/v2rayNG
apksigner sign --key platform.pk8 --cert platform.x509.pem app/build/outputs/apk/release/*all.apk
apksigner sign --key platform.pk8 --cert platform.x509.pem app/build/outputs/apk/release/*arm64-v8a.apk
apksigner sign --key platform.pk8 --cert platform.x509.pem app/build/outputs/apk/release/*armeabi-v7a.apk
- name: Upload APK all variant
uses: actions/upload-artifact@v4
with:
name: all
path: ${{ github.workspace }}/v2rayNG/app/build/outputs/apk/release/*all.apk
- name: Upload APK variant arm64
uses: actions/upload-artifact@v4
with:
name: arm64
path: ${{ github.workspace }}/v2rayNG/app/build/outputs/apk/release/*arm64-v8a.apk
- name: Upload APK variant armeabi-v7a
uses: actions/upload-artifact@v4
with:
name: armeabi-v7a
path: ${{ github.workspace }}/v2rayNG/app/build/outputs/apk/release/*armeabi-v7a.apk