Skip to content

Commit 0f0b9d5

Browse files
committed
feat: update GitHub Actions workflow for continuous integration
1 parent c80b44a commit 0f0b9d5

1 file changed

Lines changed: 31 additions & 38 deletions

File tree

.github/workflows/build.yml

Lines changed: 31 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,42 @@
1-
name: Build and Attach Plugin to Release
1+
name: Build
22

33
on:
4-
release:
5-
types: [published]
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
68

79
jobs:
8-
build-and-upload:
10+
build:
911
runs-on: ubuntu-latest
10-
11-
permissions:
12-
contents: write
13-
12+
1413
steps:
15-
- name: Checkout code
14+
- name: Checkout
1615
uses: actions/checkout@v4
17-
18-
- name: Set up JDK 21
16+
17+
- name: Validate Gradle Wrapper
18+
uses: gradle/wrapper-validation-action@v2
19+
20+
- name: Set up Java 21
1921
uses: actions/setup-java@v4
2022
with:
21-
distribution: 'corretto'
23+
distribution: temurin
2224
java-version: '21'
23-
24-
- name: Grant execute permission for gradlew
25-
run: chmod +x gradlew
26-
27-
- name: Build with Gradle
28-
run: ./gradlew clean build --full-stacktrace
29-
30-
- name: Rename JAR to release
31-
run: |
32-
cd build/libs
33-
# Finde die Haupt-JAR (nicht -sources oder -javadoc)
34-
ORIGINAL_JAR=$(ls *.jar | grep -v sources | grep -v javadoc | head -n 1)
35-
if [ -z "$ORIGINAL_JAR" ]; then
36-
echo "Error: No JAR file found!"
37-
exit 1
38-
fi
39-
# Erstelle release.jar
40-
cp "$ORIGINAL_JAR" DevSystem-release.jar
41-
echo "Created DevSystem-release.jar from $ORIGINAL_JAR"
42-
ls -lah
43-
44-
- name: Upload release asset
45-
uses: softprops/action-gh-release@v1
25+
26+
- name: Setup Gradle
27+
uses: gradle/actions/setup-gradle@v4
28+
29+
- name: Make Gradle Wrapper Executable
30+
run: chmod +x ./gradlew
31+
32+
- name: Build
33+
run: ./gradlew build --no-daemon
34+
35+
- name: Upload build artifacts (JARs)
36+
if: success()
37+
uses: actions/upload-artifact@v4
4638
with:
47-
files: build/libs/DevSystem-release.jar
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
name: DevSystem-build
40+
path: |
41+
build/libs/*.jar
42+
if-no-files-found: warn

0 commit comments

Comments
 (0)