-
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (60 loc) · 2.01 KB
/
build.yaml
File metadata and controls
73 lines (60 loc) · 2.01 KB
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
name: Gradle Build
permissions:
contents: read
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up JDK 25
uses: actions/setup-java@v5
with:
java-version: 25
distribution: graalvm
cache: gradle
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Run setupDecompWorkspace
run: ./gradlew setupDecompWorkspace
continue-on-error: true
- name: Run generateBuildConfigClasses
run: ./gradlew generateBuildConfigClasses
continue-on-error: true
- name: Build with Gradle
run: ./gradlew build
- name: Find and export JAR filenames
id: find-jars
run: |
# Find and export main JAR
MAIN_JAR_PATH=$(find ./build/libs -name "Fancier-Block-Particles-*.jar" ! -name "*-dev.jar" | head -n 1)
if [ -z "$MAIN_JAR_PATH" ]; then echo "Main JAR not found"; exit 1; fi
MAIN_JAR_NAME=$(basename "$MAIN_JAR_PATH")
echo "main-path=$MAIN_JAR_PATH" >> $GITHUB_OUTPUT
echo "main-name=$MAIN_JAR_NAME" >> $GITHUB_OUTPUT
# Find and export dev JAR
DEV_JAR_PATH=$(find ./build/libs -name "Fancier-Block-Particles-*-dev.jar" | head -n 1)
if [ -z "$DEV_JAR_PATH" ]; then echo "Dev JAR not found"; exit 1; fi
DEV_JAR_NAME=$(basename "$DEV_JAR_PATH")
echo "dev-path=$DEV_JAR_PATH" >> $GITHUB_OUTPUT
echo "dev-name=$DEV_JAR_NAME" >> $GITHUB_OUTPUT
- name: Upload Main JAR
uses: actions/upload-artifact@v5
with:
name: ${{ steps.find-jars.outputs.main-name }}
path: ${{ steps.find-jars.outputs.main-path }}
- name: Upload Dev JAR
uses: actions/upload-artifact@v5
with:
name: ${{ steps.find-jars.outputs.dev-name }}
path: ${{ steps.find-jars.outputs.dev-path }}