-
Notifications
You must be signed in to change notification settings - Fork 16
66 lines (61 loc) · 2.5 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
name: Build
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setting up JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
id: setup-jdk8
- name: Setting up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
id: setup-jdk17
- name: Grant permissions
run: |
sudo chmod -R 777 Builder/
sudo chmod -R 777 ${{ steps.setup-jdk8.outputs.path }}/bin/java
sudo chmod -R 777 ${{ steps.setup-jdk17.outputs.path }}/bin/java
- name: build Builder
run: |
sudo mkdir Builder/build
sudo javac -cp "Builder/libs/asm-9.7.jar:Builder/libs/asm-analysis-9.7.jar:Builder/libs/asm-commons-9.7.jar:Builder/libs/asm-tree-9.7.jar:Builder/libs/asm-util-9.7.jar:Builder/libs/proguard.jar" -d Builder/build Builder/src/cn/yapeteam/builder/Builder.java Builder/src/cn/yapeteam/builder/OS.java Builder/src/cn/yapeteam/builder/Compiler.java Builder/src/cn/yapeteam/builder/Terminal.java Builder/src/cn/yapeteam/builder/ProcessBar.java Builder/src/cn/yapeteam/builder/SSLUtils.java
mkdir temp_dir
cd temp_dir
for jarfile in ../Builder/libs/*.jar; do
sudo jar xf "$jarfile"
done
cd ..
sudo jar cvfm builder.jar Builder/src/META-INF/MANIFEST.MF -C Builder/build/ . -C temp_dir/ .
- name: build deps
run: ${{ steps.setup-jdk8.outputs.path }}/bin/java -jar builder.jar release deps
- name: build 1.8.9
run: ${{ steps.setup-jdk8.outputs.path }}/bin/java -jar builder.jar release 1.8.9
- name: build 1.12.2
run: ${{ steps.setup-jdk8.outputs.path }}/bin/java -jar builder.jar release 1.12.2
- name: build 1.18.1
run: ${{ steps.setup-jdk17.outputs.path }}/bin/java -jar builder.jar release 1.18.1
- name: pack
run: sudo java -jar builder.jar release
- name: Upload JAR to Release
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/injector.jar
asset_name: injector.jar
asset_content_type: application/java-archive