2024-09-07 12:00:40 +00:00
|
|
|
name: 'setup-java'
|
|
|
|
description: |
|
|
|
|
Github action to setup java and adding custom root certificate in the truststore
|
|
|
|
see more information in official setup-java action
|
|
|
|
https://github.com/actions/setup-java
|
2024-09-07 07:56:45 +00:00
|
|
|
branding:
|
2024-09-07 12:00:40 +00:00
|
|
|
icon: zap
|
|
|
|
color: gray-dark
|
2024-09-07 07:56:45 +00:00
|
|
|
inputs:
|
2024-09-07 12:00:40 +00:00
|
|
|
version:
|
|
|
|
description: 'java version to setup'
|
|
|
|
default: '21'
|
|
|
|
required: false
|
|
|
|
distribution:
|
|
|
|
description: 'java distribution to setup'
|
|
|
|
default: 'temurin'
|
2024-09-07 07:56:45 +00:00
|
|
|
required: false
|
|
|
|
runs:
|
|
|
|
using: "composite"
|
|
|
|
steps:
|
2024-09-07 12:00:40 +00:00
|
|
|
- name: Retrieve root ca certificate
|
|
|
|
id: get-ca-cert
|
2024-09-08 20:03:45 +00:00
|
|
|
uses: https://antoine-roux.tk/projects/actions/get-ca-cert@v1.0.0
|
2024-09-07 07:56:45 +00:00
|
|
|
|
2024-09-07 12:00:40 +00:00
|
|
|
- name: Setup java ${{ inputs.distribution }} version ${{ inputs.version }}
|
|
|
|
uses: actions/setup-java@v4
|
|
|
|
id: java
|
|
|
|
with:
|
|
|
|
distribution: "${{ inputs.distribution }}"
|
|
|
|
java-version: "${{ inputs.version }}"
|
|
|
|
overwrite-settings: false
|
2024-09-07 07:56:45 +00:00
|
|
|
|
2024-09-07 12:00:40 +00:00
|
|
|
- name: Add root certificate to java truststore
|
2024-09-08 20:03:45 +00:00
|
|
|
uses: https://antoine-roux.tk/projects/actions/add-ca-truststore@v1.1.0
|
2024-09-07 12:00:40 +00:00
|
|
|
id: add-ca-to-truststore
|
|
|
|
with:
|
|
|
|
alias-name: antoine-roux.tk
|
|
|
|
ca-cert: "${{ steps.get-ca-cert.outputs.ca-cert }}"
|
|
|
|
store-path: "${{ steps.java.outputs.path }}/lib/security/cacerts"
|