Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tah latest Maven version for builds, JDK 17 for deploy #40

Merged
merged 1 commit into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ permissions: {}

on:
workflow_call:
inputs:
maven-version:
description: 'The Maven version used during build job'
required: false
default: '3.9.6'
type: string

jdk-version:
description: 'jdk version for build'
required: false
default: '17'
type: string

jdk-distribution:
description: 'jdk distribution for build'
required: false
default: 'temurin'
type: string

# allow single build
concurrency:
Expand Down Expand Up @@ -32,15 +50,18 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
java-version: ${{ inputs.jdk-version }}
distribution: ${{ inputs.jdk-distribution }}
cache: 'maven'
server-id: plexus-snapshots
server-username: MAVEN_DEPLOY_UID
server-password: MAVEN_DEPLOY_PWD

- name: Set up Maven
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"

- name: Publish Snapshot
run: mvn -e -B -V deploy -DskipTests
run: ./mvnw -e -B -V deploy -DskipTests
env:
MAVEN_DEPLOY_UID: ${{ secrets.MAVEN_DEPLOY_UID }}
MAVEN_DEPLOY_PWD: ${{ secrets.MAVEN_DEPLOY_PWD }}
49 changes: 32 additions & 17 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ on:
workflow_call:
inputs:
maven_args:
description: The arguments to pass to Maven when building the code
description: 'The arguments to pass to Maven when building the code'
required: false
default: --batch-mode --errors --show-version verify javadoc:javadoc
default: '--batch-mode --errors --show-version verify javadoc:javadoc'
type: string

maven-version:
description: 'The Maven version used during build job'
required: false
default: '3.9.6'
type: string

os-matrix:
Expand Down Expand Up @@ -51,19 +57,19 @@ on:
type: string

jdk-distribution-matrix:
description: "jdk distribution matrix"
description: 'jdk distribution matrix'
required: false
default: '[ "temurin" ]'
type: string

jdk-fast-fail-build:
description: "jdk fast fail build"
description: 'jdk fast fail build'
required: false
default: '17'
type: string

jdk-distribution-fast-fail-build:
description: "jdk distribution fast fail build"
description: 'jdk distribution fast fail build'
required: false
default: 'temurin'
type: string
Expand All @@ -84,8 +90,11 @@ jobs:
distribution: ${{ inputs.jdk-distribution-fast-fail-build }}
cache: 'maven'

- name: Set up Maven
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"

- name: Build with Maven
run: mvn ${{ inputs.maven_args }}
run: ./mvnw ${{ inputs.maven_args }}

build-experimental:
name: Experimental Java 21 build
Expand All @@ -96,18 +105,21 @@ jobs:
fail-fast: false
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'corretto'
cache: 'maven'

- name: Build with Maven
run: mvn ${{ inputs.maven_args }}
- name: Set up Maven
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"

- name: Build with Maven
run: ./mvnw ${{ inputs.maven_args }}

verify:
needs: build
Expand All @@ -134,6 +146,9 @@ jobs:
distribution: ${{ matrix.distribution }}
cache: 'maven'

- name: Set up Maven
run: mvn --errors --batch-mode --show-version org.apache.maven.plugins:maven-wrapper-plugin:3.2.0:wrapper "-Dtype=only-script" "-Dmaven=${{ inputs.maven-version }}"

- name: Build with Maven
run: mvn ${{ inputs.maven_args }}
run: ./mvnw ${{ inputs.maven_args }}