mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-07 02:36:26 +08:00
Compare commits
6 Commits
292cc14be8
...
upgrade-ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
616fec2905 | ||
|
|
7a6d8a8234 | ||
|
|
7136edc5e8 | ||
|
|
8df1039502 | ||
|
|
870c199c48 | ||
|
|
83a06ff9d9 |
4
.github/workflows/e2e-cache.yml
vendored
4
.github/workflows/e2e-cache.yml
vendored
@@ -121,7 +121,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-22.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -170,7 +170,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-22.04]
|
||||||
needs: sbt-save
|
needs: sbt-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
85
.github/workflows/e2e-versions.yml
vendored
85
.github/workflows/e2e-versions.yml
vendored
@@ -31,7 +31,8 @@ jobs:
|
|||||||
'semeru',
|
'semeru',
|
||||||
'corretto',
|
'corretto',
|
||||||
'dragonwell',
|
'dragonwell',
|
||||||
'sapmachine'
|
'sapmachine',
|
||||||
|
'jetbrains'
|
||||||
] # internally 'adopt-hotspot' is the same as 'adopt'
|
] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||||
version: ['21', '11', '17']
|
version: ['21', '11', '17']
|
||||||
exclude:
|
exclude:
|
||||||
@@ -51,7 +52,7 @@ jobs:
|
|||||||
version: 21
|
version: 21
|
||||||
- distribution: graalvm
|
- distribution: graalvm
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
version: 17
|
version: 17.0.12
|
||||||
- distribution: graalvm
|
- distribution: graalvm
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
version: 21
|
version: 21
|
||||||
@@ -70,6 +71,8 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
java-version: ${{ matrix.version }}
|
java-version: ${{ matrix.version }}
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -103,6 +106,12 @@ jobs:
|
|||||||
- distribution: sapmachine
|
- distribution: sapmachine
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '17.0.7'
|
version: '17.0.7'
|
||||||
|
- distribution: jetbrains
|
||||||
|
os: ubuntu-latest
|
||||||
|
version: '11.0.11'
|
||||||
|
- distribution: jetbrains
|
||||||
|
os: ubuntu-latest
|
||||||
|
version: '17.0.7'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -115,6 +124,8 @@ jobs:
|
|||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
setup-java-check-latest:
|
setup-java-check-latest:
|
||||||
name: ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} - check-latest flag - ${{ matrix.os }}
|
||||||
@@ -125,7 +136,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution:
|
||||||
['temurin', 'zulu', 'liberica', 'dragonwell', 'sapmachine']
|
[
|
||||||
|
'temurin',
|
||||||
|
'zulu',
|
||||||
|
'liberica',
|
||||||
|
'dragonwell',
|
||||||
|
'sapmachine',
|
||||||
|
'jetbrains'
|
||||||
|
]
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
@@ -139,6 +157,8 @@ jobs:
|
|||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
java-version: 11
|
java-version: 11
|
||||||
check-latest: true
|
check-latest: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "11" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -152,7 +172,14 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution:
|
||||||
['temurin', 'zulu', 'liberica', 'dragonwell', 'sapmachine']
|
[
|
||||||
|
'temurin',
|
||||||
|
'zulu',
|
||||||
|
'liberica',
|
||||||
|
'dragonwell',
|
||||||
|
'sapmachine',
|
||||||
|
'jetbrains'
|
||||||
|
]
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
@@ -167,6 +194,8 @@ jobs:
|
|||||||
java-version: |
|
java-version: |
|
||||||
11
|
11
|
||||||
17
|
17
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Verify Java env variables
|
- name: Verify Java env variables
|
||||||
run: |
|
run: |
|
||||||
$versionsArr = "11","17"
|
$versionsArr = "11","17"
|
||||||
@@ -258,7 +287,8 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine']
|
distribution:
|
||||||
|
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
|
||||||
java-package: ['jre']
|
java-package: ['jre']
|
||||||
version: ['17.0']
|
version: ['17.0']
|
||||||
include:
|
include:
|
||||||
@@ -282,6 +312,47 @@ jobs:
|
|||||||
java-package: jre
|
java-package: jre
|
||||||
version: '8'
|
version: '8'
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jdk+jcef
|
||||||
|
version: '11'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jdk+jcef
|
||||||
|
version: '17'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jdk+jcef
|
||||||
|
version: '21'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jre+jcef
|
||||||
|
version: '11'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jre+jcef
|
||||||
|
version: '17'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jre+jcef
|
||||||
|
version: '21'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jdk+ft
|
||||||
|
version: '17'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jdk+ft
|
||||||
|
version: '21'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jre+ft
|
||||||
|
version: '17'
|
||||||
|
os: ubuntu-latest
|
||||||
|
- distribution: 'jetbrains'
|
||||||
|
java-package: jre+ft
|
||||||
|
version: '21'
|
||||||
|
os: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -292,6 +363,8 @@ jobs:
|
|||||||
java-version: ${{ matrix.version }}
|
java-version: ${{ matrix.version }}
|
||||||
java-package: ${{ matrix.java-package }}
|
java-package: ${{ matrix.java-package }}
|
||||||
distribution: ${{ matrix.distribution }}
|
distribution: ${{ matrix.distribution }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Verify Java
|
- name: Verify Java
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||||
shell: bash
|
shell: bash
|
||||||
@@ -305,7 +378,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
# x86 is not supported on macOS
|
# x86 is not supported on macOS
|
||||||
os: [windows-latest, ubuntu-latest]
|
os: [windows-latest, ubuntu-22.04]
|
||||||
distribution: ['liberica', 'zulu', 'corretto']
|
distribution: ['liberica', 'zulu', 'corretto']
|
||||||
version: ['11']
|
version: ['11']
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
id: update-major-tag
|
id: update-major-tag
|
||||||
uses: actions/publish-action@v0.2.2
|
uses: actions/publish-action@v0.3.0
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|||||||
2
.licenses/npm/@actions/cache.dep.yml
generated
2
.licenses/npm/@actions/cache.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/cache"
|
name: "@actions/cache"
|
||||||
version: 3.2.4
|
version: 4.0.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions cache lib
|
summary: Actions cache lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||||
|
|||||||
2
.licenses/npm/@actions/core.dep.yml
generated
2
.licenses/npm/@actions/core.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/core"
|
name: "@actions/core"
|
||||||
version: 1.10.1
|
version: 1.11.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions core lib
|
summary: Actions core lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
homepage: https://github.com/actions/toolkit/tree/main/packages/core
|
||||||
|
|||||||
@@ -110,6 +110,7 @@ Currently, the following distributions are supported:
|
|||||||
| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
|
| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
|
||||||
| `sapmachine` | SAP SapMachine JDK/JRE | [Link](https://sapmachine.io/) | [Link](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE)
|
| `sapmachine` | SAP SapMachine JDK/JRE | [Link](https://sapmachine.io/) | [Link](https://github.com/SAP/SapMachine/blob/sapmachine/LICENSE)
|
||||||
| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html)
|
| `graalvm` | Oracle GraalVM | [Link](https://www.graalvm.org/) | [Link](https://www.oracle.com/downloads/licenses/graal-free-license.html)
|
||||||
|
| `jetbrains` | JetBrains Runtime | [Link](https://github.com/JetBrains/JetBrainsRuntime/) | [Link](https://github.com/JetBrains/JetBrainsRuntime/blob/main/LICENSE)
|
||||||
|
|
||||||
**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:** 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.
|
||||||
|
|
||||||
|
|||||||
1454
__tests__/data/jetbrains.json
Normal file
1454
__tests__/data/jetbrains.json
Normal file
File diff suppressed because it is too large
Load Diff
120
__tests__/distributors/jetbrains-installer.test.ts
Normal file
120
__tests__/distributors/jetbrains-installer.test.ts
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
import https from 'https';
|
||||||
|
import {HttpClient} from '@actions/http-client';
|
||||||
|
import {JetBrainsDistribution} from '../../src/distributions/jetbrains/installer';
|
||||||
|
|
||||||
|
import manifestData from '../data/jetbrains.json';
|
||||||
|
import os from 'os';
|
||||||
|
|
||||||
|
describe('getAvailableVersions', () => {
|
||||||
|
let spyHttpClient: jest.SpyInstance;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
|
spyHttpClient.mockReturnValue({
|
||||||
|
statusCode: 200,
|
||||||
|
headers: {},
|
||||||
|
result: []
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
afterEach(() => {
|
||||||
|
jest.resetAllMocks();
|
||||||
|
jest.clearAllMocks();
|
||||||
|
jest.restoreAllMocks();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('load available versions', async () => {
|
||||||
|
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||||
|
spyHttpClient.mockReturnValueOnce({
|
||||||
|
statusCode: 200,
|
||||||
|
headers: {},
|
||||||
|
result: manifestData as any
|
||||||
|
});
|
||||||
|
|
||||||
|
const distribution = new JetBrainsDistribution({
|
||||||
|
version: '17',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
|
expect(availableVersions).not.toBeNull();
|
||||||
|
|
||||||
|
const length =
|
||||||
|
os.platform() === 'win32'
|
||||||
|
? manifestData.length - 1
|
||||||
|
: manifestData.length + 1;
|
||||||
|
expect(availableVersions.length).toBe(length);
|
||||||
|
}, 10_000);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('findPackageForDownload', () => {
|
||||||
|
it.each([
|
||||||
|
['17', '17.0.11+1207.24'],
|
||||||
|
['11.0', '11.0.16+2043.64'],
|
||||||
|
['11.0.11', '11.0.11+1542.1'],
|
||||||
|
['21.0.2', '21.0.2+375.1'],
|
||||||
|
['21', '21.0.3+465.3'],
|
||||||
|
['x', '21.0.3+465.3']
|
||||||
|
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
||||||
|
const distribution = new JetBrainsDistribution({
|
||||||
|
version: input,
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getAvailableVersions'] = async () => manifestData as any;
|
||||||
|
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
||||||
|
expect(resolvedVersion.version).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
it.each(['17', '11.0', '11.0.11', '21.0.2', '21'])(
|
||||||
|
'version %s can be downloaded',
|
||||||
|
async input => {
|
||||||
|
const distribution = new JetBrainsDistribution({
|
||||||
|
version: input,
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getAvailableVersions'] = async () => manifestData as any;
|
||||||
|
const resolvedVersion = await distribution['findPackageForDownload'](
|
||||||
|
input
|
||||||
|
);
|
||||||
|
const url = resolvedVersion.url;
|
||||||
|
const options = {method: 'HEAD'};
|
||||||
|
|
||||||
|
https.request(url, options, res => {
|
||||||
|
// JetBrains uses 403 for inexistent packages
|
||||||
|
expect(res.statusCode).not.toBe(403);
|
||||||
|
res.resume();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
it('version is not found', async () => {
|
||||||
|
const distribution = new JetBrainsDistribution({
|
||||||
|
version: '8.0.452',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getAvailableVersions'] = async () => manifestData as any;
|
||||||
|
await expect(distribution['findPackageForDownload']('8.x')).rejects.toThrow(
|
||||||
|
/Could not find satisfied version for SemVer */
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('version list is empty', async () => {
|
||||||
|
const distribution = new JetBrainsDistribution({
|
||||||
|
version: '8',
|
||||||
|
architecture: 'x64',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
distribution['getAvailableVersions'] = async () => [];
|
||||||
|
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
||||||
|
/Could not find satisfied version for SemVer */
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -3,7 +3,8 @@ import * as core from '@actions/core';
|
|||||||
import {
|
import {
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies,
|
||||||
isCacheFeatureAvailable
|
isCacheFeatureAvailable,
|
||||||
|
isGhes
|
||||||
} from '../src/util';
|
} from '../src/util';
|
||||||
|
|
||||||
jest.mock('@actions/cache');
|
jest.mock('@actions/cache');
|
||||||
@@ -80,3 +81,41 @@ describe('convertVersionToSemver', () => {
|
|||||||
expect(actual).toBe(expected);
|
expect(actual).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('isGhes', () => {
|
||||||
|
const pristineEnv = process.env;
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
jest.resetModules();
|
||||||
|
process.env = {...pristineEnv};
|
||||||
|
});
|
||||||
|
|
||||||
|
afterAll(() => {
|
||||||
|
process.env = pristineEnv;
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is not defined', async () => {
|
||||||
|
delete process.env['GITHUB_SERVER_URL'];
|
||||||
|
expect(isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is set to github.com', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://github.com';
|
||||||
|
expect(isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable is set to a GitHub Enterprise Cloud-style URL', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://contoso.ghe.com';
|
||||||
|
expect(isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns false when the GITHUB_SERVER_URL environment variable has a .localhost suffix', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://mock-github.localhost';
|
||||||
|
expect(isGhes()).toBeFalsy();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('returns true when the GITHUB_SERVER_URL environment variable is set to some other URL', async () => {
|
||||||
|
process.env['GITHUB_SERVER_URL'] = 'https://src.onpremise.fabrikam.com';
|
||||||
|
expect(isGhes()).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|||||||
10258
dist/cleanup/index.js
vendored
10258
dist/cleanup/index.js
vendored
File diff suppressed because it is too large
Load Diff
10544
dist/setup/index.js
vendored
10544
dist/setup/index.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -10,6 +10,7 @@
|
|||||||
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
||||||
- [SapMachine](#SapMachine)
|
- [SapMachine](#SapMachine)
|
||||||
- [GraalVM](#GraalVM)
|
- [GraalVM](#GraalVM)
|
||||||
|
- [JetBrains](#JetBrains)
|
||||||
- [Installing custom Java package type](#Installing-custom-Java-package-type)
|
- [Installing custom Java package type](#Installing-custom-Java-package-type)
|
||||||
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
|
- [Installing custom Java architecture](#Installing-custom-Java-architecture)
|
||||||
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
|
- [Installing custom Java distribution from local file](#Installing-Java-from-local-file)
|
||||||
@@ -171,6 +172,64 @@ steps:
|
|||||||
native-image -cp java HelloWorldApp
|
native-image -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### JetBrains
|
||||||
|
|
||||||
|
**NOTE:** JetBrains is only available for LTS versions on 11 or later (11, 17, 21, etc.).
|
||||||
|
|
||||||
|
Not all minor LTS versions are guarenteed to be available, since JetBrains considers what to ship IntelliJ IDEA with, most commonly on JDK 11.
|
||||||
|
For example, `11.0.24` is not available but `11.0.16` is.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'jetbrains'
|
||||||
|
java-version: '11'
|
||||||
|
- run: java -cp java HelloWorldApp
|
||||||
|
```
|
||||||
|
|
||||||
|
The JetBrains installer uses the GitHub API to fetch the latest version. If you believe your project is going to be running into rate limits, you can provide a
|
||||||
|
GitHub token to the action to increase the rate limit. Set the `GITHUB_TOKEN` environment variable to the value of your GitHub token in the workflow file.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'jetbrains'
|
||||||
|
java-version: '17'
|
||||||
|
java-package: 'jdk' # optional (jdk, jre, jdk+jcef, jre+jcef, jdk+ft, or jre+ft) - defaults to jdk
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
- run: java -cp java HelloWorldApp
|
||||||
|
```
|
||||||
|
|
||||||
|
You can specify your package type (as shown in the [releases page](https://github.com/JetBrains/JetBrainsRuntime/releases/)) in the `java-package` parameter.
|
||||||
|
The available package types are:
|
||||||
|
|
||||||
|
- `jdk` - JBRSDK
|
||||||
|
- `jre` - JBR (Vanilla)
|
||||||
|
- `jdk+jcef` - JBRSDK with JCEF
|
||||||
|
- `jre+jcef` - JBR with JCEF
|
||||||
|
- `jdk+ft` - JBRSDK (FreeType)
|
||||||
|
- `jre+ft` - JBR (FreeType)
|
||||||
|
|
||||||
|
### GraalVM
|
||||||
|
**NOTE:** Oracle GraalVM is only available for JDK 17 and later.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-java@v4
|
||||||
|
with:
|
||||||
|
distribution: 'graalvm'
|
||||||
|
java-version: '21'
|
||||||
|
- run: |
|
||||||
|
java -cp java HelloWorldApp
|
||||||
|
native-image -cp java HelloWorldApp
|
||||||
|
```
|
||||||
|
|
||||||
## Installing custom Java package type
|
## Installing custom Java package type
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
@@ -183,7 +242,6 @@ steps:
|
|||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Installing custom Java architecture
|
## Installing custom Java architecture
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
243
package-lock.json
generated
243
package-lock.json
generated
@@ -9,8 +9,8 @@
|
|||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.4",
|
"@actions/cache": "^4.0.0",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.11.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/glob": "^0.4.0",
|
"@actions/glob": "^0.4.0",
|
||||||
"@actions/http-client": "^2.2.1",
|
"@actions/http-client": "^2.2.1",
|
||||||
@@ -47,11 +47,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache": {
|
"node_modules/@actions/cache": {
|
||||||
"version": "3.2.4",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
|
||||||
"integrity": "sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==",
|
"integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.0.1",
|
||||||
"@actions/glob": "^0.1.0",
|
"@actions/glob": "^0.1.0",
|
||||||
"@actions/http-client": "^2.1.1",
|
"@actions/http-client": "^2.1.1",
|
||||||
@@ -59,8 +59,9 @@
|
|||||||
"@azure/abort-controller": "^1.1.0",
|
"@azure/abort-controller": "^1.1.0",
|
||||||
"@azure/ms-rest-js": "^2.6.0",
|
"@azure/ms-rest-js": "^2.6.0",
|
||||||
"@azure/storage-blob": "^12.13.0",
|
"@azure/storage-blob": "^12.13.0",
|
||||||
|
"@protobuf-ts/plugin": "^2.9.4",
|
||||||
"semver": "^6.3.1",
|
"semver": "^6.3.1",
|
||||||
"uuid": "^3.3.3"
|
"twirp-ts": "^2.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
||||||
@@ -81,20 +82,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.10.1",
|
"version": "1.11.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
||||||
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
|
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/http-client": "^2.0.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"uuid": "^8.3.2"
|
"@actions/http-client": "^2.0.1"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@actions/core/node_modules/uuid": {
|
|
||||||
"version": "8.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
|
||||||
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
|
|
||||||
"bin": {
|
|
||||||
"uuid": "dist/bin/uuid"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/exec": {
|
"node_modules/@actions/exec": {
|
||||||
@@ -1604,6 +1597,76 @@
|
|||||||
"node": ">=8.0.0"
|
"node": ">=8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@protobuf-ts/plugin": {
|
||||||
|
"version": "2.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
|
||||||
|
"integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@protobuf-ts/plugin-framework": "^2.9.4",
|
||||||
|
"@protobuf-ts/protoc": "^2.9.4",
|
||||||
|
"@protobuf-ts/runtime": "^2.9.4",
|
||||||
|
"@protobuf-ts/runtime-rpc": "^2.9.4",
|
||||||
|
"typescript": "^3.9"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"protoc-gen-dump": "bin/protoc-gen-dump",
|
||||||
|
"protoc-gen-ts": "bin/protoc-gen-ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/plugin-framework": {
|
||||||
|
"version": "2.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
|
||||||
|
"integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
|
||||||
|
"dependencies": {
|
||||||
|
"@protobuf-ts/runtime": "^2.9.4",
|
||||||
|
"typescript": "^3.9"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/plugin-framework/node_modules/typescript": {
|
||||||
|
"version": "3.9.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
|
||||||
|
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/plugin/node_modules/typescript": {
|
||||||
|
"version": "3.9.10",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
|
||||||
|
"integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/protoc": {
|
||||||
|
"version": "2.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
|
||||||
|
"integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==",
|
||||||
|
"bin": {
|
||||||
|
"protoc": "protoc.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/runtime": {
|
||||||
|
"version": "2.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
|
||||||
|
"integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg=="
|
||||||
|
},
|
||||||
|
"node_modules/@protobuf-ts/runtime-rpc": {
|
||||||
|
"version": "2.9.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
|
||||||
|
"integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@protobuf-ts/runtime": "^2.9.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@sinclair/typebox": {
|
"node_modules/@sinclair/typebox": {
|
||||||
"version": "0.27.8",
|
"version": "0.27.8",
|
||||||
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
|
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz",
|
||||||
@@ -2328,6 +2391,15 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/camel-case": {
|
||||||
|
"version": "4.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz",
|
||||||
|
"integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==",
|
||||||
|
"dependencies": {
|
||||||
|
"pascal-case": "^3.1.2",
|
||||||
|
"tslib": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/camelcase": {
|
"node_modules/camelcase": {
|
||||||
"version": "5.3.1",
|
"version": "5.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||||
@@ -2462,6 +2534,14 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/commander": {
|
||||||
|
"version": "6.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz",
|
||||||
|
"integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/concat-map": {
|
"node_modules/concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
@@ -2495,10 +2575,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-key": "^3.1.0",
|
"path-key": "^3.1.0",
|
||||||
"shebang-command": "^2.0.0",
|
"shebang-command": "^2.0.0",
|
||||||
@@ -2604,6 +2685,18 @@
|
|||||||
"node": ">=6.0.0"
|
"node": ">=6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dot-object": {
|
||||||
|
"version": "2.1.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/dot-object/-/dot-object-2.1.5.tgz",
|
||||||
|
"integrity": "sha512-xHF8EP4XH/Ba9fvAF2LDd5O3IITVolerVV6xvkxoM8zlGEiCUrggpAnHyOoKJKCrhvPcGATFAUwIujj7bRG5UA==",
|
||||||
|
"dependencies": {
|
||||||
|
"commander": "^6.1.0",
|
||||||
|
"glob": "^7.1.6"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"dot-object": "bin/dot-object"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.4.589",
|
"version": "1.4.589",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.589.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.589.tgz",
|
||||||
@@ -3165,8 +3258,7 @@
|
|||||||
"node_modules/fs.realpath": {
|
"node_modules/fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
|
"integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/fsevents": {
|
"node_modules/fsevents": {
|
||||||
"version": "2.3.3",
|
"version": "2.3.3",
|
||||||
@@ -3234,7 +3326,6 @@
|
|||||||
"version": "7.2.3",
|
"version": "7.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
|
||||||
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
"integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
"inflight": "^1.0.4",
|
"inflight": "^1.0.4",
|
||||||
@@ -3402,7 +3493,6 @@
|
|||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
"integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"once": "^1.3.0",
|
"once": "^1.3.0",
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
@@ -3411,8 +3501,7 @@
|
|||||||
"node_modules/inherits": {
|
"node_modules/inherits": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/is-arrayish": {
|
"node_modules/is-arrayish": {
|
||||||
"version": "0.2.1",
|
"version": "0.2.1",
|
||||||
@@ -4255,6 +4344,11 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/lodash": {
|
||||||
|
"version": "4.17.21",
|
||||||
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
|
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
||||||
|
},
|
||||||
"node_modules/lodash.memoize": {
|
"node_modules/lodash.memoize": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
|
||||||
@@ -4267,6 +4361,14 @@
|
|||||||
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
"integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/lower-case": {
|
||||||
|
"version": "2.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz",
|
||||||
|
"integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==",
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lru-cache": {
|
"node_modules/lru-cache": {
|
||||||
"version": "5.1.1",
|
"version": "5.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
|
||||||
@@ -4322,12 +4424,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.5",
|
"version": "4.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.2",
|
"braces": "^3.0.3",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -4391,6 +4494,15 @@
|
|||||||
"integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
|
"integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/no-case": {
|
||||||
|
"version": "3.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz",
|
||||||
|
"integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==",
|
||||||
|
"dependencies": {
|
||||||
|
"lower-case": "^2.0.2",
|
||||||
|
"tslib": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "2.7.0",
|
"version": "2.7.0",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz",
|
||||||
@@ -4466,7 +4578,6 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
"integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
|
||||||
"dev": true,
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@@ -4572,6 +4683,15 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pascal-case": {
|
||||||
|
"version": "3.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz",
|
||||||
|
"integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==",
|
||||||
|
"dependencies": {
|
||||||
|
"no-case": "^3.0.4",
|
||||||
|
"tslib": "^2.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/path-exists": {
|
"node_modules/path-exists": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
|
||||||
@@ -4585,7 +4705,6 @@
|
|||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
|
"integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
|
||||||
"dev": true,
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
@@ -4605,6 +4724,11 @@
|
|||||||
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
"integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/path-to-regexp": {
|
||||||
|
"version": "6.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-6.3.0.tgz",
|
||||||
|
"integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ=="
|
||||||
|
},
|
||||||
"node_modules/path-type": {
|
"node_modules/path-type": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
|
||||||
@@ -4718,7 +4842,6 @@
|
|||||||
"version": "2.8.8",
|
"version": "2.8.8",
|
||||||
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
|
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz",
|
||||||
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
|
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==",
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"prettier": "bin-prettier.js"
|
"prettier": "bin-prettier.js"
|
||||||
},
|
},
|
||||||
@@ -5257,6 +5380,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ts-poet": {
|
||||||
|
"version": "4.15.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ts-poet/-/ts-poet-4.15.0.tgz",
|
||||||
|
"integrity": "sha512-sLLR8yQBvHzi9d4R1F4pd+AzQxBfzOSSjfxiJxQhkUoH5bL7RsAC6wgvtVUQdGqiCsyS9rT6/8X2FI7ipdir5g==",
|
||||||
|
"dependencies": {
|
||||||
|
"lodash": "^4.17.15",
|
||||||
|
"prettier": "^2.5.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tslib": {
|
"node_modules/tslib": {
|
||||||
"version": "2.6.2",
|
"version": "2.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz",
|
||||||
@@ -5291,6 +5423,34 @@
|
|||||||
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
"node": ">=0.6.11 <=0.7.0 || >=0.7.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/twirp-ts": {
|
||||||
|
"version": "2.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/twirp-ts/-/twirp-ts-2.5.0.tgz",
|
||||||
|
"integrity": "sha512-JTKIK5Pf/+3qCrmYDFlqcPPUx+ohEWKBaZy8GL8TmvV2VvC0SXVyNYILO39+GCRbqnuP6hBIF+BVr8ZxRz+6fw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@protobuf-ts/plugin-framework": "^2.0.7",
|
||||||
|
"camel-case": "^4.1.2",
|
||||||
|
"dot-object": "^2.1.4",
|
||||||
|
"path-to-regexp": "^6.2.0",
|
||||||
|
"ts-poet": "^4.5.0",
|
||||||
|
"yaml": "^1.10.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"protoc-gen-twirp_ts": "protoc-gen-twirp_ts"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@protobuf-ts/plugin": "^2.5.0",
|
||||||
|
"ts-proto": "^1.81.3"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@protobuf-ts/plugin": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"ts-proto": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/type-check": {
|
"node_modules/type-check": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
|
||||||
@@ -5459,8 +5619,7 @@
|
|||||||
"node_modules/wrappy": {
|
"node_modules/wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
|
"integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"node_modules/write-file-atomic": {
|
"node_modules/write-file-atomic": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
@@ -5545,6 +5704,14 @@
|
|||||||
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/yaml": {
|
||||||
|
"version": "1.10.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
|
||||||
|
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/yargs": {
|
"node_modules/yargs": {
|
||||||
"version": "17.7.2",
|
"version": "17.7.2",
|
||||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||||
|
|||||||
@@ -26,8 +26,8 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^3.2.4",
|
"@actions/cache": "^4.0.0",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.11.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/glob": "^0.4.0",
|
"@actions/glob": "^0.4.0",
|
||||||
"@actions/http-client": "^2.2.1",
|
"@actions/http-client": "^2.2.1",
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
|
|
||||||
export enum AdoptImplementation {
|
export enum AdoptImplementation {
|
||||||
@@ -73,11 +74,13 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ import path from 'path';
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
convertVersionToSemver
|
convertVersionToSemver,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {JavaBase} from '../base-installer';
|
import {JavaBase} from '../base-installer';
|
||||||
import {
|
import {
|
||||||
@@ -29,14 +30,14 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
|
const extension = getDownloadArchiveExtension();
|
||||||
const extractedJavaPath = await extractJdkFile(
|
if (process.platform === 'win32') {
|
||||||
javaArchivePath,
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
getDownloadArchiveExtension()
|
}
|
||||||
);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import {OracleDistribution} from './oracle/installer';
|
|||||||
import {DragonwellDistribution} from './dragonwell/installer';
|
import {DragonwellDistribution} from './dragonwell/installer';
|
||||||
import {SapMachineDistribution} from './sapmachine/installer';
|
import {SapMachineDistribution} from './sapmachine/installer';
|
||||||
import {GraalVMDistribution} from './graalvm/installer';
|
import {GraalVMDistribution} from './graalvm/installer';
|
||||||
|
import {JetBrainsDistribution} from './jetbrains/installer';
|
||||||
|
|
||||||
enum JavaDistribution {
|
enum JavaDistribution {
|
||||||
Adopt = 'adopt',
|
Adopt = 'adopt',
|
||||||
@@ -27,7 +28,8 @@ enum JavaDistribution {
|
|||||||
Oracle = 'oracle',
|
Oracle = 'oracle',
|
||||||
Dragonwell = 'dragonwell',
|
Dragonwell = 'dragonwell',
|
||||||
SapMachine = 'sapmachine',
|
SapMachine = 'sapmachine',
|
||||||
GraalVM = 'graalvm'
|
GraalVM = 'graalvm',
|
||||||
|
JetBrains = 'jetbrains'
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getJavaDistribution(
|
export function getJavaDistribution(
|
||||||
@@ -72,6 +74,8 @@ export function getJavaDistribution(
|
|||||||
return new SapMachineDistribution(installerOptions);
|
return new SapMachineDistribution(installerOptions);
|
||||||
case JavaDistribution.GraalVM:
|
case JavaDistribution.GraalVM:
|
||||||
return new GraalVMDistribution(installerOptions);
|
return new GraalVMDistribution(installerOptions);
|
||||||
|
case JavaDistribution.JetBrains:
|
||||||
|
return new JetBrainsDistribution(installerOptions);
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import {
|
|||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
getGitHubHttpHeaders,
|
getGitHubHttpHeaders,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {IDragonwellVersions, IDragonwellAllVersions} from './models';
|
import {IDragonwellVersions, IDragonwellAllVersions} from './models';
|
||||||
import {
|
import {
|
||||||
@@ -100,14 +101,14 @@ export class DragonwellDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
|
const extension = getDownloadArchiveExtension();
|
||||||
const extractedJavaPath = await extractJdkFile(
|
if (process.platform === 'win32') {
|
||||||
javaArchivePath,
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
getDownloadArchiveExtension()
|
}
|
||||||
);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
getGitHubHttpHeaders
|
getGitHubHttpHeaders,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {HttpCodes} from '@actions/http-client';
|
import {HttpCodes} from '@actions/http-client';
|
||||||
import {GraalVMEAVersion} from './models';
|
import {GraalVMEAVersion} from './models';
|
||||||
@@ -33,11 +34,13 @@ export class GraalVMDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
|
|||||||
233
src/distributions/jetbrains/installer.ts
Normal file
233
src/distributions/jetbrains/installer.ts
Normal file
@@ -0,0 +1,233 @@
|
|||||||
|
import * as core from '@actions/core';
|
||||||
|
import * as tc from '@actions/tool-cache';
|
||||||
|
|
||||||
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
|
import {JavaBase} from '../base-installer';
|
||||||
|
import {IJetBrainsRawVersion, IJetBrainsVersion} from './models';
|
||||||
|
import {
|
||||||
|
JavaDownloadRelease,
|
||||||
|
JavaInstallerOptions,
|
||||||
|
JavaInstallerResults
|
||||||
|
} from '../base-models';
|
||||||
|
import {extractJdkFile, isVersionSatisfies} from '../../util';
|
||||||
|
import {OutgoingHttpHeaders} from 'http';
|
||||||
|
import {HttpCodes} from '@actions/http-client';
|
||||||
|
|
||||||
|
export class JetBrainsDistribution extends JavaBase {
|
||||||
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
|
super('JetBrains', installerOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async findPackageForDownload(
|
||||||
|
range: string
|
||||||
|
): Promise<JavaDownloadRelease> {
|
||||||
|
const versionsRaw = await this.getAvailableVersions();
|
||||||
|
|
||||||
|
const versions = versionsRaw.map(v => {
|
||||||
|
const formattedVersion = `${v.semver}+${v.build}`;
|
||||||
|
|
||||||
|
return {
|
||||||
|
version: formattedVersion,
|
||||||
|
url: v.url
|
||||||
|
} as JavaDownloadRelease;
|
||||||
|
});
|
||||||
|
|
||||||
|
const satisfiedVersions = versions
|
||||||
|
.filter(item => isVersionSatisfies(range, item.version))
|
||||||
|
.sort((a, b) => {
|
||||||
|
return -semver.compareBuild(a.version, b.version);
|
||||||
|
});
|
||||||
|
|
||||||
|
const resolvedFullVersion =
|
||||||
|
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
||||||
|
if (!resolvedFullVersion) {
|
||||||
|
const availableOptions = versionsRaw
|
||||||
|
.map(item => `${item.tag_name} (${item.semver}+${item.build})`)
|
||||||
|
.join(', ');
|
||||||
|
const availableOptionsMessage = availableOptions
|
||||||
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
|
: '';
|
||||||
|
throw new Error(
|
||||||
|
`Could not find satisfied version for SemVer '${range}'. ${availableOptionsMessage}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolvedFullVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
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, 'tar.gz');
|
||||||
|
|
||||||
|
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 async getAvailableVersions(): Promise<IJetBrainsVersion[]> {
|
||||||
|
const platform = this.getPlatformOption();
|
||||||
|
const arch = this.distributionArchitecture();
|
||||||
|
|
||||||
|
if (core.isDebug()) {
|
||||||
|
console.time('Retrieving available versions for JBR took'); // eslint-disable-line no-console
|
||||||
|
}
|
||||||
|
|
||||||
|
// need to iterate through all pages to retrieve the list of all versions
|
||||||
|
// GitHub API doesn't provide way to retrieve the count of pages to iterate so infinity loop
|
||||||
|
let page_index = 1;
|
||||||
|
const rawVersions: IJetBrainsRawVersion[] = [];
|
||||||
|
const bearerToken = process.env.GITHUB_TOKEN;
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
const requestArguments = `per_page=100&page=${page_index}`;
|
||||||
|
const requestHeaders: OutgoingHttpHeaders = {};
|
||||||
|
|
||||||
|
if (bearerToken) {
|
||||||
|
requestHeaders['Authorization'] = `Bearer ${bearerToken}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
const rawUrl = `https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases?${requestArguments}`;
|
||||||
|
|
||||||
|
if (core.isDebug() && page_index === 1) {
|
||||||
|
// url is identical except page_index so print it once for debug
|
||||||
|
core.debug(`Gathering available versions from '${rawUrl}'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const paginationPage = (
|
||||||
|
await this.http.getJson<IJetBrainsRawVersion[]>(rawUrl, requestHeaders)
|
||||||
|
).result;
|
||||||
|
if (!paginationPage || paginationPage.length === 0) {
|
||||||
|
// break infinity loop because we have reached end of pagination
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
rawVersions.push(...paginationPage);
|
||||||
|
page_index++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add versions not available from the API but are downloadable
|
||||||
|
const hidden = ['11_0_10b1145.115', '11_0_11b1341.60'];
|
||||||
|
rawVersions.push(...hidden.map(tag => ({tag_name: tag, name: tag})));
|
||||||
|
|
||||||
|
const versions0 = rawVersions.map(async v => {
|
||||||
|
// Release tags look like one of these:
|
||||||
|
// jbr-release-21.0.3b465.3
|
||||||
|
// jbr17-b87.7
|
||||||
|
// jb11_0_11-b87.7
|
||||||
|
// jbr11_0_15b2043.56
|
||||||
|
// 11_0_11b1536.2
|
||||||
|
// 11_0_11-b1522
|
||||||
|
const tag = v.tag_name;
|
||||||
|
|
||||||
|
// Extract version string
|
||||||
|
const vstring = tag
|
||||||
|
.replace('jbr-release-', '')
|
||||||
|
.replace('jbr', '')
|
||||||
|
.replace('jb', '')
|
||||||
|
.replace('-', '');
|
||||||
|
|
||||||
|
const vsplit = vstring.split('b');
|
||||||
|
let semver = vsplit[0];
|
||||||
|
const build = +vsplit[1];
|
||||||
|
|
||||||
|
// Normalize semver
|
||||||
|
if (!semver.includes('.') && !semver.includes('_'))
|
||||||
|
semver = `${semver}.0.0`;
|
||||||
|
|
||||||
|
// Construct URL
|
||||||
|
let type: string;
|
||||||
|
switch (this.packageType ?? '') {
|
||||||
|
case 'jre':
|
||||||
|
type = 'jbr';
|
||||||
|
break;
|
||||||
|
case 'jdk+jcef':
|
||||||
|
type = 'jbrsdk_jcef';
|
||||||
|
break;
|
||||||
|
case 'jre+jcef':
|
||||||
|
type = 'jbr_jcef';
|
||||||
|
break;
|
||||||
|
case 'jdk+ft':
|
||||||
|
type = 'jbrsdk_ft';
|
||||||
|
break;
|
||||||
|
case 'jre+ft':
|
||||||
|
type = 'jbr_ft';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
type = 'jbrsdk';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
let url = `https://cache-redirector.jetbrains.com/intellij-jbr/${type}-${semver}-${platform}-${arch}-b${build}.tar.gz`;
|
||||||
|
let include = false;
|
||||||
|
|
||||||
|
const res = await this.http.head(url);
|
||||||
|
if (res.message.statusCode === HttpCodes.OK) {
|
||||||
|
include = true;
|
||||||
|
} else {
|
||||||
|
url = `https://cache-redirector.jetbrains.com/intellij-jbr/${type}_nomod-${semver}-${platform}-${arch}-b${build}.tar.gz`;
|
||||||
|
const res2 = await this.http.head(url);
|
||||||
|
if (res2.message.statusCode === HttpCodes.OK) {
|
||||||
|
include = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const version = {
|
||||||
|
tag_name: tag,
|
||||||
|
semver: semver.replace(/_/g, '.'),
|
||||||
|
build: build,
|
||||||
|
url: url
|
||||||
|
} as IJetBrainsVersion;
|
||||||
|
|
||||||
|
return {
|
||||||
|
item: version,
|
||||||
|
include: include
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
const versions = await Promise.all(versions0).then(res =>
|
||||||
|
res.filter(item => item.include).map(item => item.item)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (core.isDebug()) {
|
||||||
|
core.startGroup('Print information about available versions');
|
||||||
|
console.timeEnd('Retrieving available versions for JBR took'); // eslint-disable-line no-console
|
||||||
|
core.debug(`Available versions: [${versions.length}]`);
|
||||||
|
core.debug(versions.map(item => item.semver).join(', '));
|
||||||
|
core.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
return versions;
|
||||||
|
}
|
||||||
|
|
||||||
|
private getPlatformOption(): string {
|
||||||
|
// Jetbrains has own platform names so need to map them
|
||||||
|
switch (process.platform) {
|
||||||
|
case 'darwin':
|
||||||
|
return 'osx';
|
||||||
|
case 'win32':
|
||||||
|
return 'windows';
|
||||||
|
default:
|
||||||
|
return process.platform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
13
src/distributions/jetbrains/models.ts
Normal file
13
src/distributions/jetbrains/models.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
// Raw Model from https://api.github.com/repos/JetBrains/JetBrainsRuntime/releases
|
||||||
|
|
||||||
|
export interface IJetBrainsRawVersion {
|
||||||
|
tag_name: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IJetBrainsVersion {
|
||||||
|
tag_name: string;
|
||||||
|
semver: string;
|
||||||
|
build: number;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
@@ -8,7 +8,8 @@ import semver from 'semver';
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {ArchitectureOptions, LibericaVersion, OsVersions} from './models';
|
import {ArchitectureOptions, LibericaVersion, OsVersions} from './models';
|
||||||
@@ -35,13 +36,8 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
if (
|
if (process.platform === 'win32') {
|
||||||
process.platform === 'win32' &&
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
(this.architecture === 'arm64' || this.architecture === 'aarch64')
|
|
||||||
) {
|
|
||||||
const javaArchivePathRenamed = `${javaArchivePath}.zip`;
|
|
||||||
await fs.renameSync(javaArchivePath, javaArchivePathRenamed);
|
|
||||||
javaArchivePath = javaArchivePathRenamed;
|
|
||||||
}
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
getGitHubHttpHeaders
|
getGitHubHttpHeaders,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
@@ -27,22 +28,12 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
// Rename archive to add extension because after downloading
|
|
||||||
// archive does not contain extension type and it leads to some issues
|
|
||||||
// on Windows runners without PowerShell Core.
|
|
||||||
//
|
|
||||||
// For default PowerShell Windows it should contain extension type to unpack it.
|
|
||||||
if (
|
|
||||||
process.platform === 'win32' &&
|
|
||||||
(this.architecture === 'arm64' || this.architecture === 'aarch64')
|
|
||||||
) {
|
|
||||||
const javaArchivePathRenamed = `${javaArchivePath}.zip`;
|
|
||||||
await fs.renameSync(javaArchivePath, javaArchivePathRenamed);
|
|
||||||
javaArchivePath = javaArchivePathRenamed;
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
|
|||||||
@@ -10,7 +10,11 @@ import {
|
|||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
JavaInstallerResults
|
JavaInstallerResults
|
||||||
} from '../base-models';
|
} from '../base-models';
|
||||||
import {extractJdkFile, getDownloadArchiveExtension} from '../../util';
|
import {
|
||||||
|
extractJdkFile,
|
||||||
|
getDownloadArchiveExtension,
|
||||||
|
renameWinArchive
|
||||||
|
} from '../../util';
|
||||||
import {HttpCodes} from '@actions/http-client';
|
import {HttpCodes} from '@actions/http-client';
|
||||||
|
|
||||||
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
||||||
@@ -26,11 +30,13 @@ export class OracleDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ import {
|
|||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
getGitHubHttpHeaders,
|
getGitHubHttpHeaders,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {JavaBase} from '../base-installer';
|
import {JavaBase} from '../base-installer';
|
||||||
import {
|
import {
|
||||||
@@ -104,14 +105,14 @@ export class SapMachineDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
|
const extension = getDownloadArchiveExtension();
|
||||||
const extractedJavaPath = await extractJdkFile(
|
if (process.platform === 'win32') {
|
||||||
javaArchivePath,
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
getDownloadArchiveExtension()
|
}
|
||||||
);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ import semver from 'semver';
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
@@ -98,11 +99,13 @@ export class SemeruDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath: string = await extractJdkFile(
|
const extractedJavaPath: string = await extractJdkFile(
|
||||||
javaArchivePath,
|
javaArchivePath,
|
||||||
extension
|
extension
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
|
|
||||||
export enum TemurinImplementation {
|
export enum TemurinImplementation {
|
||||||
@@ -76,11 +77,13 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import {
|
|||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
isVersionSatisfies
|
isVersionSatisfies,
|
||||||
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
@@ -80,13 +81,8 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
if (
|
if (process.platform === 'win32') {
|
||||||
process.platform === 'win32' &&
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
(this.architecture === 'arm64' || this.architecture === 'aarch64')
|
|
||||||
) {
|
|
||||||
const javaArchivePathRenamed = `${javaArchivePath}.zip`;
|
|
||||||
await fs.renameSync(javaArchivePath, javaArchivePathRenamed);
|
|
||||||
javaArchivePath = javaArchivePathRenamed;
|
|
||||||
}
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
||||||
|
|
||||||
|
|||||||
19
src/util.ts
19
src/util.ts
@@ -92,7 +92,13 @@ export function isGhes(): boolean {
|
|||||||
const ghUrl = new URL(
|
const ghUrl = new URL(
|
||||||
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
|
||||||
);
|
);
|
||||||
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
|
||||||
|
const hostname = ghUrl.hostname.trimEnd().toUpperCase();
|
||||||
|
const isGitHubHost = hostname === 'GITHUB.COM';
|
||||||
|
const isGitHubEnterpriseCloudHost = hostname.endsWith('.GHE.COM');
|
||||||
|
const isLocalHost = hostname.endsWith('.LOCALHOST');
|
||||||
|
|
||||||
|
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isCacheFeatureAvailable(): boolean {
|
export function isCacheFeatureAvailable(): boolean {
|
||||||
@@ -190,3 +196,14 @@ export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
|
|||||||
}
|
}
|
||||||
return headers;
|
return headers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Rename archive to add extension because after downloading
|
||||||
|
// archive does not contain extension type and it leads to some issues
|
||||||
|
// on Windows runners without PowerShell Core.
|
||||||
|
//
|
||||||
|
// For default PowerShell Windows it should contain extension type to unpack it.
|
||||||
|
export function renameWinArchive(javaArchivePath: string): string {
|
||||||
|
const javaArchivePathRenamed = `${javaArchivePath}.zip`;
|
||||||
|
fs.renameSync(javaArchivePath, javaArchivePathRenamed);
|
||||||
|
return javaArchivePathRenamed;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user