Skip to content

Commit

Permalink
Upgrade legend-shared to build with JDK 21 (finos#205)
Browse files Browse the repository at this point in the history
* Allow building with JDK 21

* Upgrade workflows to use JDK 21, and upgrade other actions
  • Loading branch information
kevin-m-knight-gs authored Feb 21, 2024
1 parent 7103228 commit 6c79ba7
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 26 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache Maven dependencies
uses: actions/cache@v2
uses: actions/cache@v4
env:
cache-name: cache-mvn-deps
with:
Expand All @@ -43,9 +43,11 @@ jobs:
${{ runner.os }}-
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
java-version: 21
java-package: jdk
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
Expand Down Expand Up @@ -75,14 +77,14 @@ jobs:

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: test-results
path: legend-shared-test-reports/surefire-reports-aggregate/*.xml

- name: Upload CI Event
if: always()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: event-file
path: ${{ github.event_path }}
2 changes: 1 addition & 1 deletion .github/workflows/clean-after-failed-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.FINOS_GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Build simplified Docker image for checks
# NOTE: if this gets more complicated, consider having this as a bash script
run: mkdir -p ./legend-shared-server/target && touch ./legend-shared-server/target/legend-shared-server-dummy.jar && docker build --quiet --tag local/legend-shared-server:${{ github.sha }} ./legend-shared-server
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/legend-stack-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.FINOS_GITHUB_TOKEN }}

Expand All @@ -40,11 +40,12 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "FINOS Administrator"
- name: Set up Maven Central
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
distribution: 'temurin'
java-version: 21
java-package: jdk
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/ossrh-close-staging-repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
steps:

- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.FINOS_GITHUB_TOKEN }}

Expand All @@ -47,11 +47,12 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "FINOS Administrator"
- name: Set up Maven Central
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
distribution: 'temurin'
java-version: 21
java-package: jdk
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.FINOS_GITHUB_TOKEN }}

Expand All @@ -43,11 +43,12 @@ jobs:
git config --global user.email "[email protected]"
git config --global user.name "FINOS Administrator"
- name: Set up Maven Central
uses: actions/setup-java@v2
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "11"
distribution: 'temurin'
java-version: 21
java-package: jdk
server-id: ossrh
server-username: CI_DEPLOY_USERNAME
server-password: CI_DEPLOY_PASSWORD
Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@

<encoding>UTF-8</encoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.build.timestamp.format>yyyy-MM-dd HH:mm</maven.build.timestamp.format>
<maven.compiler.release>8</maven.compiler.release>
<java.version.range>[11,12),[17,18),[21,22)</java.version.range>

<!-- Dependencies -->
<commons.lang.version>2.6</commons.lang.version>
Expand Down Expand Up @@ -266,7 +267,7 @@
<configuration>
<rules>
<requireJavaVersion>
<version>[11.0.10,12)</version>
<version>${java.version.range}</version>
</requireJavaVersion>
</rules>
</configuration>
Expand Down

0 comments on commit 6c79ba7

Please sign in to comment.