44 lines
995 B
YAML
44 lines
995 B
YAML
name: Java CI with Maven and Release
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: maven
|
|
|
|
- name: Build with Maven
|
|
run: mvn -B package --file pom.xml
|
|
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Build & test
|
|
run: echo "done!"
|
|
|
|
- name: Create Release
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
prerelease: false
|
|
files: |
|
|
LICENSE.txt
|
|
*.jar
|
|
# Setzen Sie einen statischen Tag oder generieren Sie einen dynamischen Tag
|
|
automatic_release_tag: "release-$(date +'%Y%m%d%H%M%S')"
|