Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Polishing #287
Browse files Browse the repository at this point in the history
  • Loading branch information
mp911de committed Jan 28, 2022
1 parent c29e53a commit 7828e9c
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 66 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Java CI with Maven

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ 8, 11, 17 ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: temurin
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
run: ./mvnw -B package

deploy:
if: github.repository == 'mp911de/logstash-gelf'
runs-on: ubuntu-latest
needs: [ build ]
steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: 8
distribution: temurin
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Deploy with Maven to SONATYPE OSS Snapshot if secrets are set
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
if [ "${SONATYPE_USER}" != "" -a "${SONATYPE_PASSWORD}" != "" ]; then
./mvnw -B deploy -P sonatype-oss-snapshot -s .github/settings.xml
else
echo "Not deploying, secrets SONATYPE_USER and SONATYPE_PASSWORD not provided"
fi
66 changes: 0 additions & 66 deletions .github/workflows/maven.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/pullrequests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build Pull request with Maven

on: [ pull_request ]

jobs:
pr-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-pr-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-pr-
- name: Build with Maven
run: ./mvnw -B verify -D skipITs

0 comments on commit 7828e9c

Please sign in to comment.