Compare commits
1 Commits
main
...
tool-confi
Author | SHA1 | Date |
---|---|---|
github-actions[bot] | 0b13a57b75 |
|
@ -29,26 +29,22 @@ jobs:
|
|||
'liberica',
|
||||
'microsoft',
|
||||
'semeru',
|
||||
'corretto',
|
||||
'dragonwell'
|
||||
'corretto'
|
||||
] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||
version: ['8', '11', '17']
|
||||
version: ['8', '11', '16']
|
||||
exclude:
|
||||
- distribution: microsoft
|
||||
version: 8
|
||||
- distribution: dragonwell
|
||||
os: macos-latest
|
||||
include:
|
||||
- distribution: oracle
|
||||
os: macos-latest
|
||||
version: 17
|
||||
- distribution: oracle
|
||||
os: windows-latest
|
||||
version: 20
|
||||
version: 19
|
||||
- distribution: oracle
|
||||
os: ubuntu-latest
|
||||
version: 20
|
||||
|
||||
version: 19
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
@ -74,17 +70,11 @@ jobs:
|
|||
version:
|
||||
- '11.0'
|
||||
- '8.0.302'
|
||||
- '17.0.7+7'
|
||||
- '16.0.2+7'
|
||||
include:
|
||||
- distribution: oracle
|
||||
os: ubuntu-latest
|
||||
version: '20.0.1'
|
||||
- distribution: dragonwell
|
||||
os: ubuntu-latest
|
||||
version: '11.0'
|
||||
- distribution: dragonwell
|
||||
os: ubuntu-latest
|
||||
version: '11.0.13+9'
|
||||
version: '19.0.1'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
@ -106,10 +96,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
||||
exclude:
|
||||
- distribution: dragonwell
|
||||
os: macos-latest
|
||||
distribution: ['temurin', 'zulu', 'liberica']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
@ -132,10 +119,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
||||
exclude:
|
||||
- distribution: dragonwell
|
||||
os: macos-latest
|
||||
distribution: ['temurin', 'zulu', 'liberica']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
32
README.md
32
README.md
|
@ -5,7 +5,7 @@
|
|||
[![Validate cache](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml/badge.svg?branch=main)](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
|
||||
|
||||
The `setup-java` action provides the following functionality for GitHub Actions runners:
|
||||
- Downloading and setting up a requested version of Java. See [Usage](#usage) for a list of supported distributions.
|
||||
- Downloading and setting up a requested version of Java. See [Usage](#Usage) for a list of supported distributions.
|
||||
- Extracting and caching custom version of Java from a local file.
|
||||
- Configuring runner for publishing using Apache Maven.
|
||||
- Configuring runner for publishing using Gradle.
|
||||
|
@ -31,7 +31,7 @@ This action allows you to work with Java and Scala projects.
|
|||
|
||||
- `distribution`: _(required)_ Java [distribution](#supported-distributions).
|
||||
|
||||
- `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
|
||||
- `java-package`: The packaging variant of the choosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
|
||||
|
||||
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
||||
|
||||
|
@ -39,12 +39,12 @@ This action allows you to work with Java and Scala projects.
|
|||
|
||||
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
||||
|
||||
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle" or "sbt".
|
||||
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predifined package managers. It can be one of "maven", "gradle" or "sbt".
|
||||
|
||||
#### Maven options
|
||||
The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
|
||||
|
||||
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists, set this to `false`.
|
||||
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists set this to `false`.
|
||||
|
||||
- `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
|
||||
|
||||
|
@ -56,7 +56,7 @@ This action allows you to work with Java and Scala projects.
|
|||
|
||||
- `gpg-private-key`: GPG private key to import. Default is empty string.
|
||||
|
||||
- `gpg-passphrase`: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
|
||||
- `gpg-passphrase`: description: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
|
||||
|
||||
- `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
|
||||
|
||||
|
@ -105,7 +105,6 @@ Currently, the following distributions are supported:
|
|||
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
|
||||
| `semeru` | IBM Semeru Runtime Open Edition | [Link](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [Link](https://openjdk.java.net/legal/gplv2+ce.html) |
|
||||
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
|
||||
| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
|
||||
|
||||
**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.
|
||||
|
||||
|
@ -114,8 +113,8 @@ Currently, the following distributions are supported:
|
|||
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
||||
|
||||
### Caching packages dependencies
|
||||
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
|
||||
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
|
||||
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
|
||||
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, and `gradle/*.versions.toml`
|
||||
- maven: `**/pom.xml`
|
||||
- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt`
|
||||
|
||||
|
@ -161,22 +160,6 @@ steps:
|
|||
run: sbt package
|
||||
```
|
||||
|
||||
#### Cache segment restore timeout
|
||||
Usually, cache gets downloaded in multiple segments of fixed sizes. Sometimes, a segment download gets stuck, which causes the workflow job to be stuck. The cache segment download timeout [was introduced](https://github.com/actions/toolkit/tree/main/packages/cache#cache-segment-restore-timeout) to solve this issue as it allows the segment download to get aborted and hence allows the job to proceed with a cache miss. The default value of the cache segment download timeout is set to 10 minutes and can be customized by specifying an environment variable named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with a timeout value in minutes.
|
||||
|
||||
```yaml
|
||||
env:
|
||||
SEGMENT_DOWNLOAD_TIMEOUT_MINS: '5'
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '17'
|
||||
cache: 'gradle'
|
||||
- run: ./gradlew build --no-daemon
|
||||
```
|
||||
|
||||
### Check latest
|
||||
|
||||
In the basic examples above, the `check-latest` flag defaults to `false`. When set to `false`, the action tries to first resolve a version of Java from the local tool cache on the runner. If unable to find a specific version in the cache, the action will download a version of Java. Use the default or set `check-latest` to `false` if you prefer a faster more consistent setup experience that prioritizes trying to use the cached versions at the expense of newer versions sometimes being available for download.
|
||||
|
@ -244,7 +227,6 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||
- [Microsoft](docs/advanced-usage.md#Microsoft)
|
||||
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
||||
- [Oracle](docs/advanced-usage.md#Oracle)
|
||||
- [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
|
||||
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
||||
- [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture)
|
||||
- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
|
||||
|
|
|
@ -102,7 +102,7 @@ describe('dependency cache', () => {
|
|||
await expect(restore('gradle')).rejects.toThrow(
|
||||
`No file in ${projectRoot(
|
||||
workspace
|
||||
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml,**/versions.properties], make sure you have checked out the target repository`
|
||||
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml], make sure you have checked out the target repository`
|
||||
);
|
||||
});
|
||||
it('downloads cache based on build.gradle', async () => {
|
||||
|
@ -179,14 +179,6 @@ describe('dependency cache', () => {
|
|||
expect(firstCall).not.toBe(thirdCall);
|
||||
});
|
||||
});
|
||||
it('downloads cache based on versions.properties', async () => {
|
||||
createFile(join(workspace, 'versions.properties'));
|
||||
|
||||
await restore('gradle');
|
||||
expect(spyCacheRestore).toHaveBeenCalled();
|
||||
expect(spyWarning).not.toHaveBeenCalled();
|
||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
||||
});
|
||||
});
|
||||
describe('save', () => {
|
||||
let spyCacheSave: jest.SpyInstance<
|
||||
|
@ -341,17 +333,6 @@ describe('dependency cache', () => {
|
|||
expect.stringMatching(/^Cache saved with the key:.*/)
|
||||
);
|
||||
});
|
||||
it('uploads cache based on versions.properties', async () => {
|
||||
createFile(join(workspace, 'versions.properties'));
|
||||
createStateForSuccessfulRestore();
|
||||
|
||||
await save('gradle');
|
||||
expect(spyCacheSave).toHaveBeenCalled();
|
||||
expect(spyWarning).not.toHaveBeenCalled();
|
||||
expect(spyInfo).toHaveBeenCalledWith(
|
||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,255 +0,0 @@
|
|||
[
|
||||
{
|
||||
"version": "21.0.0",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.7",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.1+12.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "16.0.2+7.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.19",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.15",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.13+8.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -1,226 +0,0 @@
|
|||
import {HttpClient} from '@actions/http-client';
|
||||
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
|
||||
import * as utils from '../../src/util';
|
||||
|
||||
import manifestData from '../data/dragonwell.json';
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData
|
||||
});
|
||||
|
||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
||||
utils,
|
||||
'getDownloadArchiveExtension'
|
||||
);
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
const mockPlatform = (
|
||||
distribution: DragonwellDistribution,
|
||||
platform: string
|
||||
) => {
|
||||
distribution['getPlatformOption'] = () => platform;
|
||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
||||
};
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
it.each([
|
||||
['8', 'x86', 'linux', 0],
|
||||
['8', 'aarch64', 'linux', 24],
|
||||
['8.6.6', 'x64', 'linux', 27],
|
||||
['8', 'x86', 'anolis', 0],
|
||||
['8', 'x86', 'windows', 0],
|
||||
['8', 'x86', 'mac', 0],
|
||||
['11', 'x64', 'linux', 27],
|
||||
['11', 'aarch64', 'linux', 24],
|
||||
['17', 'riscv', 'linux', 0],
|
||||
['16.0.1', 'x64', 'linux', 27]
|
||||
])(
|
||||
'should get right number of available versions from JSON',
|
||||
async (
|
||||
jdkVersion: string,
|
||||
arch: string,
|
||||
platform: string,
|
||||
len: number
|
||||
) => {
|
||||
const distribution = new DragonwellDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
const availableVersions = await distribution['getAvailableVersions']();
|
||||
expect(availableVersions).not.toBeNull();
|
||||
expect(availableVersions.length).toBe(len);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
it.each([
|
||||
[
|
||||
'8',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'8',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_aarch64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'8',
|
||||
'windows',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_windows.zip'
|
||||
],
|
||||
[
|
||||
'8.13.14',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_aarch64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'windows',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_windows.zip'
|
||||
],
|
||||
[
|
||||
'11',
|
||||
'alpine-linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_alpine-linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'11.0.17',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'linux',
|
||||
'aarch64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_aarch64_linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'windows',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_windows.zip'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
'alpine-linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_alpine-linux.tar.gz'
|
||||
],
|
||||
[
|
||||
'17.0.4',
|
||||
'linux',
|
||||
'x64',
|
||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
||||
]
|
||||
])(
|
||||
'should return proper link according to the specified java-version, platform and arch',
|
||||
async (
|
||||
jdkVersion: string,
|
||||
platform: string,
|
||||
arch: string,
|
||||
expectedLink: string
|
||||
) => {
|
||||
const distribution = new DragonwellDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
const availableVersion = await distribution['findPackageForDownload'](
|
||||
jdkVersion
|
||||
);
|
||||
expect(availableVersion).not.toBeNull();
|
||||
expect(availableVersion.url).toBe(expectedLink);
|
||||
}
|
||||
);
|
||||
|
||||
it.each([
|
||||
['8', 'alpine-linux', 'x64'],
|
||||
['8', 'macos', 'aarch64'],
|
||||
['11', 'macos', 'aarch64'],
|
||||
['17', 'linux', 'riscv']
|
||||
])(
|
||||
'should throw when required version of JDK can not be found in the JSON',
|
||||
async (jdkVersion: string, platform: string, arch: string) => {
|
||||
const distribution = new DragonwellDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
|
||||
await expect(
|
||||
distribution['findPackageForDownload'](jdkVersion)
|
||||
).rejects.toThrow(
|
||||
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".`
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
it('should throw when required package type is not jdk', async () => {
|
||||
const jdkVersion = '17';
|
||||
const arch = 'x64';
|
||||
const platform = 'linux';
|
||||
const distribution = new DragonwellDistribution({
|
||||
version: jdkVersion,
|
||||
architecture: arch,
|
||||
packageType: 'jre',
|
||||
checkLatest: false
|
||||
});
|
||||
mockPlatform(distribution, platform);
|
||||
await expect(
|
||||
distribution['findPackageForDownload'](jdkVersion)
|
||||
).rejects.toThrow('Dragonwell provides only the `jdk` package type');
|
||||
});
|
||||
});
|
||||
});
|
|
@ -1,6 +1,6 @@
|
|||
import {MicrosoftDistributions} from '../../src/distributions/microsoft/installer';
|
||||
import os from 'os';
|
||||
import data from '../data/microsoft.json';
|
||||
import data from '../../src/distributions/microsoft/microsoft-openjdk-versions.json';
|
||||
import * as httpm from '@actions/http-client';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
|
@ -29,11 +29,6 @@ describe('findPackageForDownload', () => {
|
|||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
'21.x',
|
||||
'21.0.0',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-21.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'17.0.1',
|
||||
'17.0.1+12.1',
|
||||
|
@ -41,8 +36,8 @@ describe('findPackageForDownload', () => {
|
|||
],
|
||||
[
|
||||
'17.x',
|
||||
'17.0.7',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-17.0.7-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
'17.0.3',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-17.0.3-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'16.0.x',
|
||||
|
@ -58,11 +53,6 @@ describe('findPackageForDownload', () => {
|
|||
'11.0.15',
|
||||
'11.0.15',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.15-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'11.x',
|
||||
'11.0.19',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.19-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
]
|
||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||
const result = await distribution['findPackageForDownload'](input);
|
||||
|
@ -107,7 +97,7 @@ describe('findPackageForDownload', () => {
|
|||
});
|
||||
|
||||
const result = await distro['findPackageForDownload'](version);
|
||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-${distroArch}.tar.gz`;
|
||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-${distroArch}.tar.gz`;
|
||||
|
||||
expect(result.url).toBe(expectedUrl);
|
||||
}
|
||||
|
|
|
@ -2,12 +2,10 @@ import {OracleDistribution} from '../../src/distributions/oracle/installer';
|
|||
import os from 'os';
|
||||
import * as core from '@actions/core';
|
||||
import {getDownloadArchiveExtension} from '../../src/util';
|
||||
import {HttpClient} from '@actions/http-client';
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: OracleDistribution;
|
||||
let spyDebug: jest.SpyInstance;
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new OracleDistribution({
|
||||
|
@ -23,19 +21,19 @@ describe('findPackageForDownload', () => {
|
|||
|
||||
it.each([
|
||||
[
|
||||
'20',
|
||||
'20',
|
||||
'https://download.oracle.com/java/20/latest/jdk-20_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
'19',
|
||||
'19',
|
||||
'https://download.oracle.com/java/19/latest/jdk-19_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'18',
|
||||
'18',
|
||||
'https://download.oracle.com/java/18/archive/jdk-18_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
'19.0.1',
|
||||
'19.0.1',
|
||||
'https://download.oracle.com/java/19/archive/jdk-19.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'20.0.1',
|
||||
'20.0.1',
|
||||
'https://download.oracle.com/java/20/archive/jdk-20.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
'18.0.2.1',
|
||||
'18.0.2.1',
|
||||
'https://download.oracle.com/java/18/archive/jdk-18.0.2.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'17',
|
||||
|
@ -48,33 +46,7 @@ describe('findPackageForDownload', () => {
|
|||
'https://download.oracle.com/java/17/archive/jdk-17.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||
]
|
||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||
/* Needed only for this particular test because some urls might change */
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
||||
spyHttpClient.mockReturnValue(
|
||||
Promise.resolve({
|
||||
message: {
|
||||
statusCode: 200
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
/**
|
||||
* NOTE - Should fail to retrieve 18 from latest and check archive instead
|
||||
*/
|
||||
if (input === '18') {
|
||||
spyHttpClient.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
message: {
|
||||
statusCode: 404
|
||||
}
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const result = await distribution['findPackageForDownload'](input);
|
||||
|
||||
jest.restoreAllMocks();
|
||||
|
||||
expect(result.version).toBe(expectedVersion);
|
||||
const osType = distribution.getPlatform();
|
||||
const archiveType = getDownloadArchiveExtension();
|
||||
|
@ -93,7 +65,7 @@ describe('findPackageForDownload', () => {
|
|||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||
|
||||
const version = '18';
|
||||
const version = '17';
|
||||
const distro = new OracleDistribution({
|
||||
version,
|
||||
architecture: '', // to get default value
|
||||
|
@ -107,7 +79,7 @@ describe('findPackageForDownload', () => {
|
|||
}
|
||||
const archiveType = getDownloadArchiveExtension();
|
||||
const result = await distro['findPackageForDownload'](version);
|
||||
const expectedUrl = `https://download.oracle.com/java/18/archive/jdk-18_${osType}-${distroArch}_bin.${archiveType}`;
|
||||
const expectedUrl = `https://download.oracle.com/java/17/latest/jdk-17_${osType}-${distroArch}_bin.${archiveType}`;
|
||||
|
||||
expect(result.url).toBe(expectedUrl);
|
||||
}
|
||||
|
@ -120,5 +92,8 @@ describe('findPackageForDownload', () => {
|
|||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
||||
/Oracle JDK is only supported for JDK 17 and later/
|
||||
);
|
||||
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
|
||||
/Could not find Oracle JDK for SemVer */
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -77,9 +77,9 @@ describe('toolchains tests', () => {
|
|||
};
|
||||
|
||||
const result = `<?xml version="1.0"?>
|
||||
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
|
@ -248,9 +248,9 @@ describe('toolchains tests', () => {
|
|||
};
|
||||
|
||||
const expectedToolchains = `<?xml version="1.0"?>
|
||||
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||
<toolchain>
|
||||
<type>jdk</type>
|
||||
<provides>
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -7,7 +7,6 @@
|
|||
- [Microsoft](#Microsoft)
|
||||
- [Amazon Corretto](#Amazon-Corretto)
|
||||
- [Oracle](#Oracle)
|
||||
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
||||
- [Installing custom Java package type](#Installing-custom-Java-package-type)
|
||||
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
|
||||
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
|
||||
|
@ -125,18 +124,6 @@ steps:
|
|||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
### Alibaba Dragonwell
|
||||
**NOTE:** Alibaba Dragonwell only provides jdk.
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'dragonwell'
|
||||
java-version: '8'
|
||||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
## Installing custom Java package type
|
||||
```yaml
|
||||
steps:
|
||||
|
@ -181,31 +168,6 @@ steps:
|
|||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM:
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- name: fetch latest temurin JDK
|
||||
id: fetch_latest_jdk
|
||||
run: |
|
||||
major_version={{ env.JAVA_VERSION }} # Example 8 or 11 or 17
|
||||
cd $RUNNER_TEMP
|
||||
response=$(curl -s "https://api.github.com/repos/adoptium/temurin${major_version}-binaries/releases")
|
||||
latest_jdk_download_url=$(echo "$response" | jq -r '.[0].assets[] | select(.name | contains("jdk_x64_alpine-linux") and endswith(".tar.gz")) | .browser_download_url')
|
||||
curl -Ls "$latest_jdk_download_url" -o java_package.tar.gz
|
||||
latest_jdk_json_url=$(jdk_download_url "$response" | jq -r '.[0].assets[] | select(.name | contains("jdk_x64_alpine-linux") and endswith(".tar.gz.json")) | .browser_download_url')
|
||||
latest_semver_version=$(curl -sL $latest_jdk_json_url | jq -r 'version.semver')
|
||||
echo "java_version=$latest_semver_version" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'jdkfile'
|
||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
||||
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
|
||||
architecture: x64
|
||||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
## Testing against different Java distributions
|
||||
**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.
|
||||
```yaml
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -46,9 +46,8 @@
|
|||
"eslint": "^8.35.0",
|
||||
"eslint-config-prettier": "^8.6.0",
|
||||
"eslint-plugin-jest": "^27.2.1",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"jest": "^27.5.1",
|
||||
"jest-circus": "^27.5.1",
|
||||
"jest": "^27.2.5",
|
||||
"jest-circus": "^27.2.5",
|
||||
"prettier": "^2.8.4",
|
||||
"ts-jest": "^27.0.5",
|
||||
"typescript": "^4.2.3"
|
||||
|
|
|
@ -39,8 +39,7 @@ const supportedPackageManager: PackageManager[] = [
|
|||
'**/gradle-wrapper.properties',
|
||||
'buildSrc/**/Versions.kt',
|
||||
'buildSrc/**/Dependencies.kt',
|
||||
'gradle/*.versions.toml',
|
||||
'**/versions.properties'
|
||||
'gradle/*.versions.toml'
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -9,7 +9,6 @@ import {MicrosoftDistributions} from './microsoft/installer';
|
|||
import {SemeruDistribution} from './semeru/installer';
|
||||
import {CorrettoDistribution} from './corretto/installer';
|
||||
import {OracleDistribution} from './oracle/installer';
|
||||
import {DragonwellDistribution} from './dragonwell/installer';
|
||||
|
||||
enum JavaDistribution {
|
||||
Adopt = 'adopt',
|
||||
|
@ -22,8 +21,7 @@ enum JavaDistribution {
|
|||
Microsoft = 'microsoft',
|
||||
Semeru = 'semeru',
|
||||
Corretto = 'corretto',
|
||||
Oracle = 'oracle',
|
||||
Dragonwell = 'dragonwell'
|
||||
Oracle = 'oracle'
|
||||
}
|
||||
|
||||
export function getJavaDistribution(
|
||||
|
@ -62,8 +60,6 @@ export function getJavaDistribution(
|
|||
return new CorrettoDistribution(installerOptions);
|
||||
case JavaDistribution.Oracle:
|
||||
return new OracleDistribution(installerOptions);
|
||||
case JavaDistribution.Dragonwell:
|
||||
return new DragonwellDistribution(installerOptions);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -1,240 +0,0 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import semver from 'semver';
|
||||
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
import {JavaBase} from '../base-installer';
|
||||
import {
|
||||
convertVersionToSemver,
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders,
|
||||
isVersionSatisfies
|
||||
} from '../../util';
|
||||
import {IDragonwellVersions, IDragonwellAllVersions} from './models';
|
||||
import {
|
||||
JavaDownloadRelease,
|
||||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models';
|
||||
|
||||
export class DragonwellDistribution extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Dragonwell', installerOptions);
|
||||
}
|
||||
|
||||
protected async findPackageForDownload(
|
||||
version: string
|
||||
): Promise<JavaDownloadRelease> {
|
||||
if (!this.stable) {
|
||||
throw new Error('Early access versions are not supported by Dragonwell');
|
||||
}
|
||||
|
||||
if (this.packageType !== 'jdk') {
|
||||
throw new Error('Dragonwell provides only the `jdk` package type');
|
||||
}
|
||||
|
||||
const availableVersions = await this.getAvailableVersions();
|
||||
|
||||
const matchedVersions = availableVersions
|
||||
.filter(item => {
|
||||
return isVersionSatisfies(version, item.jdk_version);
|
||||
})
|
||||
.map(item => {
|
||||
return {
|
||||
version: item.jdk_version,
|
||||
url: item.download_link
|
||||
} as JavaDownloadRelease;
|
||||
});
|
||||
|
||||
if (!matchedVersions.length) {
|
||||
throw new Error(
|
||||
`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".`
|
||||
);
|
||||
}
|
||||
|
||||
const resolvedVersion = matchedVersions[0];
|
||||
return resolvedVersion;
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<IDragonwellVersions[]> {
|
||||
const platform = this.getPlatformOption();
|
||||
const arch = this.distributionArchitecture();
|
||||
|
||||
let fetchedDragonwellJson = await this.fetchJsonFromPrimaryUrl();
|
||||
|
||||
if (!fetchedDragonwellJson) {
|
||||
fetchedDragonwellJson = await this.fetchJsonFromBackupUrl();
|
||||
}
|
||||
|
||||
if (!fetchedDragonwellJson) {
|
||||
throw new Error(
|
||||
`Couldn't fetch Dragonwell versions information from both primary and backup urls`
|
||||
);
|
||||
}
|
||||
|
||||
core.debug(
|
||||
'Successfully fetched information about available Dragonwell versions'
|
||||
);
|
||||
|
||||
const availableVersions = this.parseVersions(
|
||||
platform,
|
||||
arch,
|
||||
fetchedDragonwellJson
|
||||
);
|
||||
|
||||
if (core.isDebug()) {
|
||||
core.startGroup('Print information about available versions');
|
||||
core.debug(availableVersions.map(item => item.jdk_version).join(', '));
|
||||
core.endGroup();
|
||||
}
|
||||
|
||||
return availableVersions;
|
||||
}
|
||||
|
||||
protected async downloadTool(
|
||||
javaRelease: JavaDownloadRelease
|
||||
): Promise<JavaInstallerResults> {
|
||||
core.info(
|
||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||
);
|
||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||
|
||||
core.info(`Extracting Java archive...`);
|
||||
|
||||
const extractedJavaPath = await extractJdkFile(
|
||||
javaArchivePath,
|
||||
getDownloadArchiveExtension()
|
||||
);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||
|
||||
const javaPath = await tc.cacheDir(
|
||||
archivePath,
|
||||
this.toolcacheFolderName,
|
||||
version,
|
||||
this.architecture
|
||||
);
|
||||
|
||||
return {version: javaRelease.version, path: javaPath};
|
||||
}
|
||||
|
||||
private parseVersions(
|
||||
platform: string,
|
||||
arch: string,
|
||||
dragonwellVersions: IDragonwellAllVersions
|
||||
): IDragonwellVersions[] {
|
||||
const eligibleVersions: IDragonwellVersions[] = [];
|
||||
|
||||
for (const majorVersion in dragonwellVersions) {
|
||||
const majorVersionMap = dragonwellVersions[majorVersion];
|
||||
for (let jdkVersion in majorVersionMap) {
|
||||
const jdkVersionMap = majorVersionMap[jdkVersion];
|
||||
if (!(platform in jdkVersionMap)) {
|
||||
continue;
|
||||
}
|
||||
const platformMap = jdkVersionMap[platform];
|
||||
if (!(arch in platformMap)) {
|
||||
continue;
|
||||
}
|
||||
const archMap = platformMap[arch];
|
||||
|
||||
if (jdkVersion === 'latest') {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
|
||||
// Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools.
|
||||
if (jdkVersion.split('.').length > 3) {
|
||||
jdkVersion = convertVersionToSemver(jdkVersion);
|
||||
}
|
||||
|
||||
for (const edition in archMap) {
|
||||
eligibleVersions.push({
|
||||
os: platform,
|
||||
architecture: arch,
|
||||
jdk_version: jdkVersion,
|
||||
checksum: archMap[edition].sha256 ?? '',
|
||||
download_link: archMap[edition].download_url,
|
||||
edition: edition,
|
||||
image_type: 'jdk'
|
||||
});
|
||||
break; // Get the first available link to the JDK. In most cases it should point to the Extended version of JDK, in rare cases like with v17 it points to the Standard version (the only available).
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const sortedVersions = this.sortParsedVersions(eligibleVersions);
|
||||
|
||||
return sortedVersions;
|
||||
}
|
||||
|
||||
// Sorts versions in descending order as by default data in JSON isn't sorted
|
||||
private sortParsedVersions(
|
||||
eligibleVersions: IDragonwellVersions[]
|
||||
): IDragonwellVersions[] {
|
||||
const sortedVersions = eligibleVersions.sort((versionObj1, versionObj2) => {
|
||||
const version1 = versionObj1.jdk_version;
|
||||
const version2 = versionObj2.jdk_version;
|
||||
return semver.compareBuild(version1, version2);
|
||||
});
|
||||
return sortedVersions.reverse();
|
||||
}
|
||||
|
||||
private getPlatformOption(): string {
|
||||
switch (process.platform) {
|
||||
case 'win32':
|
||||
return 'windows';
|
||||
default:
|
||||
return process.platform;
|
||||
}
|
||||
}
|
||||
|
||||
private async fetchJsonFromPrimaryUrl(): Promise<IDragonwellAllVersions | null> {
|
||||
const primaryUrl = 'https://dragonwell-jdk.io/map_with_checksum.json';
|
||||
try {
|
||||
core.debug(
|
||||
`Trying to fetch available Dragonwell versions info from the primary url: ${primaryUrl}`
|
||||
);
|
||||
const fetchedDragonwellJson = (
|
||||
await this.http.getJson<IDragonwellAllVersions>(primaryUrl)
|
||||
).result;
|
||||
return fetchedDragonwellJson;
|
||||
} catch (err) {
|
||||
core.debug(
|
||||
`Fetching Dragonwell versions info from the primary link: ${primaryUrl} ended up with the error: ${err.message}`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async fetchJsonFromBackupUrl(): Promise<IDragonwellAllVersions | null> {
|
||||
const owner = 'dragonwell-releng';
|
||||
const repository = 'dragonwell-setup-java';
|
||||
const branch = 'main';
|
||||
const filePath = 'releases.json';
|
||||
|
||||
const backupUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||
|
||||
const headers = getGitHubHttpHeaders();
|
||||
|
||||
try {
|
||||
core.debug(
|
||||
`Trying to fetch available Dragonwell versions info from the backup url: ${backupUrl}`
|
||||
);
|
||||
const fetchedDragonwellJson = (
|
||||
await this.http.getJson<IDragonwellAllVersions>(backupUrl, headers)
|
||||
).result;
|
||||
return fetchedDragonwellJson;
|
||||
} catch (err) {
|
||||
core.debug(
|
||||
`Fetching Dragonwell versions info from the backup url: ${backupUrl} ended up with the error: ${err.message}`
|
||||
);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
export interface IDragonwellAllVersions {
|
||||
[major: string]: {
|
||||
[jdk_version: string]: {
|
||||
[os: string]: {
|
||||
[arch: string]: {
|
||||
[edition: string]: {
|
||||
content_type: string;
|
||||
sha256: string;
|
||||
name: string;
|
||||
download_url: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export interface IDragonwellVersions {
|
||||
os: string;
|
||||
architecture: string;
|
||||
jdk_version: string;
|
||||
checksum: string;
|
||||
download_link: string;
|
||||
edition: string;
|
||||
image_type: string;
|
||||
}
|
|
@ -4,13 +4,10 @@ import {
|
|||
JavaInstallerOptions,
|
||||
JavaInstallerResults
|
||||
} from '../base-models';
|
||||
import {
|
||||
extractJdkFile,
|
||||
getDownloadArchiveExtension,
|
||||
getGitHubHttpHeaders
|
||||
} from '../../util';
|
||||
import {extractJdkFile, getDownloadArchiveExtension} from '../../util';
|
||||
import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import {OutgoingHttpHeaders} from 'http';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import {ITypedResponse} from '@actions/http-client/interfaces';
|
||||
|
@ -88,6 +85,8 @@ export class MicrosoftDistributions extends JavaBase {
|
|||
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
|
||||
// TODO get these dynamically!
|
||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||
const token = core.getInput('token');
|
||||
const auth = !token ? undefined : `token ${token}`;
|
||||
const owner = 'actions';
|
||||
const repository = 'setup-java';
|
||||
const branch = 'main';
|
||||
|
@ -97,7 +96,10 @@ export class MicrosoftDistributions extends JavaBase {
|
|||
let releases: tc.IToolRelease[] | null = null;
|
||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||
|
||||
const headers = getGitHubHttpHeaders();
|
||||
const headers: OutgoingHttpHeaders = {
|
||||
authorization: auth,
|
||||
accept: 'application/vnd.github.VERSION.raw'
|
||||
};
|
||||
|
||||
let response: ITypedResponse<tc.IToolRelease[]> | null = null;
|
||||
|
||||
|
|
|
@ -1,514 +1,181 @@
|
|||
[
|
||||
{
|
||||
"version": "21.0.0",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-21.0.0-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.0-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.7",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.7-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.6",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.6-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.6-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.6-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.6-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.6-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.5",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.5-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.5-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.5-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.5-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.5-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.4",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.4-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.4-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.4-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.4-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.4-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.3",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.1+12.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "16.0.2+7.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.19",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.19-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.18",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.18-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.18-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.18-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.18-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.18-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.17",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.17-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.17-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.17-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.17-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.17-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.16",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.16-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.16-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.16-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.16-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.16-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.15",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.13+8.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
"version": "17.0.3",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.3-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "17.0.1+12.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "16.0.2+7.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.15",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-macos-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-aarch64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.15-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "11.0.13+8.1",
|
||||
"stable": true,
|
||||
"release_url": "https://aka.ms/download-jdk",
|
||||
"files": [
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "darwin",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz",
|
||||
"arch": "x64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-windows-x64.zip",
|
||||
"arch": "x64",
|
||||
"platform": "win32",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-x64.zip"
|
||||
},
|
||||
{
|
||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz",
|
||||
"arch": "aarch64",
|
||||
"platform": "linux",
|
||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
|
@ -65,48 +65,33 @@ export class OracleDistribution extends JavaBase {
|
|||
|
||||
const platform = this.getPlatform();
|
||||
const extension = getDownloadArchiveExtension();
|
||||
|
||||
const isOnlyMajorProvided = !range.includes('.');
|
||||
const major = isOnlyMajorProvided ? range : range.split('.')[0];
|
||||
|
||||
const possibleUrls: string[] = [];
|
||||
|
||||
/**
|
||||
* NOTE
|
||||
* If only major version was provided we will check it under /latest first
|
||||
* in order to retrieve the latest possible version if possible,
|
||||
* otherwise we will fall back to /archive where we are guaranteed to
|
||||
* find any version if it exists
|
||||
*/
|
||||
if (isOnlyMajorProvided) {
|
||||
possibleUrls.push(
|
||||
`${ORACLE_DL_BASE}/${major}/latest/jdk-${major}_${platform}-${arch}_bin.${extension}`
|
||||
);
|
||||
let major;
|
||||
let fileUrl;
|
||||
if (range.includes('.')) {
|
||||
major = range.split('.')[0];
|
||||
fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||
} else {
|
||||
major = range;
|
||||
fileUrl = `${ORACLE_DL_BASE}/${range}/latest/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||
}
|
||||
|
||||
possibleUrls.push(
|
||||
`${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`
|
||||
);
|
||||
|
||||
if (parseInt(major) < 17) {
|
||||
throw new Error('Oracle JDK is only supported for JDK 17 and later');
|
||||
}
|
||||
|
||||
for (const url of possibleUrls) {
|
||||
const response = await this.http.head(url);
|
||||
const response = await this.http.head(fileUrl);
|
||||
|
||||
if (response.message.statusCode === HttpCodes.OK) {
|
||||
return {url, version: range};
|
||||
}
|
||||
|
||||
if (response.message.statusCode !== HttpCodes.NotFound) {
|
||||
throw new Error(
|
||||
`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`
|
||||
);
|
||||
}
|
||||
if (response.message.statusCode === HttpCodes.NotFound) {
|
||||
throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
|
||||
}
|
||||
|
||||
throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
|
||||
if (response.message.statusCode !== HttpCodes.OK) {
|
||||
throw new Error(
|
||||
`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`
|
||||
);
|
||||
}
|
||||
|
||||
return {url: fileUrl, version: range};
|
||||
}
|
||||
|
||||
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
||||
|
|
|
@ -104,10 +104,10 @@ export function generateToolchainDefinition(
|
|||
} else
|
||||
xmlObj = xmlCreate({
|
||||
toolchains: {
|
||||
'@xmlns': 'http://maven.apache.org/TOOLCHAINS/1.1.0',
|
||||
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
||||
'@xmlns': 'https://maven.apache.org/TOOLCHAINS/1.1.0',
|
||||
'@xmlns:xsi': 'https://www.w3.org/2001/XMLSchema-instance',
|
||||
'@xsi:schemaLocation':
|
||||
'http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd',
|
||||
'https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd',
|
||||
toolchain: [
|
||||
{
|
||||
type: 'jdk',
|
||||
|
|
11
src/util.ts
11
src/util.ts
|
@ -7,7 +7,6 @@ import * as core from '@actions/core';
|
|||
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import {INPUT_JOB_STATUS, DISTRIBUTIONS_ONLY_MAJOR_VERSION} from './constants';
|
||||
import {OutgoingHttpHeaders} from 'http';
|
||||
|
||||
export function getTempDir() {
|
||||
const tempDirectory = process.env['RUNNER_TEMP'] || os.tmpdir();
|
||||
|
@ -162,13 +161,3 @@ export function convertVersionToSemver(version: number[] | string) {
|
|||
}
|
||||
return mainVersion;
|
||||
}
|
||||
|
||||
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
|
||||
const token = core.getInput('token');
|
||||
const auth = !token ? undefined : `token ${token}`;
|
||||
const headers: OutgoingHttpHeaders = {
|
||||
authorization: auth,
|
||||
accept: 'application/vnd.github.VERSION.raw'
|
||||
};
|
||||
return headers;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue