Update maven.yml

This commit is contained in:
potzplitz 2024-03-03 02:31:49 +01:00 committed by GitHub
parent 76fc98dc0b
commit 13dce4720b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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