Compare commits

..

2 Commits

Author SHA1 Message Date
Bruno Borges d7793b5450 Deprecate legacy Adopt distributions in v4 (#1187)
Preserve the existing Adopt installers while warning users to migrate before the distributions are removed in setup-java v6.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-07-31 15:34:43 -04:00
Bruno Borges 0132de53b6 Fix v4 dependency audit failures (#1188)
* Fix v4 dependency audit failures

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bd43d0d4-83e5-4c36-a328-cde537cf6673

* Make lint file discovery cross-platform

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bd43d0d4-83e5-4c36-a328-cde537cf6673

* Replace retired macOS 13 runners

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bd43d0d4-83e5-4c36-a328-cde537cf6673

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: bd43d0d4-83e5-4c36-a328-cde537cf6673
2026-07-31 14:07:04 -04:00
11 changed files with 36963 additions and 25724 deletions
+9 -9
View File
@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -46,7 +46,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
needs: gradle-save
steps:
- name: Checkout
@@ -70,7 +70,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -93,7 +93,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
needs: maven-save
steps:
- name: Checkout
@@ -121,7 +121,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-22.04]
os: [macos-15-intel, windows-latest, ubuntu-22.04]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -133,7 +133,7 @@ jobs:
java-version: '11'
cache: sbt
- name: Setup SBT
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-15-intel'
run: |
echo ""Installing SBT...""
brew install sbt
@@ -141,7 +141,7 @@ jobs:
run: sbt update
- name: Check files to cache on macos-latest
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-15-intel'
run: |
if [ ! -d ~/Library/Caches/Coursier ]; then
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
@@ -170,7 +170,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-22.04]
os: [macos-15-intel, windows-latest, ubuntu-22.04]
needs: sbt-save
steps:
- name: Checkout
@@ -184,7 +184,7 @@ jobs:
cache: sbt
- name: Confirm that ~/Library/Caches/Coursier directory has been made
if: matrix.os == 'macos-13'
if: matrix.os == 'macos-15-intel'
run: |
if [ ! -d ~/Library/Caches/Coursier ]; then
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
+5 -5
View File
@@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
distribution: [
'temurin',
'adopt',
@@ -39,10 +39,10 @@ jobs:
- distribution: microsoft
version: 8
- distribution: dragonwell
os: macos-13
os: macos-15-intel
include:
- distribution: oracle
os: macos-13
os: macos-15-intel
version: 17
- distribution: oracle
os: windows-latest
@@ -220,7 +220,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
version: ['17-ea', '15.0.0-ea.14']
steps:
- name: Checkout
@@ -286,7 +286,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-13, windows-latest, ubuntu-latest]
os: [macos-15-intel, windows-latest, ubuntu-latest]
distribution:
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
java-package: ['jre']
+3 -3
View File
@@ -100,8 +100,8 @@ Currently, the following distributions are supported:
|-|-|-|-|
| `temurin` | Eclipse Temurin | [Link](https://adoptium.net/) | [Link](https://adoptium.net/about.html)
| `zulu` | Azul Zulu OpenJDK | [Link](https://www.azul.com/downloads/zulu-community/?package=jdk) | [Link](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/) |
| `adopt` or `adopt-hotspot` | AdoptOpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `adopt-openj9` | AdoptOpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `adopt` or `adopt-hotspot` (deprecated; use `temurin`) | AdoptOpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `adopt-openj9` (deprecated; use `semeru`) | AdoptOpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
@@ -114,7 +114,7 @@ Currently, the following distributions are supported:
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
**NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` and `adopt-openj9`, to `temurin` and `semeru` respectively, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
**NOTE:** The legacy AdoptOpenJDK distributions are deprecated and will be removed in setup-java v6. Migrate `adopt` and `adopt-hotspot` to `temurin`, and `adopt-openj9` to `semeru`, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
@@ -0,0 +1,51 @@
import * as core from '@actions/core';
import {
AdoptDistribution,
AdoptImplementation
} from '../../src/distributions/adopt/installer';
import {JavaInstallerOptions} from '../../src/distributions/base-models';
import {getJavaDistribution} from '../../src/distributions/distribution-factory';
describe('getJavaDistribution', () => {
const installerOptions: JavaInstallerOptions = {
version: '11',
architecture: 'x64',
packageType: 'jdk',
checkLatest: false
};
afterEach(() => {
jest.restoreAllMocks();
});
it.each([
['adopt', AdoptImplementation.Hotspot, 'temurin'],
['adopt-hotspot', AdoptImplementation.Hotspot, 'temurin'],
['adopt-openj9', AdoptImplementation.OpenJ9, 'semeru']
])(
'warns that %s is deprecated while preserving its installer',
(
distributionName: string,
implementation: AdoptImplementation,
replacement: string
) => {
const warningSpy = jest
.spyOn(core, 'warning')
.mockImplementation(() => {});
const distribution = getJavaDistribution(
distributionName,
installerOptions
);
expect(distribution).toBeInstanceOf(AdoptDistribution);
if (!(distribution instanceof AdoptDistribution)) {
throw new Error(`Expected an Adopt installer for ${distributionName}`);
}
expect(distribution['jvmImpl']).toBe(implementation);
expect(warningSpy).toHaveBeenCalledWith(
`The '${distributionName}' legacy AdoptOpenJDK distribution is deprecated and will be removed in setup-java v6. Please migrate to the '${replacement}' distribution.`
);
}
);
});
+1 -1
View File
@@ -8,7 +8,7 @@ inputs:
java-version-file:
description: 'The path to the `.java-version` file. See examples of supported syntax in README file'
distribution:
description: 'Java distribution. See the list of supported distributions in README file'
description: 'Java distribution. See the list of supported distributions in README file. Legacy AdoptOpenJDK values (adopt, adopt-hotspot, adopt-openj9) are deprecated and will be removed in setup-java v6.'
required: true
java-package:
description: 'The package type (jdk, jre, jdk+fx, jre+fx)'
+18129 -12676
View File
File diff suppressed because one or more lines are too long
+18181 -12677
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -40,7 +40,7 @@ steps:
```
### Adopt
**NOTE:** Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
**NOTE:** The legacy `adopt`, `adopt-hotspot`, and `adopt-openj9` distributions are deprecated and will be removed in setup-java v6. Migrate `adopt` and `adopt-hotspot` to `temurin`, and `adopt-openj9` to `semeru`, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
```yaml
steps:
+559 -348
View File
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -8,8 +8,8 @@
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
"lint": "eslint --config ./.eslintrc.js --ext .ts .",
"lint:fix": "eslint --config ./.eslintrc.js --ext .ts . --fix",
"prerelease": "npm run-script build",
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
"test": "jest"
@@ -30,12 +30,20 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.0.4",
"@actions/glob": "^0.5.0",
"@actions/http-client": "^2.2.3",
"@actions/http-client": "^3.0.2",
"@actions/io": "^1.0.2",
"@actions/tool-cache": "^2.0.1",
"@actions/tool-cache": "^2.0.2",
"semver": "^7.6.0",
"xmlbuilder2": "^2.4.0"
},
"overrides": {
"@actions/http-client": "$@actions/http-client",
"minimatch": "10.2.6",
"test-exclude": "7.0.2",
"xmlbuilder2": {
"js-yaml": "3.15.0"
}
},
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/node": "^20.11.24",
+12
View File
@@ -1,3 +1,4 @@
import * as core from '@actions/core';
import {JavaBase} from './base-installer';
import {JavaInstallerOptions} from './base-models';
import {LocalDistribution} from './local/installer';
@@ -42,11 +43,13 @@ export function getJavaDistribution(
return new LocalDistribution(installerOptions, jdkFile);
case JavaDistribution.Adopt:
case JavaDistribution.AdoptHotspot:
warnIfAdoptDistributionIsDeprecated(distributionName, 'temurin');
return new AdoptDistribution(
installerOptions,
AdoptImplementation.Hotspot
);
case JavaDistribution.AdoptOpenJ9:
warnIfAdoptDistributionIsDeprecated(distributionName, 'semeru');
return new AdoptDistribution(
installerOptions,
AdoptImplementation.OpenJ9
@@ -80,3 +83,12 @@ export function getJavaDistribution(
return null;
}
}
function warnIfAdoptDistributionIsDeprecated(
distributionName: string,
replacement: string
): void {
core.warning(
`The '${distributionName}' legacy AdoptOpenJDK distribution is deprecated and will be removed in setup-java v6. Please migrate to the '${replacement}' distribution.`
);
}