Skip to content

Update CI to package .war and .jar archives #16

Update CI to package .war and .jar archives

Update CI to package .war and .jar archives #16

Workflow file for this run

name: Java CI with Gradle
on:
push:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
strategy:
matrix:
java-version: [ '17', '18', '19', '20', '21' ]
runs-on: ubuntu-latest
steps:
- name: Checkout project
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
# Gradle java toolchain cannot find early release images, need to preload until GA is available
- name: Preload JDK 21
if: ${{ matrix.java-version == '21' }}
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
java-version: '21-ea'
distribution: 'temurin'
- name: Set up JDK 11
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2 # v3.11.0
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Build application
run: |
./gradlew io.openliberty.java.internal_fat_${{ matrix.java-version }}:build
- name: Verify application
run: |
./.github/workflows/scripts/verifyArtifact.sh ${{ matrix.java-version }}
- name: Repackage application
run: |
./.github/workflows/scripts/repackageApplication.sh io.openliberty.java.internal_fat_${{ matrix.java-version }}/build/libs/io.openliberty.java.internal_fat_${{ matrix.java-version }}.war .jar
- name: Upload application
uses: actions/upload-artifact@013d2b89baa2f354c5ffec54c68bec4ab39a2534 #v3.1.2
with:
name: Applications
path: io.openliberty.java.internal_fat_${{ matrix.java-version }}/build/libs/io.openliberty.java.internal_fat_${{ matrix.java-version }}.jar
if-no-files-found: error