-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
124 lines (110 loc) · 3.76 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
121
122
123
124
name: CI
on:
push:
branches:
- master
pull_request:
paths:
- '**.java'
- '**.kts'
- 'brut.apktool/apktool-lib/src/main/resources/**'
- 'brut.apktool/apktool-lib/src/test/**'
- '.github/workflows/**'
- 'gradle/libs.versions.toml'
- 'gradle/wrapper/**'
- 'gradlew'
- 'gradlew.bat'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
BINARY_PATH: brut.apktool/apktool-lib/src/main/resources/prebuilt
jobs:
analyze-mac-aapt:
runs-on: macos-latest
strategy:
matrix:
file: [ aapt_64, aapt2_64 ]
steps:
- uses: actions/checkout@v4
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} version
- name: Output Static
run: otool -L ${{ env.BINARY_PATH }}/macosx/${{ matrix.file }} || true
analyze-linux-aapt:
runs-on: ubuntu-latest
strategy:
matrix:
file: [ aapt, aapt_64, aapt2, aapt2_64 ]
steps:
- uses: actions/checkout@v4
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} version
- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/linux/${{ matrix.file }} || true
analyze-windows-aapt:
runs-on: windows-latest
strategy:
matrix:
file: [ aapt.exe, aapt_64.exe, aapt2.exe, aapt2_64.exe ]
steps:
- uses: actions/checkout@v4
- name: Verify Executable
run: ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} version
- name: Output Static
run: ldd ${{ env.BINARY_PATH }}/windows/${{ matrix.file }} || true
build-and-test-with-Java-8-and-later:
runs-on: ${{ matrix.os }}
needs:
- analyze-mac-aapt
- analyze-linux-aapt
- analyze-windows-aapt
name: Build/Test (JDK ${{ matrix.java }}, ${{ matrix.os }})
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
java: [ 8, 11, 17, 21 ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: ${{ matrix.java }}
- uses: gradle/actions/setup-gradle@v3.3.2
- name: Build (Linux/Mac)
if: runner.os != 'Windows'
run: ./gradlew build shadowJar proguard
- name: Build (Windows)
if: runner.os == 'Windows'
run: ./gradlew.bat build shadowJar proguard
upload-artifact:
runs-on: ubuntu-latest
name: Build apktool.jar
if: github.repository == 'iBotPeaches/Apktool' && github.ref == 'refs/heads/master'
needs:
- build-and-test-with-Java-8-and-later
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- uses: gradle/actions/setup-gradle@v3.3.2
with:
dependency-graph: generate-and-submit
- name: Build (Linux/Mac)
if: runner.os != 'Windows'
run: ./gradlew build shadowJar proguard
- name: Build (Windows)
if: runner.os == 'Windows'
run: ./gradlew.bat build shadowJar proguard
- name: Upload
uses: actions/upload-artifact@v4
with:
name: apktool.jar
path: brut.apktool/apktool-cli/build/libs/apktool-v*
# The level of compression for Zlib to be applied to the artifact archive. The value can range from 0 to 9: - 0: No compression - 1: Best speed - 6: Default compression (same as GNU Gzip) - 9: Best compression Higher levels will result in better compression, but will take longer to complete. For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
compression-level: 9