39 lines
942 B
YAML
39 lines
942 B
YAML
name: Java Build and File Update
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up JDK
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'adopt' # Hier wird die fehlende Eingabe "distribution" hinzugefügt
|
|
server-id: 'github'
|
|
server-username: ${{ github.actor }}
|
|
server-password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Build Java project with Maven
|
|
run: mvn clean package
|
|
|
|
- name: Create builds directory
|
|
run: mkdir -p builds
|
|
|
|
- name: Copy built JAR file
|
|
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 push
|