Skip to content

Commit f15f5ca

Browse files
authored
Add GitHub Actions workflow for Gradle build
1 parent 906e24f commit f15f5ca

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up JDK 21
16+
uses: actions/setup-java@v4
17+
with:
18+
distribution: temurin
19+
java-version: "21"
20+
cache: gradle
21+
22+
- name: Make Gradle wrapper executable
23+
run: chmod +x ./gradlew
24+
25+
- name: Build shadowJar
26+
run: ./gradlew shadowJar
27+
28+
- name: Determine jar name
29+
id: jar
30+
shell: bash
31+
run: |
32+
JAR_PATH="$(ls -1 build/libs/*-all.jar | head -n 1)"
33+
JAR_FILE="$(basename "$JAR_PATH")"
34+
echo "path=$JAR_PATH" >> "$GITHUB_OUTPUT"
35+
echo "name=$JAR_FILE" >> "$GITHUB_OUTPUT"
36+
37+
- name: Upload artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: ${{ steps.jar.outputs.name }}
41+
path: ${{ steps.jar.outputs.path }}
42+
if-no-files-found: error

0 commit comments

Comments
 (0)