Bump actions/setup-java from 4.2.1 to 4.3.0 #68
Workflow file for this run
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
name: Java CI with Gradle | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
matrix: | |
java-version: [ '17', '18', '19', '20', '21', '22', '23' ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
# Strip -ea off of java-version for build-time use | |
- name: Strip java-version postfix | |
id: strip | |
env: | |
JAVA_VERSION: ${{ matrix.java-version }} | |
run: | | |
echo "java-version=${JAVA_VERSION%-ea}" >> $GITHUB_OUTPUT | |
# Gradle 8.X no longer uses a default repository for toolchains. | |
# Ref: https://docs.gradle.org/current/userguide/upgrading_version_7.html#using_automatic_toolchain_downloading_without_having_a_repository_configured | |
# Always preload toolchain JDK | |
- name: Preload JDK ${{ matrix.java-version }} | |
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0 | |
with: | |
java-version: ${{ matrix.java-version }} | |
distribution: 'oracle' | |
# This is the JDK gradle will use since gradle does not always support the -ea version | |
- name: Set up JDK 17 | |
uses: actions/setup-java@2dfa2011c5b2a0f1489bf9e433881c92c1631f88 # v4.3.0 | |
with: | |
java-version: '17' | |
distribution: 'oracle' | |
cache: gradle | |
- name: Toolchain debug | |
run: | | |
./gradlew -q javaToolchains | |
- name: Build application | |
run: | | |
./gradlew io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }}:build | |
- name: Verify application | |
run: | | |
./.github/workflows/scripts/verifyArtifact.sh ${{ steps.strip.outputs.java-version }} | |
- name: Repackage application | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
run: | | |
./.github/workflows/scripts/repackageApplication.sh io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }}/build/libs/io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }}.war .jar | |
- name: Upload application | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
with: | |
name: io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }} | |
path: io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }}/build/libs/io.openliberty.java.internal_fat_${{ steps.strip.outputs.java-version }}.jar | |
if-no-files-found: error |