Skip to content

Commit 4a22ac0

Browse files
authored
Create maven-publish.yml
1 parent 0030b62 commit 4a22ac0

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Auto Build Plugin
2+
3+
on:
4+
push:
5+
branches: [ "main", "beta" ] # Chạy khi push code vào nhánh main hoặc master
6+
pull_request:
7+
branches: [ "alpha", "beta", "main" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Set up JDK 21 (Hoặc đổi số này theo version Java plugin bạn cần)
18+
uses: actions/setup-java@v4
19+
with:
20+
java-version: '17' # Minecraft 1.20.5+ cần Java 21, 1.18+ cần Java 17
21+
distribution: 'temurin'
22+
cache: maven
23+
24+
- name: Build with Maven
25+
run: mvn -B package --file pom.xml # Lệnh build chính
26+
27+
# BƯỚC QUAN TRỌNG NHẤT: Lưu file .jar lại để bạn tải về
28+
- name: Upload Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: My-Plugin-Jar
32+
path: target/*.jar # Đường dẫn file sau khi Maven build xong

0 commit comments

Comments
 (0)