Skip to content

Commit cae094e

Browse files
authored
Create build.yml
1 parent 96a7718 commit cae094e

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Build and Upload JDA Bot
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
# 1. Checkout Repository
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
# 2. Setup Java
19+
- name: Setup Java
20+
uses: actions/setup-java@v4
21+
with:
22+
distribution: temurin
23+
java-version: 21
24+
25+
# 3. Cache Gradle
26+
- name: Cache Gradle
27+
uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
33+
restore-keys: |
34+
${{ runner.os }}-gradle-
35+
36+
# 4. Build ShadowJar
37+
- name: Build with Gradle ShadowJar
38+
run: ./gradlew shadowJar
39+
40+
# 5. Upload Artifact
41+
- name: Upload Bot JAR
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: jda-bot-jar
45+
path: build/libs/*-all.jar

0 commit comments

Comments
 (0)