Update maven.yml
This commit is contained in:
parent
76fc98dc0b
commit
13dce4720b
1 changed files with 10 additions and 3 deletions
13
.github/workflows/maven.yml
vendored
13
.github/workflows/maven.yml
vendored
|
@ -17,7 +17,7 @@ jobs:
|
||||||
uses: actions/setup-java@v2
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
distribution: 'adopt' # Hier wird die fehlende Eingabe "distribution" hinzugefügt
|
distribution: 'adopt'
|
||||||
server-id: 'github'
|
server-id: 'github'
|
||||||
server-username: ${{ github.actor }}
|
server-username: ${{ github.actor }}
|
||||||
server-password: ${{ secrets.GITHUB_TOKEN }}
|
server-password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -25,15 +25,22 @@ jobs:
|
||||||
- name: Build Java project with Maven
|
- name: Build Java project with Maven
|
||||||
run: mvn clean package
|
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
|
- name: Create builds directory
|
||||||
run: mkdir -p builds
|
run: mkdir -p builds
|
||||||
|
|
||||||
- name: Copy built JAR file
|
- name: Copy built JAR files
|
||||||
run: cp -r target/*.jar builds/
|
run: cp -r target/*.jar builds/
|
||||||
|
|
||||||
- name: Update version.txt
|
- name: Update version.txt
|
||||||
run: |
|
run: |
|
||||||
sed -i 's/old_text/new_text/g' ver/version.txt
|
sed -i 's/old_text/new_text/g' ver/version.txt
|
||||||
git add ver/version.txt builds/*.jar
|
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
|
git push
|
||||||
|
|
Loading…
Reference in a new issue