forked from MarvionKirito/altoclef
-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (54 loc) · 1.79 KB
/
gradle.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: Java CI with Gradle
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
env:
LATEST_VERSION: "1.21"
INCLUDE_DEVLIBS: "true"
# Warning: Don't add too many versions because it takes a lot of space in the artifacts,
# and I've gotten an email from GitHub about it so please just don't.
VERSIONS_TO_BUILD: "1.16.5 1.17.1 1.18.2 1.20.4 1.21"
steps:
- uses: actions/checkout@v2
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: '21'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Create versions directory and mainProject
run: |
mkdir -p ./versions
if [ ! -f ./versions/mainProject ]; then
echo $LATEST_VERSION > ./versions/mainProject
fi
- name: Build with Gradle
run: ./gradlew build
- name: Create artifact directory structure
run: |
mkdir -p artifacts
for version in $VERSIONS_TO_BUILD; do
mkdir -p artifacts/$version/libs
cp ./versions/$version/build/libs/*.jar artifacts/$version/libs/
if [ "$INCLUDE_DEVLIBS" = "true" ]; then
mkdir -p artifacts/$version/devlibs
cp ./versions/$version/build/devlibs/*.jar artifacts/$version/devlibs/
fi
done
- name: Compute hashes
run: |
touch artifacts/hashes.txt
for jar in $(find artifacts -name '*.jar'); do
sha256sum $jar >> artifacts/hashes.txt
done
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: artifacts