diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index fe5abc9..411c08f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -17,7 +17,7 @@ jobs: uses: actions/setup-java@v2 with: java-version: '17' - distribution: 'adopt' # Hier wird die fehlende Eingabe "distribution" hinzugefügt + distribution: 'adopt' server-id: 'github' server-username: ${{ github.actor }} server-password: ${{ secrets.GITHUB_TOKEN }} @@ -25,15 +25,22 @@ jobs: - name: Build Java project with Maven run: mvn clean package + - name: Check if JAR files exist + run: | + if [ ! -d "target" ] || [ -z "$(ls -A target/*.jar)" ]; then + echo "No JAR files found in target directory or target directory does not exist." + exit 1 + fi + - name: Create builds directory run: mkdir -p builds - - name: Copy built JAR file + - name: Copy built JAR files run: cp -r target/*.jar builds/ - name: Update version.txt run: | sed -i 's/old_text/new_text/g' ver/version.txt git add ver/version.txt builds/*.jar - git commit -m "Updated version and built JAR file" + git commit -m "Updated version and built JAR files" git push