mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-10 03:06:29 +08:00
Compare commits
4 Commits
upgrade-ca
...
test-drago
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
20ca5fe3b6 | ||
|
|
2dc45a974d | ||
|
|
7455bac0c6 | ||
|
|
605d46d6dc |
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-22.04]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
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-22.04]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
needs: sbt-save
|
needs: sbt-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
133
.github/workflows/e2e-versions.yml
vendored
133
.github/workflows/e2e-versions.yml
vendored
@@ -30,9 +30,7 @@ jobs:
|
|||||||
'microsoft',
|
'microsoft',
|
||||||
'semeru',
|
'semeru',
|
||||||
'corretto',
|
'corretto',
|
||||||
'dragonwell',
|
'dragonwell'
|
||||||
'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:
|
||||||
@@ -46,22 +44,11 @@ jobs:
|
|||||||
version: 17
|
version: 17
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
version: 21
|
version: 20
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: 21
|
version: 20
|
||||||
- distribution: graalvm
|
|
||||||
os: macos-latest
|
|
||||||
version: 17.0.12
|
|
||||||
- distribution: graalvm
|
|
||||||
os: windows-latest
|
|
||||||
version: 21
|
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: 21
|
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '24-ea'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -71,8 +58,6 @@ 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
|
||||||
@@ -93,25 +78,13 @@ jobs:
|
|||||||
include:
|
include:
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '21.0.4'
|
version: '20.0.1'
|
||||||
- distribution: graalvm
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '21.0.4'
|
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '11.0'
|
version: '11.0'
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '11.0.13+9'
|
version: '11.0.13+9'
|
||||||
- distribution: sapmachine
|
|
||||||
os: ubuntu-latest
|
|
||||||
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
|
||||||
@@ -124,8 +97,6 @@ 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 }}
|
||||||
@@ -135,15 +106,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
||||||
[
|
|
||||||
'temurin',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'dragonwell',
|
|
||||||
'sapmachine',
|
|
||||||
'jetbrains'
|
|
||||||
]
|
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
@@ -157,8 +120,6 @@ 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
|
||||||
@@ -171,15 +132,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
||||||
[
|
|
||||||
'temurin',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'dragonwell',
|
|
||||||
'sapmachine',
|
|
||||||
'jetbrains'
|
|
||||||
]
|
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-latest
|
os: macos-latest
|
||||||
@@ -194,8 +147,6 @@ 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"
|
||||||
@@ -257,28 +208,6 @@ jobs:
|
|||||||
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
|
||||||
|
|
||||||
setup-java-ea-versions-sapmachine:
|
|
||||||
name: sapmachine ${{ matrix.version }} (jdk-x64) - ${{ matrix.os }}
|
|
||||||
needs: setup-java-major-minor-versions
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
|
||||||
version: ['17-ea', '21-ea']
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: setup-java
|
|
||||||
uses: ./
|
|
||||||
id: setup-java
|
|
||||||
with:
|
|
||||||
java-version: ${{ matrix.version }}
|
|
||||||
distribution: sapmachine
|
|
||||||
- name: Verify Java
|
|
||||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
setup-java-custom-package-type:
|
setup-java-custom-package-type:
|
||||||
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} ${{ matrix.version }} (${{ matrix.java-package }}-x64) - ${{ matrix.os }}
|
||||||
needs: setup-java-major-minor-versions
|
needs: setup-java-major-minor-versions
|
||||||
@@ -287,8 +216,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-13, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution: ['temurin', 'zulu', 'liberica', 'semeru']
|
||||||
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
|
|
||||||
java-package: ['jre']
|
java-package: ['jre']
|
||||||
version: ['17.0']
|
version: ['17.0']
|
||||||
include:
|
include:
|
||||||
@@ -312,47 +240,6 @@ 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
|
||||||
@@ -363,8 +250,6 @@ 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
|
||||||
@@ -378,7 +263,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-22.04]
|
os: [windows-latest, ubuntu-latest]
|
||||||
distribution: ['liberica', 'zulu', 'corretto']
|
distribution: ['liberica', 'zulu', 'corretto']
|
||||||
version: ['11']
|
version: ['11']
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
20
.github/workflows/publish-immutable-actions.yml
vendored
20
.github/workflows/publish-immutable-actions.yml
vendored
@@ -1,20 +0,0 @@
|
|||||||
name: 'Publish Immutable Action Version'
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
publish:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
id-token: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checking out
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Publish
|
|
||||||
id: publish
|
|
||||||
uses: actions/publish-immutable-action@0.0.3
|
|
||||||
@@ -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.3.0
|
uses: actions/publish-action@v0.2.2
|
||||||
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: 4.0.0
|
version: 3.2.4
|
||||||
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.11.1
|
version: 1.10.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
|
||||||
|
|||||||
@@ -108,9 +108,6 @@ Currently, the following distributions are supported:
|
|||||||
| `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) |
|
| `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)
|
| `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/)
|
| `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)
|
|
||||||
| `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.
|
||||||
|
|
||||||
@@ -260,8 +257,6 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
||||||
- [Oracle](docs/advanced-usage.md#Oracle)
|
- [Oracle](docs/advanced-usage.md#Oracle)
|
||||||
- [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
|
- [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
|
||||||
- [SapMachine](docs/advanced-usage.md#SapMachine)
|
|
||||||
- [GraalVM](docs/advanced-usage.md#GraalVM)
|
|
||||||
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
- [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 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)
|
- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,152 +0,0 @@
|
|||||||
import {GraalVMDistribution} from '../../src/distributions/graalvm/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: GraalVMDistribution;
|
|
||||||
let spyDebug: jest.SpyInstance;
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
distribution = new GraalVMDistribution({
|
|
||||||
version: '',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
spyDebug = jest.spyOn(core, 'debug');
|
|
||||||
spyDebug.mockImplementation(() => {});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'21',
|
|
||||||
'21',
|
|
||||||
'https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.4',
|
|
||||||
'21.0.4',
|
|
||||||
'https://download.oracle.com/graalvm/21/archive/graalvm-jdk-21.0.4_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'17',
|
|
||||||
'https://download.oracle.com/graalvm/17/latest/graalvm-jdk-17_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.12',
|
|
||||||
'17.0.12',
|
|
||||||
'https://download.oracle.com/graalvm/17/archive/graalvm-jdk-17.0.12_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
|
||||||
]
|
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
|
||||||
/* Needed only for this particular test because /latest/ urls tend to change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.version).toBe(expectedVersion);
|
|
||||||
const osType = distribution.getPlatform();
|
|
||||||
const archiveType = getDownloadArchiveExtension();
|
|
||||||
const url = expectedUrl
|
|
||||||
.replace('{{OS_TYPE}}', osType)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archiveType);
|
|
||||||
expect(result.url).toBe(url);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'24-ea',
|
|
||||||
/^https:\/\/github\.com\/graalvm\/oracle-graalvm-ea-builds\/releases\/download\/jdk-24\.0\.0-ea\./
|
|
||||||
]
|
|
||||||
])('version is %s -> %s', async (version, expectedUrlPrefix) => {
|
|
||||||
/* Needed only for this particular test because /latest/ urls tend to change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
const eaDistro = new GraalVMDistribution({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const versionWithoutEA = version.split('-')[0];
|
|
||||||
const result = await eaDistro['findPackageForDownload'](versionWithoutEA);
|
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.url).toEqual(expect.stringMatching(expectedUrlPrefix));
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['amd64', 'x64'],
|
|
||||||
['arm64', 'aarch64']
|
|
||||||
])(
|
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
|
||||||
async (osArch: string, distroArch: string) => {
|
|
||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
|
||||||
|
|
||||||
const version = '21';
|
|
||||||
const distro = new GraalVMDistribution({
|
|
||||||
version,
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const osType = distribution.getPlatform();
|
|
||||||
if (osType === 'windows' && distroArch == 'aarch64') {
|
|
||||||
return; // skip, aarch64 is not available for Windows
|
|
||||||
}
|
|
||||||
const archiveType = getDownloadArchiveExtension();
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
|
||||||
const expectedUrl = `https://download.oracle.com/graalvm/21/latest/graalvm-jdk-21_${osType}-${distroArch}_bin.${archiveType}`;
|
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw an error', async () => {
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
/GraalVM is only supported for JDK 17 and later/
|
|
||||||
);
|
|
||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
|
||||||
/GraalVM is only supported for JDK 17 and later/
|
|
||||||
);
|
|
||||||
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
|
|
||||||
/Could not find GraalVM for SemVer */
|
|
||||||
);
|
|
||||||
|
|
||||||
const unavailableEADistro = new GraalVMDistribution({
|
|
||||||
version: '17-ea',
|
|
||||||
architecture: '', // to get default value
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
await expect(
|
|
||||||
unavailableEADistro['findPackageForDownload']('17')
|
|
||||||
).rejects.toThrow(
|
|
||||||
/No GraalVM EA build found\. Are you sure java-version: '17-ea' is correct\?/
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,120 +0,0 @@
|
|||||||
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 */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,294 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {SapMachineDistribution} from '../../src/distributions/sapmachine/installer';
|
|
||||||
import * as utils from '../../src/util';
|
|
||||||
|
|
||||||
import manifestData from '../data/sapmachine.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: SapMachineDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
|
||||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('shouldFallbackToBackupUrl', () => {
|
|
||||||
it('should return correct release when the primary URL is not available', async () => {
|
|
||||||
spyHttpClient.mockReturnValueOnce({
|
|
||||||
statusCode: 404,
|
|
||||||
headers: {},
|
|
||||||
result: ''
|
|
||||||
});
|
|
||||||
spyHttpClient.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData
|
|
||||||
});
|
|
||||||
|
|
||||||
const version = '17';
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
mockPlatform(distribution, 'linux');
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
it.each([
|
|
||||||
['11', 'x64', 'linux', 71],
|
|
||||||
['11', 'aarch64', 'linux', 54],
|
|
||||||
['17', 'riscv', 'linux', 0],
|
|
||||||
['16.0.1', 'x64', 'linux', 71],
|
|
||||||
['23-ea', 'x64', 'linux', 798],
|
|
||||||
['23-ea', 'aarch64', 'windows', 0],
|
|
||||||
['23-ea', 'x64', 'windows', 750]
|
|
||||||
])(
|
|
||||||
'should get right number of available versions from JSON',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
arch: string,
|
|
||||||
platform: string,
|
|
||||||
len: number
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
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([
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.22/sapmachine-jdk-11.0.22_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.0.17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.17/sapmachine-jdk-11.0.17_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jdk-17.0.4.1_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_linux-aarch64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jre-17.0.10_windows-x64_bin.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jre',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.4.1/sapmachine-jre-17.0.4.1_linux-x64_bin.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'23-ea',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-23%2B15/sapmachine-jdk-23-ea.15_linux-x64_bin.tar.gz',
|
|
||||||
'23'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'21.0.2+2-ea',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-21.0.2%2B2/sapmachine-jdk-21.0.2-ea.2_linux-x64_bin.tar.gz',
|
|
||||||
'21.0.2+2'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux-musl',
|
|
||||||
'x64',
|
|
||||||
'jdk',
|
|
||||||
'https://github.com/SAP/SapMachine/releases/download/sapmachine-17.0.10/sapmachine-jdk-17.0.10_linux-x64-musl_bin.tar.gz'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should return proper link according to the specified java-version, platform and arch',
|
|
||||||
async (
|
|
||||||
version: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
packageType: string,
|
|
||||||
expectedLink: string,
|
|
||||||
normalizedVersion: string = version
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
normalizedVersion
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', 'linux', 'x64'],
|
|
||||||
['8', 'macos', 'aarch64'],
|
|
||||||
['23', 'macos', 'aarch64'],
|
|
||||||
['17', 'linux', 'riscv'],
|
|
||||||
['23', 'linux', 'x64'],
|
|
||||||
['25-ea', 'linux', 'x64', '25'],
|
|
||||||
['8-ea', 'linux', 'x64', '8'],
|
|
||||||
['21.0.3+7', 'linux', 'x64', '21.0.3+7'],
|
|
||||||
['21.0.3+8-ea', 'linux', 'x64', '21.0.3+8'],
|
|
||||||
['17', 'linux-muse', 'aarch64']
|
|
||||||
])(
|
|
||||||
'should throw when required version of JDK can not be found in the JSON',
|
|
||||||
async (
|
|
||||||
version: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
normalizedVersion: string = version
|
|
||||||
) => {
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](normalizedVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
`Couldn't find any satisfied version for the specified java-version: "${normalizedVersion}" and architecture: "${arch}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw when required package type is not supported', async () => {
|
|
||||||
const jdkVersion = '17';
|
|
||||||
const arch = 'x64';
|
|
||||||
const platform = 'linux';
|
|
||||||
const distribution = new SapMachineDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
'SapMachine provides only the `jdk` and `jre` package type'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -207,7 +207,7 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
distribution['getAvailableVersions'] = async () => [];
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
||||||
`Unsupported architecture for IBM Semeru: ${arch} for your current OS version, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
`Unsupported architecture for IBM Semeru: ${arch}, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,8 +3,7 @@ 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');
|
||||||
@@ -81,41 +80,3 @@ 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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|||||||
10262
dist/cleanup/index.js
vendored
10262
dist/cleanup/index.js
vendored
File diff suppressed because it is too large
Load Diff
10942
dist/setup/index.js
vendored
10942
dist/setup/index.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -8,9 +8,6 @@
|
|||||||
- [Amazon Corretto](#Amazon-Corretto)
|
- [Amazon Corretto](#Amazon-Corretto)
|
||||||
- [Oracle](#Oracle)
|
- [Oracle](#Oracle)
|
||||||
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
||||||
- [SapMachine](#SapMachine)
|
|
||||||
- [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)
|
||||||
@@ -145,91 +142,6 @@ steps:
|
|||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
### SapMachine
|
|
||||||
**NOTE:** An OpenJDK release maintained and supported by SAP
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
- uses: actions/setup-java@v4
|
|
||||||
with:
|
|
||||||
distribution: 'sapmachine'
|
|
||||||
java-version: '21'
|
|
||||||
- run: java -cp java HelloWorldApp
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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
|
|
||||||
```
|
|
||||||
|
|
||||||
### 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:
|
||||||
@@ -242,6 +154,7 @@ 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": "^4.0.0",
|
"@actions/cache": "^3.2.4",
|
||||||
"@actions/core": "^1.11.0",
|
"@actions/core": "^1.10.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": "4.0.0",
|
"version": "3.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.4.tgz",
|
||||||
"integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
|
"integrity": "sha512-RuHnwfcDagtX+37s0ZWy7clbOfnZ7AlDJQ7k/9rzt2W4Gnwde3fa/qjSjVuz4vLcLIpc7fUob27CMrqiWZytYA==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.10.0",
|
||||||
"@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,9 +59,8 @@
|
|||||||
"@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",
|
||||||
"twirp-ts": "^2.5.0"
|
"uuid": "^3.3.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
"node_modules/@actions/cache/node_modules/@actions/glob": {
|
||||||
@@ -82,12 +81,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.11.1",
|
"version": "1.10.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.11.1.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.10.1.tgz",
|
||||||
"integrity": "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==",
|
"integrity": "sha512-3lBR9EDAY+iYIpTnTIXmWcNbX3T2kCkAEQGIQx4NVQ0575nk2k3GRZDTPQG+vVtS2izSLmINlxXf0uLtnrTP+g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/http-client": "^2.0.1",
|
||||||
"@actions/http-client": "^2.0.1"
|
"uuid": "^8.3.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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": {
|
||||||
@@ -1597,76 +1604,6 @@
|
|||||||
"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",
|
||||||
@@ -2391,15 +2328,6 @@
|
|||||||
"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",
|
||||||
@@ -2534,14 +2462,6 @@
|
|||||||
"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",
|
||||||
@@ -2575,11 +2495,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.6",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
||||||
"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",
|
||||||
@@ -2685,18 +2604,6 @@
|
|||||||
"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",
|
||||||
@@ -3258,7 +3165,8 @@
|
|||||||
"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",
|
||||||
@@ -3326,6 +3234,7 @@
|
|||||||
"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",
|
||||||
@@ -3493,6 +3402,7 @@
|
|||||||
"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"
|
||||||
@@ -3501,7 +3411,8 @@
|
|||||||
"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",
|
||||||
@@ -4344,11 +4255,6 @@
|
|||||||
"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",
|
||||||
@@ -4361,14 +4267,6 @@
|
|||||||
"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",
|
||||||
@@ -4424,13 +4322,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.8",
|
"version": "4.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
||||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.3",
|
"braces": "^3.0.2",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -4494,15 +4391,6 @@
|
|||||||
"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",
|
||||||
@@ -4578,6 +4466,7 @@
|
|||||||
"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"
|
||||||
}
|
}
|
||||||
@@ -4683,15 +4572,6 @@
|
|||||||
"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",
|
||||||
@@ -4705,6 +4585,7 @@
|
|||||||
"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"
|
||||||
}
|
}
|
||||||
@@ -4724,11 +4605,6 @@
|
|||||||
"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",
|
||||||
@@ -4842,6 +4718,7 @@
|
|||||||
"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"
|
||||||
},
|
},
|
||||||
@@ -5380,15 +5257,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"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",
|
||||||
@@ -5423,34 +5291,6 @@
|
|||||||
"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",
|
||||||
@@ -5619,7 +5459,8 @@
|
|||||||
"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",
|
||||||
@@ -5704,14 +5545,6 @@
|
|||||||
"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": "^4.0.0",
|
"@actions/cache": "^3.2.4",
|
||||||
"@actions/core": "^1.11.0",
|
"@actions/core": "^1.10.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",
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ async function computeCacheKey(
|
|||||||
`No file in ${process.cwd()} matched to [${pattern}], make sure you have checked out the target repository`
|
`No file in ${process.cwd()} matched to [${pattern}], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${process.arch}-${packageManager.id}-${fileHash}`;
|
return `${CACHE_KEY_PREFIX}-${process.env['RUNNER_OS']}-${packageManager.id}-${fileHash}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies
|
||||||
renameWinArchive
|
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
|
|
||||||
export enum AdoptImplementation {
|
export enum AdoptImplementation {
|
||||||
@@ -74,13 +73,11 @@ 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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const 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,8 +5,7 @@ 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 {
|
||||||
@@ -30,14 +29,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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
|
||||||
if (process.platform === 'win32') {
|
const extractedJavaPath = await extractJdkFile(
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
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);
|
||||||
@@ -94,7 +93,7 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
const imageType = this.packageType;
|
const imageType = this.packageType;
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
console.time('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
|
console.time('Retrieving available versions for Coretto took'); // eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
|
|
||||||
const availableVersionsUrl =
|
const availableVersionsUrl =
|
||||||
@@ -117,7 +116,7 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
core.startGroup('Print information about available versions');
|
core.startGroup('Print information about available versions');
|
||||||
console.timeEnd('Retrieving available versions for Corretto took'); // eslint-disable-line no-console
|
console.timeEnd('Retrieving available versions for Coretto took'); // eslint-disable-line no-console
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
core.debug(`Available versions: [${availableVersions.length}]`);
|
||||||
core.debug(
|
core.debug(
|
||||||
availableVersions
|
availableVersions
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ import {SemeruDistribution} from './semeru/installer';
|
|||||||
import {CorrettoDistribution} from './corretto/installer';
|
import {CorrettoDistribution} from './corretto/installer';
|
||||||
import {OracleDistribution} from './oracle/installer';
|
import {OracleDistribution} from './oracle/installer';
|
||||||
import {DragonwellDistribution} from './dragonwell/installer';
|
import {DragonwellDistribution} from './dragonwell/installer';
|
||||||
import {SapMachineDistribution} from './sapmachine/installer';
|
|
||||||
import {GraalVMDistribution} from './graalvm/installer';
|
|
||||||
import {JetBrainsDistribution} from './jetbrains/installer';
|
|
||||||
|
|
||||||
enum JavaDistribution {
|
enum JavaDistribution {
|
||||||
Adopt = 'adopt',
|
Adopt = 'adopt',
|
||||||
@@ -26,10 +23,7 @@ enum JavaDistribution {
|
|||||||
Semeru = 'semeru',
|
Semeru = 'semeru',
|
||||||
Corretto = 'corretto',
|
Corretto = 'corretto',
|
||||||
Oracle = 'oracle',
|
Oracle = 'oracle',
|
||||||
Dragonwell = 'dragonwell',
|
Dragonwell = 'dragonwell'
|
||||||
SapMachine = 'sapmachine',
|
|
||||||
GraalVM = 'graalvm',
|
|
||||||
JetBrains = 'jetbrains'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getJavaDistribution(
|
export function getJavaDistribution(
|
||||||
@@ -70,12 +64,6 @@ export function getJavaDistribution(
|
|||||||
return new OracleDistribution(installerOptions);
|
return new OracleDistribution(installerOptions);
|
||||||
case JavaDistribution.Dragonwell:
|
case JavaDistribution.Dragonwell:
|
||||||
return new DragonwellDistribution(installerOptions);
|
return new DragonwellDistribution(installerOptions);
|
||||||
case JavaDistribution.SapMachine:
|
|
||||||
return new SapMachineDistribution(installerOptions);
|
|
||||||
case JavaDistribution.GraalVM:
|
|
||||||
return new GraalVMDistribution(installerOptions);
|
|
||||||
case JavaDistribution.JetBrains:
|
|
||||||
return new JetBrainsDistribution(installerOptions);
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,8 +11,7 @@ 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 {
|
||||||
@@ -101,14 +100,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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
|
||||||
if (process.platform === 'win32') {
|
const extractedJavaPath = await extractJdkFile(
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
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);
|
||||||
|
|||||||
@@ -1,176 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
getGitHubHttpHeaders,
|
|
||||||
renameWinArchive
|
|
||||||
} from '../../util';
|
|
||||||
import {HttpCodes} from '@actions/http-client';
|
|
||||||
import {GraalVMEAVersion} from './models';
|
|
||||||
|
|
||||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
|
||||||
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
|
|
||||||
|
|
||||||
export class GraalVMDistribution extends JavaBase {
|
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
|
||||||
super('GraalVM', installerOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async downloadTool(
|
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
|
||||||
);
|
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
|
||||||
const extension = getDownloadArchiveExtension();
|
|
||||||
if (process.platform === 'win32') {
|
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
|
||||||
}
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
|
||||||
|
|
||||||
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};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const arch = this.distributionArchitecture();
|
|
||||||
if (arch !== 'x64' && arch !== 'aarch64') {
|
|
||||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.stable) {
|
|
||||||
return this.findEABuildDownloadUrl(`${range}-ea`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.packageType !== 'jdk') {
|
|
||||||
throw new Error('GraalVM provides only the `jdk` package type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const platform = this.getPlatform();
|
|
||||||
const extension = getDownloadArchiveExtension();
|
|
||||||
let major;
|
|
||||||
let fileUrl;
|
|
||||||
if (range.includes('.')) {
|
|
||||||
major = range.split('.')[0];
|
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
|
||||||
} else {
|
|
||||||
major = range;
|
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${range}/latest/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (parseInt(major) < 17) {
|
|
||||||
throw new Error('GraalVM is only supported for JDK 17 and later');
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await this.http.head(fileUrl);
|
|
||||||
|
|
||||||
if (response.message.statusCode === HttpCodes.NotFound) {
|
|
||||||
throw new Error(`Could not find GraalVM for SemVer ${range}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.message.statusCode !== HttpCodes.OK) {
|
|
||||||
throw new Error(
|
|
||||||
`Http request for GraalVM failed with status code: ${response.message.statusCode}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {url: fileUrl, version: range};
|
|
||||||
}
|
|
||||||
|
|
||||||
private async findEABuildDownloadUrl(
|
|
||||||
javaEaVersion: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const versions = await this.fetchEAJson(javaEaVersion);
|
|
||||||
const latestVersion = versions.find(v => v.latest);
|
|
||||||
if (!latestVersion) {
|
|
||||||
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
|
|
||||||
}
|
|
||||||
const arch = this.distributionArchitecture();
|
|
||||||
const file = latestVersion.files.find(
|
|
||||||
f => f.arch === arch && f.platform === GRAALVM_PLATFORM
|
|
||||||
);
|
|
||||||
if (!file || !file.filename.startsWith('graalvm-jdk-')) {
|
|
||||||
throw new Error(`Unable to find file metadata for '${javaEaVersion}'`);
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
url: `${latestVersion.download_base_url}${file.filename}`,
|
|
||||||
version: latestVersion.version
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private async fetchEAJson(
|
|
||||||
javaEaVersion: string
|
|
||||||
): Promise<GraalVMEAVersion[]> {
|
|
||||||
const owner = 'graalvm';
|
|
||||||
const repository = 'oracle-graalvm-ea-builds';
|
|
||||||
const branch = 'main';
|
|
||||||
const filePath = `versions/${javaEaVersion}.json`;
|
|
||||||
|
|
||||||
const url = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
|
||||||
|
|
||||||
const headers = getGitHubHttpHeaders();
|
|
||||||
|
|
||||||
core.debug(
|
|
||||||
`Trying to fetch available version info for GraalVM EA builds from '${url}'`
|
|
||||||
);
|
|
||||||
let fetchedJson;
|
|
||||||
try {
|
|
||||||
fetchedJson = (await this.http.getJson<GraalVMEAVersion[]>(url, headers))
|
|
||||||
.result;
|
|
||||||
} catch (err) {
|
|
||||||
throw Error(
|
|
||||||
`Fetching version info for GraalVM EA builds from '${url}' failed with the error: ${
|
|
||||||
(err as Error).message
|
|
||||||
}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (fetchedJson === null) {
|
|
||||||
throw Error(
|
|
||||||
`No GraalVM EA build found. Are you sure java-version: '${javaEaVersion}' is correct?`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return fetchedJson;
|
|
||||||
}
|
|
||||||
|
|
||||||
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
|
||||||
switch (platform) {
|
|
||||||
case 'darwin':
|
|
||||||
return 'macos';
|
|
||||||
case 'win32':
|
|
||||||
return 'windows';
|
|
||||||
case 'linux':
|
|
||||||
return 'linux';
|
|
||||||
default:
|
|
||||||
throw new Error(
|
|
||||||
`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
export type OsVersions = 'linux' | 'macos' | 'windows';
|
|
||||||
|
|
||||||
export interface GraalVMEAFile {
|
|
||||||
filename: string;
|
|
||||||
arch: 'aarch64' | 'x64';
|
|
||||||
platform: 'darwin' | 'linux' | 'windows';
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface GraalVMEAVersion {
|
|
||||||
version: string;
|
|
||||||
latest?: boolean;
|
|
||||||
download_base_url: string;
|
|
||||||
files: GraalVMEAFile[];
|
|
||||||
}
|
|
||||||
@@ -1,233 +0,0 @@
|
|||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
// 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,8 +8,7 @@ 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';
|
||||||
@@ -36,8 +35,13 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
if (process.platform === 'win32') {
|
if (
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
process.platform === 'win32' &&
|
||||||
|
(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,8 +7,7 @@ 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';
|
||||||
@@ -28,12 +27,22 @@ 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,11 +10,7 @@ import {
|
|||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
JavaInstallerResults
|
JavaInstallerResults
|
||||||
} from '../base-models';
|
} from '../base-models';
|
||||||
import {
|
import {extractJdkFile, getDownloadArchiveExtension} from '../../util';
|
||||||
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';
|
||||||
@@ -30,13 +26,11 @@ 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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const 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];
|
||||||
|
|||||||
@@ -1,269 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import semver from 'semver';
|
|
||||||
import fs from 'fs';
|
|
||||||
import {OutgoingHttpHeaders} from 'http';
|
|
||||||
import path from 'path';
|
|
||||||
import {
|
|
||||||
convertVersionToSemver,
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
getGitHubHttpHeaders,
|
|
||||||
isVersionSatisfies,
|
|
||||||
renameWinArchive
|
|
||||||
} from '../../util';
|
|
||||||
import {JavaBase} from '../base-installer';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {ISapMachineAllVersions, ISapMachineVersions} from './models';
|
|
||||||
|
|
||||||
export class SapMachineDistribution extends JavaBase {
|
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
|
||||||
super('SapMachine', installerOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
core.debug(`Only stable versions: ${this.stable}`);
|
|
||||||
|
|
||||||
if (!['jdk', 'jre'].includes(this.packageType)) {
|
|
||||||
throw new Error(
|
|
||||||
'SapMachine provides only the `jdk` and `jre` package type'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const availableVersions = await this.getAvailableVersions();
|
|
||||||
|
|
||||||
const matchedVersions = availableVersions
|
|
||||||
.filter(item => {
|
|
||||||
return isVersionSatisfies(version, item.version);
|
|
||||||
})
|
|
||||||
.map(item => {
|
|
||||||
return {
|
|
||||||
version: item.version,
|
|
||||||
url: item.downloadLink
|
|
||||||
} 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<ISapMachineVersions[]> {
|
|
||||||
const platform = this.getPlatformOption();
|
|
||||||
const arch = this.distributionArchitecture();
|
|
||||||
|
|
||||||
let fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
|
||||||
'https://sap.github.io/SapMachine/assets/data/sapmachine-releases-all.json'
|
|
||||||
);
|
|
||||||
|
|
||||||
if (!fetchedReleasesJson) {
|
|
||||||
fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
|
||||||
'https://api.github.com/repos/SAP/SapMachine/contents/assets/data/sapmachine-releases-all.json?ref=gh-pages',
|
|
||||||
getGitHubHttpHeaders()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fetchedReleasesJson) {
|
|
||||||
throw new Error(
|
|
||||||
`Couldn't fetch SapMachine versions information from both primary and backup urls`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.debug(
|
|
||||||
'Successfully fetched information about available SapMachine versions'
|
|
||||||
);
|
|
||||||
|
|
||||||
const availableVersions = this.parseVersions(
|
|
||||||
platform,
|
|
||||||
arch,
|
|
||||||
fetchedReleasesJson
|
|
||||||
);
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
core.startGroup('Print information about available versions');
|
|
||||||
core.debug(availableVersions.map(item => item.version).join(', '));
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
return availableVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async downloadTool(
|
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
|
||||||
);
|
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
|
||||||
const extension = getDownloadArchiveExtension();
|
|
||||||
if (process.platform === 'win32') {
|
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
|
||||||
}
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
|
||||||
|
|
||||||
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,
|
|
||||||
versions: ISapMachineAllVersions
|
|
||||||
): ISapMachineVersions[] {
|
|
||||||
const eligibleVersions: ISapMachineVersions[] = [];
|
|
||||||
|
|
||||||
for (const [, majorVersionMap] of Object.entries(versions)) {
|
|
||||||
for (const [, jdkVersionMap] of Object.entries(majorVersionMap.updates)) {
|
|
||||||
for (const [buildVersion, buildVersionMap] of Object.entries(
|
|
||||||
jdkVersionMap
|
|
||||||
)) {
|
|
||||||
let buildVersionWithoutPrefix = buildVersion.replace(
|
|
||||||
'sapmachine-',
|
|
||||||
''
|
|
||||||
);
|
|
||||||
if (!buildVersionWithoutPrefix.includes('.')) {
|
|
||||||
// replace major version with major.minor.patch and keep the remaining build identifier after the + as is with regex
|
|
||||||
buildVersionWithoutPrefix = buildVersionWithoutPrefix.replace(
|
|
||||||
/(\d+)(\+.*)?/,
|
|
||||||
'$1.0.0$2'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
// replace + with . to convert to semver format if we have more than 3 version digits
|
|
||||||
if (buildVersionWithoutPrefix.split('.').length > 3) {
|
|
||||||
buildVersionWithoutPrefix = buildVersionWithoutPrefix.replace(
|
|
||||||
'+',
|
|
||||||
'.'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
buildVersionWithoutPrefix = convertVersionToSemver(
|
|
||||||
buildVersionWithoutPrefix
|
|
||||||
);
|
|
||||||
|
|
||||||
// ignore invalid version
|
|
||||||
if (!semver.valid(buildVersionWithoutPrefix)) {
|
|
||||||
core.debug(`Invalid version: ${buildVersionWithoutPrefix}`);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// skip earlyAccessVersions if stable version requested
|
|
||||||
if (this.stable && buildVersionMap.ea === 'true') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const [edition, editionAssets] of Object.entries(
|
|
||||||
buildVersionMap.assets
|
|
||||||
)) {
|
|
||||||
if (this.packageType !== edition) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (const [archAndPlatForm, archAssets] of Object.entries(
|
|
||||||
editionAssets
|
|
||||||
)) {
|
|
||||||
let expectedArchAndPlatform = `${platform}-${arch}`;
|
|
||||||
if (platform === 'linux-musl') {
|
|
||||||
expectedArchAndPlatform = `linux-${arch}-musl`;
|
|
||||||
}
|
|
||||||
if (archAndPlatForm !== expectedArchAndPlatform) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
for (const [contentType, contentTypeAssets] of Object.entries(
|
|
||||||
archAssets
|
|
||||||
)) {
|
|
||||||
// skip if not tar.gz and zip files
|
|
||||||
if (contentType !== 'tar.gz' && contentType !== 'zip') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
eligibleVersions.push({
|
|
||||||
os: platform,
|
|
||||||
architecture: arch,
|
|
||||||
version: buildVersionWithoutPrefix,
|
|
||||||
checksum: contentTypeAssets.checksum,
|
|
||||||
downloadLink: contentTypeAssets.url,
|
|
||||||
packageType: edition
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const sortedVersions = this.sortParsedVersions(eligibleVersions);
|
|
||||||
|
|
||||||
return sortedVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sorts versions in descending order as by default data in JSON isn't sorted
|
|
||||||
private sortParsedVersions(
|
|
||||||
eligibleVersions: ISapMachineVersions[]
|
|
||||||
): ISapMachineVersions[] {
|
|
||||||
const sortedVersions = eligibleVersions.sort((versionObj1, versionObj2) => {
|
|
||||||
const version1 = versionObj1.version;
|
|
||||||
const version2 = versionObj2.version;
|
|
||||||
return semver.compareBuild(version1, version2);
|
|
||||||
});
|
|
||||||
return sortedVersions.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
private getPlatformOption(): string {
|
|
||||||
switch (process.platform) {
|
|
||||||
case 'win32':
|
|
||||||
return 'windows';
|
|
||||||
case 'darwin':
|
|
||||||
return 'macos';
|
|
||||||
case 'linux':
|
|
||||||
// figure out if alpine/musl
|
|
||||||
if (fs.existsSync('/etc/alpine-release')) {
|
|
||||||
return 'linux-musl';
|
|
||||||
}
|
|
||||||
return 'linux';
|
|
||||||
default:
|
|
||||||
return process.platform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async fetchReleasesFromUrl(
|
|
||||||
url: string,
|
|
||||||
headers: OutgoingHttpHeaders = {}
|
|
||||||
): Promise<ISapMachineAllVersions | null> {
|
|
||||||
try {
|
|
||||||
core.debug(
|
|
||||||
`Trying to fetch available SapMachine versions info from the primary url: ${url}`
|
|
||||||
);
|
|
||||||
const releases = (
|
|
||||||
await this.http.getJson<ISapMachineAllVersions>(url, headers)
|
|
||||||
).result;
|
|
||||||
return releases;
|
|
||||||
} catch (err) {
|
|
||||||
core.debug(
|
|
||||||
`Fetching SapMachine versions info from the link: ${url} ended up with the error: ${
|
|
||||||
(err as Error).message
|
|
||||||
}`
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
export interface ISapMachineAllVersions {
|
|
||||||
[major: string]: {
|
|
||||||
lts: string;
|
|
||||||
updates: {
|
|
||||||
[full_version: string]: {
|
|
||||||
[sapmachineBuild: string]: {
|
|
||||||
release_url: string;
|
|
||||||
ea: string;
|
|
||||||
assets: {
|
|
||||||
[packageType: string]: {
|
|
||||||
[arch: string]: {
|
|
||||||
[content_type: string]: {
|
|
||||||
name: string;
|
|
||||||
checksum: string;
|
|
||||||
url: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ISapMachineVersions {
|
|
||||||
os: string;
|
|
||||||
architecture: string;
|
|
||||||
version: string;
|
|
||||||
checksum: string;
|
|
||||||
downloadLink: string;
|
|
||||||
packageType: string;
|
|
||||||
}
|
|
||||||
@@ -8,8 +8,7 @@ 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';
|
||||||
@@ -34,15 +33,11 @@ export class SemeruDistribution extends JavaBase {
|
|||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(
|
||||||
version: string
|
version: string
|
||||||
): Promise<JavaDownloadRelease> {
|
): Promise<JavaDownloadRelease> {
|
||||||
const arch = this.distributionArchitecture();
|
if (!supportedArchitectures.includes(this.architecture)) {
|
||||||
|
|
||||||
if (!supportedArchitectures.includes(arch)) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Unsupported architecture for IBM Semeru: ${
|
`Unsupported architecture for IBM Semeru: ${
|
||||||
this.architecture
|
this.architecture
|
||||||
} for your current OS version, the following are supported: ${supportedArchitectures.join(
|
}, the following are supported: ${supportedArchitectures.join(', ')}`
|
||||||
', '
|
|
||||||
)}`
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,7 +81,7 @@ export class SemeruDistribution extends JavaBase {
|
|||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Could not find satisfied version for SemVer version '${version}' for your current OS version for ${this.architecture} architecture ${availableOptionsMessage}`
|
`Could not find satisfied version for SemVer '${version}'. ${availableOptionsMessage}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,13 +94,11 @@ 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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const 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
|
||||||
@@ -131,7 +124,7 @@ export class SemeruDistribution extends JavaBase {
|
|||||||
|
|
||||||
public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> {
|
public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> {
|
||||||
const platform = this.getPlatformOption();
|
const platform = this.getPlatformOption();
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.architecture;
|
||||||
const imageType = this.packageType;
|
const imageType = this.packageType;
|
||||||
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
|
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
|
||||||
const releaseType = this.stable ? 'ga' : 'ea';
|
const releaseType = this.stable ? 'ga' : 'ea';
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies
|
||||||
renameWinArchive
|
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
|
|
||||||
export enum TemurinImplementation {
|
export enum TemurinImplementation {
|
||||||
@@ -77,13 +76,11 @@ 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} ...`
|
||||||
);
|
);
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const 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,8 +11,7 @@ import {
|
|||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies
|
||||||
renameWinArchive
|
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
@@ -81,8 +80,13 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
if (process.platform === 'win32') {
|
if (
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
process.platform === 'win32' &&
|
||||||
|
(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,13 +92,7 @@ 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 {
|
||||||
@@ -196,14 +190,3 @@ 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