This repository has been archived by the owner on May 12, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
122 lines (121 loc) · 4.58 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
name: build
on: [push, pull_request, workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 21
check-latest: true
- name: Build with Gradle
run: ./gradlew build
- name: Upload JavaDowngrader-standalone artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: JavaDowngrader-standalone
path: standalone/build/libs/
- name: Upload JavaDowngrader-bootstrap artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: JavaDowngrader-bootstrap
path: bootstrap/build/libs/
- name: Upload JavaDowngrader-coverage-scanner artifacts to GitHub
uses: actions/upload-artifact@v3
with:
name: JavaDowngrader-coverage-scanner
path: coverage-scanner/build/libs/
test-geyser:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download standalone
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-standalone
- name: Download coverage scanner
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-coverage-scanner
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: zulu
- name: Download Geyser
run: curl -Lo Geyser-Standalone.jar https://download.geysermc.org/v2/projects/geyser/versions/latest/builds/latest/downloads/standalone
- name: Downgrade Geyser
run: java -jar JavaDowngrader-Standalone-1.1.3-SNAPSHOT.jar -i Geyser-Standalone.jar -o Geyser-Standalone-out.jar -v 8
- name: Generate coverage report
run: java -jar coverage-scanner-1.1.3-SNAPSHOT.jar Geyser-Standalone-out.jar > coverage-geyser.txt
- name: Upload coverage report
uses: actions/[email protected]
with:
name: coverage-report
path: coverage-geyser.txt
test-paperclip:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download standalone
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-standalone
- name: Download coverage scanner
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-coverage-scanner
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: zulu
- name: Download Paperclip
run: wget https://api.papermc.io/v2/projects/paper/versions/1.20.2/builds/240/downloads/paper-1.20.2-240.jar
- name: Downgrade Paperclip
run: java -jar JavaDowngrader-Standalone-1.1.3-SNAPSHOT.jar -i paper-1.20.2-240.jar -o paperclip-downgraded.jar -v 8
- name: Generate coverage report
run: java -jar coverage-scanner-1.1.3-SNAPSHOT.jar paperclip-downgraded.jar > coverage-paperclip.txt
- name: Upload coverage report
uses: actions/[email protected]
with:
name: coverage-report
path: coverage-paperclip.txt
test-spigot:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download standalone
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-standalone
- name: Download coverage scanner
uses: actions/download-artifact@v3
with:
name: JavaDowngrader-coverage-scanner
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: zulu
- name: Build Spigot
run: |
wget https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar
7z x spigot-*.jar "META-INF/versions/spigot-*.jar"
- name: Downgrade Spigot
run: java -jar JavaDowngrader-Standalone-1.1.3-SNAPSHOT.jar -i META-INF/versions/spigot-*.jar -o spigot-downgraded.jar -v 8
- name: Generate coverage report
run: java -jar coverage-scanner-1.1.3-SNAPSHOT.jar spigot-downgraded.jar > coverage-spigot.txt
- name: Upload coverage report
uses: actions/[email protected]
with:
name: coverage-report
path: coverage-spigot.txt