-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update ci configuration with newer config and java versions
- Loading branch information
Showing
3 changed files
with
83 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# 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: [ develop, 3.2.x ] | ||
pull_request: | ||
branches: [ develop, 3.2.x ] | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 5 * * 1 | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java-version: ['19', '21'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{matrix.java-version}} PR | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{matrix.java-version}} | ||
distribution: 'temurin' | ||
# Step that does that actual cache save and restore | ||
- name: Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
|
||
build-and-snapshot: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
java-version: ['17'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK ${{matrix.java-version}} PR | ||
if: github.event_name == 'pull_request' | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{matrix.java-version}} | ||
distribution: 'temurin' | ||
# Step that does that actual cache save and restore | ||
- name: Set up JDK ${{matrix.java-version}} Branch | ||
if: github.event_name != 'pull_request' | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{matrix.java-version}} | ||
distribution: 'temurin' | ||
server-id: sonatype-nexus-snapshots | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
# Step that does that actual cache save and restore | ||
- name: Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml | ||
- name: Publish Snapshot | ||
if: github.event_name != 'pull_request' | ||
run: mvn -B clean deploy -P all -DskipTests --file pom.xml | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} |