Skip to content

Commit 710a4ef

Browse files
committed
try cicd
1 parent 54b62d6 commit 710a4ef

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
classifier: [windows-x86_64, linux-x86_64, linux-aarch64, macos-x86_64, macos-aarch64]
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Set up JDK 25
19+
uses: actions/setup-java@v4
20+
with:
21+
java-version: '25'
22+
distribution: 'temurin'
23+
24+
- name: Replace classifier in build.gradle
25+
run: sed -i 's/windows-x86_64/${{ matrix.classifier }}/g' build.gradle
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Build with Gradle
31+
run: ./gradlew build
32+
33+
- name: Rename output JAR
34+
run: for file in build/libs/*.jar; do if [[ "$file" != *"-sources.jar" && "$file" != *"-api.jar" && "$file" != *"-dev.jar" ]]; then mv "$file" "${file%.jar}-${{ matrix.classifier }}.jar"; fi; done
35+
36+
- name: Upload Artifact
37+
uses: actions/upload-artifact@v4
38+
with:
39+
name: mod-${{ matrix.classifier }}
40+
path: build/libs/*-${{ matrix.classifier }}.jar

0 commit comments

Comments
 (0)