Skip to content

Build

Build #45

Workflow file for this run

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: |
mkdir Builder/build
${{ steps.setup-jdk8.outputs.path }}/bin/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 ..
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: tree
run: |
tree out/production
- name: pack
run: ${{ steps.setup-jdk8.outputs.path }}/bin/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