|
1 | | -name: Build Plugin |
| 1 | +name: Build Whisper of Cosmos |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: [ main, master ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main, master ] |
| 8 | + workflow_dispatch: |
8 | 9 |
|
9 | 10 | jobs: |
10 | 11 | build: |
11 | 12 | runs-on: ubuntu-latest |
| 13 | + |
12 | 14 | steps: |
13 | | - - name: 📥 Checkout repository |
14 | | - uses: actions/checkout@v4 |
15 | | - |
16 | | - - name: ☕ Set up JDK 21 |
17 | | - uses: actions/setup-java@v4 |
18 | | - with: |
19 | | - java-version: '21' |
20 | | - distribution: 'temurin' |
21 | | - cache: 'maven' |
22 | | - |
23 | | - - name: 🏗️ Build with Maven |
24 | | - run: mvn clean package |
25 | | - |
26 | | - - name: 📦 Upload JAR artifact |
27 | | - uses: actions/upload-artifact@v4 |
28 | | - with: |
29 | | - name: AuthTelegram |
30 | | - path: target/*.jar |
31 | | - retention-days: 7 |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + |
| 17 | + - name: Set up JDK 21 |
| 18 | + uses: actions/setup-java@v4 |
| 19 | + with: |
| 20 | + java-version: '21' |
| 21 | + distribution: 'temurin' |
| 22 | + |
| 23 | + - name: Cache Maven dependencies |
| 24 | + uses: actions/cache@v4 |
| 25 | + with: |
| 26 | + path: ~/.m2 |
| 27 | + key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| 28 | + restore-keys: | |
| 29 | + ${{ runner.os }}-m2- |
| 30 | + |
| 31 | + - name: Build with Maven |
| 32 | + run: mvn clean package --file pom.xml |
| 33 | + |
| 34 | + - name: Upload JAR artifact |
| 35 | + uses: actions/upload-artifact@v4 |
| 36 | + with: |
| 37 | + name: WhisperOfCosmos-1.21.10 |
| 38 | + path: target/*.jar |
| 39 | + retention-days: 7 |
| 40 | + if-no-files-found: error |
| 41 | + |
| 42 | + - name: Display success message |
| 43 | + if: success() |
| 44 | + run: | |
| 45 | + echo "✅ Сборка успешно завершена!" |
| 46 | + echo "📦 JAR файл доступен в разделе Artifacts" |
| 47 | + find target -name "*.jar" -exec echo "Файл: {}" \; |
0 commit comments