mirror of
https://gitea.com/actions/setup-java.git
synced 2025-11-08 02:46:26 +08:00
Compare commits
1 Commits
v3.14.0
...
revert-421
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f42f7cdbd |
@@ -1,6 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!src/
|
|
||||||
51
.eslintrc.js
51
.eslintrc.js
@@ -1,51 +0,0 @@
|
|||||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
|
||||||
module.exports = {
|
|
||||||
extends: [
|
|
||||||
'eslint:recommended',
|
|
||||||
'plugin:@typescript-eslint/recommended',
|
|
||||||
'plugin:eslint-plugin-jest/recommended',
|
|
||||||
'eslint-config-prettier'
|
|
||||||
],
|
|
||||||
parser: '@typescript-eslint/parser',
|
|
||||||
plugins: ['@typescript-eslint', 'eslint-plugin-node', 'eslint-plugin-jest'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-require-imports': 'error',
|
|
||||||
'@typescript-eslint/no-non-null-assertion': 'off',
|
|
||||||
'@typescript-eslint/no-explicit-any': 'off',
|
|
||||||
'@typescript-eslint/no-empty-function': 'off',
|
|
||||||
'@typescript-eslint/ban-ts-comment': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
'ts-ignore': 'allow-with-description'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-console': 'error',
|
|
||||||
'yoda': 'error',
|
|
||||||
'prefer-const': [
|
|
||||||
'error',
|
|
||||||
{
|
|
||||||
destructuring: 'all'
|
|
||||||
}
|
|
||||||
],
|
|
||||||
'no-control-regex': 'off',
|
|
||||||
'no-constant-condition': ['error', {checkLoops: false}],
|
|
||||||
'node/no-extraneous-import': 'error'
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ['**/*{test,spec}.ts'],
|
|
||||||
rules: {
|
|
||||||
'@typescript-eslint/no-unused-vars': 'off',
|
|
||||||
'jest/no-standalone-expect': 'off',
|
|
||||||
'jest/no-conditional-expect': 'off',
|
|
||||||
'no-console': 'off',
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
env: {
|
|
||||||
node: true,
|
|
||||||
es6: true,
|
|
||||||
'jest/globals': true
|
|
||||||
}
|
|
||||||
};
|
|
||||||
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -1,4 +1,3 @@
|
|||||||
* text=auto eol=lf
|
|
||||||
dist/index.js -diff -merge
|
dist/index.js -diff -merge
|
||||||
dist/index.js linguist-generated=true
|
dist/index.js linguist-generated=true
|
||||||
.licenses/** -diff linguist-generated=true
|
.licenses/** -diff linguist-generated=true
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1 +1 @@
|
|||||||
blank_issues_enabled: false
|
blank_issues_enabled: false
|
||||||
2
.github/workflows/basic-validation.yml
vendored
2
.github/workflows/basic-validation.yml
vendored
@@ -14,4 +14,4 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
call-basic-validation:
|
call-basic-validation:
|
||||||
name: Basic validation
|
name: Basic validation
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
|
||||||
8
.github/workflows/codeql-analysis.yml
vendored
8
.github/workflows/codeql-analysis.yml
vendored
@@ -2,13 +2,13 @@ name: CodeQL analysis
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [main]
|
branches: [ main ]
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 3 * * 0'
|
- cron: '0 3 * * 0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
call-codeQL-analysis:
|
call-codeQL-analysis:
|
||||||
name: CodeQL analysis
|
name: CodeQL analysis
|
||||||
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
uses: actions/reusable-workflows/.github/workflows/codeql-analysis.yml@main
|
||||||
10
.github/workflows/e2e-cache.yml
vendored
10
.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-latest, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -132,16 +132,11 @@ jobs:
|
|||||||
distribution: 'adopt'
|
distribution: 'adopt'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: sbt
|
cache: sbt
|
||||||
- name: Setup SBT
|
|
||||||
if: matrix.os == 'macos-13'
|
|
||||||
run: |
|
|
||||||
echo ""Installing SBT...""
|
|
||||||
brew install sbt
|
|
||||||
- name: Create files to cache
|
- name: Create files to cache
|
||||||
run: sbt update
|
run: sbt update
|
||||||
|
|
||||||
- name: Check files to cache on macos-latest
|
- name: Check files to cache on macos-latest
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-latest'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
if [ ! -d ~/Library/Caches/Coursier ]; then
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
||||||
@@ -156,6 +151,7 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
- name: Check files to cache on ubuntu-latest
|
- name: Check files to cache on ubuntu-latest
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
4
.github/workflows/e2e-publishing.yml
vendored
4
.github/workflows/e2e-publishing.yml
vendored
@@ -86,7 +86,7 @@ jobs:
|
|||||||
if ($content -notlike '*maven*') {
|
if ($content -notlike '*maven*') {
|
||||||
throw "settings.xml file is not overwritten"
|
throw "settings.xml file is not overwritten"
|
||||||
}
|
}
|
||||||
|
|
||||||
test-publishing-skip-overwrite:
|
test-publishing-skip-overwrite:
|
||||||
name: settings.xml is not overwritten if flag is false
|
name: settings.xml is not overwritten if flag is false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@@ -150,4 +150,4 @@ jobs:
|
|||||||
$path = Join-Path $env:RUNNER_TEMP "settings.xml"
|
$path = Join-Path $env:RUNNER_TEMP "settings.xml"
|
||||||
if (-not (Test-Path $path)) {
|
if (-not (Test-Path $path)) {
|
||||||
throw "settings.xml file is not found in expected location"
|
throw "settings.xml file is not found in expected location"
|
||||||
}
|
}
|
||||||
95
.github/workflows/e2e-versions.yml
vendored
95
.github/workflows/e2e-versions.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
paths-ignore:
|
paths-ignore:
|
||||||
- '**.md'
|
- '**.md'
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */12 * * *'
|
- cron: '0 */12 * * *'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
jobs:
|
jobs:
|
||||||
setup-java-major-versions:
|
setup-java-major-versions:
|
||||||
@@ -20,35 +20,22 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-2022, ubuntu-22.04]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: [
|
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft', 'corretto' ] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||||
'temurin',
|
version: ['8', '11', '16']
|
||||||
'adopt',
|
|
||||||
'adopt-openj9',
|
|
||||||
'zulu',
|
|
||||||
'liberica',
|
|
||||||
'microsoft',
|
|
||||||
'semeru',
|
|
||||||
'corretto',
|
|
||||||
'dragonwell'
|
|
||||||
] # internally 'adopt-hotspot' is the same as 'adopt'
|
|
||||||
version: ['8', '11', '17']
|
|
||||||
exclude:
|
exclude:
|
||||||
- distribution: microsoft
|
- distribution: microsoft
|
||||||
version: 8
|
version: 8
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-13
|
|
||||||
include:
|
include:
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-13
|
os: macos-latest
|
||||||
version: 17
|
version: 17
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
version: 20
|
version: 19
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: 20
|
version: 19
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -69,22 +56,16 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
version:
|
version:
|
||||||
- '11.0'
|
- '11.0'
|
||||||
- '8.0.302'
|
- '8.0.302'
|
||||||
- '17.0.7+7'
|
- '16.0.2+7'
|
||||||
include:
|
include:
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
version: '20.0.1'
|
version: '19.0.1'
|
||||||
- distribution: dragonwell
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '11.0'
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: ubuntu-latest
|
|
||||||
version: '11.0.13+9'
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -106,10 +87,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: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
exclude:
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -132,10 +110,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: ['temurin', 'zulu', 'liberica', 'dragonwell']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
exclude:
|
|
||||||
- distribution: dragonwell
|
|
||||||
os: macos-latest
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -171,7 +146,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
version: ['17-ea', '15.0.0-ea.14']
|
version: ['17-ea', '15.0.0-ea.14']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -215,8 +190,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica', 'semeru']
|
distribution: ['temurin', 'zulu', 'liberica']
|
||||||
java-package: ['jre']
|
java-package: ['jre']
|
||||||
version: ['17.0']
|
version: ['17.0']
|
||||||
include:
|
include:
|
||||||
@@ -263,7 +238,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:
|
||||||
@@ -287,7 +262,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: ['temurin', 'microsoft', 'corretto']
|
distribution: ['temurin', 'microsoft', 'corretto' ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -311,8 +286,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto']
|
distribution: ['temurin', 'zulu', 'liberica', 'microsoft', 'corretto' ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -335,8 +310,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['adopt', 'adopt-openj9', 'zulu']
|
distribution: [ 'adopt', 'adopt-openj9', 'zulu' ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -359,8 +334,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['adopt', 'zulu', 'liberica']
|
distribution: ['adopt', 'zulu', 'liberica' ]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|||||||
12
.github/workflows/release-new-action-version.yml
vendored
12
.github/workflows/release-new-action-version.yml
vendored
@@ -21,9 +21,9 @@ jobs:
|
|||||||
name: releaseNewActionVersion
|
name: releaseNewActionVersion
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Update the ${{ env.TAG_NAME }} tag
|
- name: Update the ${{ env.TAG_NAME }} tag
|
||||||
id: update-major-tag
|
id: update-major-tag
|
||||||
uses: actions/publish-action@v0.2.2
|
uses: actions/publish-action@v0.2.2
|
||||||
with:
|
with:
|
||||||
source-tag: ${{ env.TAG_NAME }}
|
source-tag: ${{ env.TAG_NAME }}
|
||||||
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
|
|||||||
11
.github/workflows/update-config-files.yml
vendored
11
.github/workflows/update-config-files.yml
vendored
@@ -1,11 +0,0 @@
|
|||||||
name: Update configuration files
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 3 * * 0'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
call-update-configuration-files:
|
|
||||||
name: Update configuration files
|
|
||||||
uses: actions/reusable-workflows/.github/workflows/update-config-files.yml@main
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -94,6 +94,3 @@ typings/
|
|||||||
# DynamoDB Local files
|
# DynamoDB Local files
|
||||||
.dynamodb/
|
.dynamodb/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|
||||||
# IntelliJ / WebStorm
|
|
||||||
/.idea/
|
|
||||||
|
|||||||
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.3
|
version: 3.0.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.0
|
||||||
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
|
||||||
|
|||||||
30
.licenses/npm/@actions/exec.dep.yml
generated
30
.licenses/npm/@actions/exec.dep.yml
generated
@@ -1,20 +1,30 @@
|
|||||||
---
|
---
|
||||||
name: "@actions/exec"
|
name: "@actions/exec"
|
||||||
version: 1.1.1
|
version: 1.0.4
|
||||||
type: npm
|
type: npm
|
||||||
summary: Actions exec lib
|
summary: Actions exec lib
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
|
homepage: https://github.com/actions/toolkit/tree/master/packages/exec
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE.md
|
- sources: Auto-generated MIT license text
|
||||||
text: |-
|
text: |
|
||||||
The MIT License (MIT)
|
MIT License
|
||||||
|
|
||||||
Copyright 2019 GitHub
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
notices: []
|
notices: []
|
||||||
|
|||||||
32
.licenses/npm/@actions/http-client-2.2.3.dep.yml
generated
32
.licenses/npm/@actions/http-client-2.2.3.dep.yml
generated
@@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@actions/http-client"
|
|
||||||
version: 2.2.3
|
|
||||||
type: npm
|
|
||||||
summary: Actions Http Client
|
|
||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
Actions Http Client for Node.js
|
|
||||||
|
|
||||||
Copyright (c) GitHub, Inc.
|
|
||||||
|
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
|
||||||
associated documentation files (the "Software"), to deal in the Software without restriction,
|
|
||||||
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
|
|
||||||
subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
|
||||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
||||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
||||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
||||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
notices: []
|
|
||||||
4
.licenses/npm/@azure/abort-controller.dep.yml
generated
4
.licenses/npm/@azure/abort-controller.dep.yml
generated
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/abort-controller"
|
name: "@azure/abort-controller"
|
||||||
version: 1.1.0
|
version: 1.0.4
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure SDK for JavaScript - Aborter
|
summary: Microsoft Azure SDK for JavaScript - Aborter
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md
|
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller/README.md
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
2
.licenses/npm/@azure/core-http.dep.yml
generated
2
.licenses/npm/@azure/core-http.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-http"
|
name: "@azure/core-http"
|
||||||
version: 3.0.1
|
version: 2.2.4
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||||
libraries generated using AutoRest
|
libraries generated using AutoRest
|
||||||
|
|||||||
2
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
2
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/ms-rest-js"
|
name: "@azure/ms-rest-js"
|
||||||
version: 2.7.0
|
version: 2.6.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||||
libraries generated using AutoRest
|
libraries generated using AutoRest
|
||||||
|
|||||||
2
.licenses/npm/@azure/storage-blob.dep.yml
generated
2
.licenses/npm/@azure/storage-blob.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/storage-blob"
|
name: "@azure/storage-blob"
|
||||||
version: 12.14.0
|
version: 12.9.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
||||||
|
|||||||
30
.licenses/npm/@fastify/busboy.dep.yml
generated
30
.licenses/npm/@fastify/busboy.dep.yml
generated
@@ -1,30 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@fastify/busboy"
|
|
||||||
version: 2.1.1
|
|
||||||
type: npm
|
|
||||||
summary: A streaming parser for HTML form data for node.js
|
|
||||||
homepage:
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |-
|
|
||||||
Copyright Brian White. All rights reserved.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to
|
|
||||||
deal in the Software without restriction, including without limitation the
|
|
||||||
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
||||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
||||||
IN THE SOFTWARE.
|
|
||||||
notices: []
|
|
||||||
185
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
185
.licenses/npm/@protobuf-ts/plugin-framework.dep.yml
generated
@@ -1,185 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@protobuf-ts/plugin-framework"
|
|
||||||
version: 2.9.6
|
|
||||||
type: npm
|
|
||||||
summary: framework to create protoc plugins
|
|
||||||
homepage: https://github.com/timostamm/protobuf-ts
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |2
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
notices: []
|
|
||||||
186
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
186
.licenses/npm/@protobuf-ts/plugin.dep.yml
generated
@@ -1,186 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@protobuf-ts/plugin"
|
|
||||||
version: 2.9.6
|
|
||||||
type: npm
|
|
||||||
summary: The protocol buffer compiler plugin "protobuf-ts" generates TypeScript, gRPC-web,
|
|
||||||
Twirp, and more.
|
|
||||||
homepage: https://github.com/timostamm/protobuf-ts
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |2
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
notices: []
|
|
||||||
207
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
207
.licenses/npm/@protobuf-ts/protoc.dep.yml
generated
@@ -1,207 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@protobuf-ts/protoc"
|
|
||||||
version: 2.9.6
|
|
||||||
type: npm
|
|
||||||
summary: Installs the protocol buffer compiler "protoc" for you.
|
|
||||||
homepage: https://github.com/timostamm/protobuf-ts
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: Auto-generated Apache-2.0 license text
|
|
||||||
text: |2
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
|
||||||
|
|
||||||
APPENDIX: How to apply the Apache License to your work.
|
|
||||||
|
|
||||||
To apply the Apache License to your work, attach the following
|
|
||||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
||||||
replaced with your own identifying information. (Don't include
|
|
||||||
the brackets!) The text should be enclosed in the appropriate
|
|
||||||
comment syntax for the file format. We also recommend that a
|
|
||||||
file or class name and description of purpose be included on the
|
|
||||||
same "printed page" as the copyright notice for easier
|
|
||||||
identification within third-party archives.
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
you may not use this file except in compliance with the License.
|
|
||||||
You may obtain a copy of the License at
|
|
||||||
|
|
||||||
http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
|
|
||||||
Unless required by applicable law or agreed to in writing, software
|
|
||||||
distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
See the License for the specific language governing permissions and
|
|
||||||
limitations under the License.
|
|
||||||
notices: []
|
|
||||||
185
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
185
.licenses/npm/@protobuf-ts/runtime-rpc.dep.yml
generated
@@ -1,185 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@protobuf-ts/runtime-rpc"
|
|
||||||
version: 2.9.6
|
|
||||||
type: npm
|
|
||||||
summary: Runtime library for RPC clients generated by the protoc plugin "protobuf-ts"
|
|
||||||
homepage: https://github.com/timostamm/protobuf-ts
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |2
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
notices: []
|
|
||||||
185
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
185
.licenses/npm/@protobuf-ts/runtime.dep.yml
generated
@@ -1,185 +0,0 @@
|
|||||||
---
|
|
||||||
name: "@protobuf-ts/runtime"
|
|
||||||
version: 2.9.6
|
|
||||||
type: npm
|
|
||||||
summary: Runtime library for code generated by the protoc plugin "protobuf-ts"
|
|
||||||
homepage: https://github.com/timostamm/protobuf-ts
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |2
|
|
||||||
Apache License
|
|
||||||
Version 2.0, January 2004
|
|
||||||
http://www.apache.org/licenses/
|
|
||||||
|
|
||||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
||||||
|
|
||||||
1. Definitions.
|
|
||||||
|
|
||||||
"License" shall mean the terms and conditions for use, reproduction,
|
|
||||||
and distribution as defined by Sections 1 through 9 of this document.
|
|
||||||
|
|
||||||
"Licensor" shall mean the copyright owner or entity authorized by
|
|
||||||
the copyright owner that is granting the License.
|
|
||||||
|
|
||||||
"Legal Entity" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common
|
|
||||||
control with that entity. For the purposes of this definition,
|
|
||||||
"control" means (i) the power, direct or indirect, to cause the
|
|
||||||
direction or management of such entity, whether by contract or
|
|
||||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
||||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
||||||
|
|
||||||
"You" (or "Your") shall mean an individual or Legal Entity
|
|
||||||
exercising permissions granted by this License.
|
|
||||||
|
|
||||||
"Source" form shall mean the preferred form for making modifications,
|
|
||||||
including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.
|
|
||||||
|
|
||||||
"Object" form shall mean any form resulting from mechanical
|
|
||||||
transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation,
|
|
||||||
and conversions to other media types.
|
|
||||||
|
|
||||||
"Work" shall mean the work of authorship, whether in Source or
|
|
||||||
Object form, made available under the License, as indicated by a
|
|
||||||
copyright notice that is included in or attached to the work
|
|
||||||
(an example is provided in the Appendix below).
|
|
||||||
|
|
||||||
"Derivative Works" shall mean any work, whether in Source or Object
|
|
||||||
form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications
|
|
||||||
represent, as a whole, an original work of authorship. For the purposes
|
|
||||||
of this License, Derivative Works shall not include works that remain
|
|
||||||
separable from, or merely link (or bind by name) to the interfaces of,
|
|
||||||
the Work and Derivative Works thereof.
|
|
||||||
|
|
||||||
"Contribution" shall mean any work of authorship, including
|
|
||||||
the original version of the Work and any modifications or additions
|
|
||||||
to that Work or Derivative Works thereof, that is intentionally
|
|
||||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
||||||
or by an individual or Legal Entity authorized to submit on behalf of
|
|
||||||
the copyright owner. For the purposes of this definition, "submitted"
|
|
||||||
means any form of electronic, verbal, or written communication sent
|
|
||||||
to the Licensor or its representatives, including but not limited to
|
|
||||||
communication on electronic mailing lists, source code control systems,
|
|
||||||
and issue tracking systems that are managed by, or on behalf of, the
|
|
||||||
Licensor for the purpose of discussing and improving the Work, but
|
|
||||||
excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as "Not a Contribution."
|
|
||||||
|
|
||||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
||||||
on behalf of whom a Contribution has been received by Licensor and
|
|
||||||
subsequently incorporated within the Work.
|
|
||||||
|
|
||||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
copyright license to reproduce, prepare Derivative Works of,
|
|
||||||
publicly display, publicly perform, sublicense, and distribute the
|
|
||||||
Work and such Derivative Works in Source or Object form.
|
|
||||||
|
|
||||||
3. Grant of Patent License. Subject to the terms and conditions of
|
|
||||||
this License, each Contributor hereby grants to You a perpetual,
|
|
||||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made,
|
|
||||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
||||||
where such license applies only to those patent claims licensable
|
|
||||||
by such Contributor that are necessarily infringed by their
|
|
||||||
Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You
|
|
||||||
institute patent litigation against any entity (including a
|
|
||||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
||||||
or a Contribution incorporated within the Work constitutes direct
|
|
||||||
or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate
|
|
||||||
as of the date such litigation is filed.
|
|
||||||
|
|
||||||
4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without
|
|
||||||
modifications, and in Source or Object form, provided that You
|
|
||||||
meet the following conditions:
|
|
||||||
|
|
||||||
(a) You must give any other recipients of the Work or
|
|
||||||
Derivative Works a copy of this License; and
|
|
||||||
|
|
||||||
(b) You must cause any modified files to carry prominent notices
|
|
||||||
stating that You changed the files; and
|
|
||||||
|
|
||||||
(c) You must retain, in the Source form of any Derivative Works
|
|
||||||
that You distribute, all copyright, patent, trademark, and
|
|
||||||
attribution notices from the Source form of the Work,
|
|
||||||
excluding those notices that do not pertain to any part of
|
|
||||||
the Derivative Works; and
|
|
||||||
|
|
||||||
(d) If the Work includes a "NOTICE" text file as part of its
|
|
||||||
distribution, then any Derivative Works that You distribute must
|
|
||||||
include a readable copy of the attribution notices contained
|
|
||||||
within such NOTICE file, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works, in at least one
|
|
||||||
of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or
|
|
||||||
documentation, if provided along with the Derivative Works; or,
|
|
||||||
within a display generated by the Derivative Works, if and
|
|
||||||
wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and
|
|
||||||
do not modify the License. You may add Your own attribution
|
|
||||||
notices within Derivative Works that You distribute, alongside
|
|
||||||
or as an addendum to the NOTICE text from the Work, provided
|
|
||||||
that such additional attribution notices cannot be construed
|
|
||||||
as modifying the License.
|
|
||||||
|
|
||||||
You may add Your own copyright statement to Your modifications and
|
|
||||||
may provide additional or different license terms and conditions
|
|
||||||
for use, reproduction, or distribution of Your modifications, or
|
|
||||||
for any such Derivative Works as a whole, provided Your use,
|
|
||||||
reproduction, and distribution of the Work otherwise complies with
|
|
||||||
the conditions stated in this License.
|
|
||||||
|
|
||||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
||||||
any Contribution intentionally submitted for inclusion in the Work
|
|
||||||
by You to the Licensor shall be under the terms and conditions of
|
|
||||||
this License, without any additional terms or conditions.
|
|
||||||
Notwithstanding the above, nothing herein shall supersede or modify
|
|
||||||
the terms of any separate license agreement you may have executed
|
|
||||||
with Licensor regarding such Contributions.
|
|
||||||
|
|
||||||
6. Trademarks. This License does not grant permission to use the trade
|
|
||||||
names, trademarks, service marks, or product names of the Licensor,
|
|
||||||
except as required for reasonable and customary use in describing the
|
|
||||||
origin of the Work and reproducing the content of the NOTICE file.
|
|
||||||
|
|
||||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
||||||
agreed to in writing, Licensor provides the Work (and each
|
|
||||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
||||||
implied, including, without limitation, any warranties or conditions
|
|
||||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
||||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
||||||
appropriateness of using or redistributing the Work and assume any
|
|
||||||
risks associated with Your exercise of permissions under this License.
|
|
||||||
|
|
||||||
8. Limitation of Liability. In no event and under no legal theory,
|
|
||||||
whether in tort (including negligence), contract, or otherwise,
|
|
||||||
unless required by applicable law (such as deliberate and grossly
|
|
||||||
negligent acts) or agreed to in writing, shall any Contributor be
|
|
||||||
liable to You for damages, including any direct, indirect, special,
|
|
||||||
incidental, or consequential damages of any character arising as a
|
|
||||||
result of this License or out of the use or inability to use the
|
|
||||||
Work (including but not limited to damages for loss of goodwill,
|
|
||||||
work stoppage, computer failure or malfunction, or any and all
|
|
||||||
other commercial damages or losses), even if such Contributor
|
|
||||||
has been advised of the possibility of such damages.
|
|
||||||
|
|
||||||
9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer,
|
|
||||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
||||||
or other liability obligations and/or rights consistent with this
|
|
||||||
License. However, in accepting such obligations, You may act only
|
|
||||||
on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify,
|
|
||||||
defend, and hold each Contributor harmless for any liability
|
|
||||||
incurred by, or claims asserted against, such Contributor by reason
|
|
||||||
of your accepting any such warranty or additional liability.
|
|
||||||
notices: []
|
|
||||||
2
.licenses/npm/@types/node-fetch.dep.yml
generated
2
.licenses/npm/@types/node-fetch.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: "@types/node-fetch"
|
name: "@types/node-fetch"
|
||||||
version: 2.6.3
|
version: 2.6.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: TypeScript definitions for node-fetch
|
summary: TypeScript definitions for node-fetch
|
||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
---
|
---
|
||||||
name: "@azure/core-util"
|
name: ip-regex
|
||||||
version: 1.3.0
|
version: 2.1.0
|
||||||
type: npm
|
type: npm
|
||||||
summary: Core library for shared utility methods
|
summary: Regular expression for matching IP addresses (IPv4 & IPv6)
|
||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-util/
|
homepage: https://github.com/sindresorhus/ip-regex#readme
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: license
|
||||||
text: |
|
text: |
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2020 Microsoft
|
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -19,14 +19,16 @@ licenses:
|
|||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in
|
||||||
copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
- sources: readme.md
|
||||||
|
text: MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||||
notices: []
|
notices: []
|
||||||
43
.licenses/npm/psl.dep.yml
generated
Normal file
43
.licenses/npm/psl.dep.yml
generated
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
---
|
||||||
|
name: psl
|
||||||
|
version: 1.8.0
|
||||||
|
type: npm
|
||||||
|
summary: Domain name parser based on the Public Suffix List
|
||||||
|
homepage: https://github.com/lupomontero/psl#readme
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 Lupo Montero lupomontero@gmail.com
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
- sources: README.md
|
||||||
|
text: |-
|
||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2017 Lupo Montero <lupomontero@gmail.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
notices: []
|
||||||
34
.licenses/npm/punycode.dep.yml
generated
Normal file
34
.licenses/npm/punycode.dep.yml
generated
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
---
|
||||||
|
name: punycode
|
||||||
|
version: 2.1.1
|
||||||
|
type: npm
|
||||||
|
summary: A robust Punycode converter that fully complies to RFC 3492 and RFC 5891,
|
||||||
|
and works on nearly all JavaScript platforms.
|
||||||
|
homepage: https://mths.be/punycode
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE-MIT.txt
|
||||||
|
text: |
|
||||||
|
Copyright Mathias Bynens <https://mathiasbynens.be/>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of this software and associated documentation files (the
|
||||||
|
"Software"), to deal in the Software without restriction, including
|
||||||
|
without limitation the rights to use, copy, modify, merge, publish,
|
||||||
|
distribute, sublicense, and/or sell copies of the Software, and to
|
||||||
|
permit persons to whom the Software is furnished to do so, subject to
|
||||||
|
the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be
|
||||||
|
included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||||
|
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||||
|
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||||
|
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||||
|
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
- sources: README.md
|
||||||
|
text: Punycode.js is available under the [MIT](https://mths.be/mit) license.
|
||||||
|
notices: []
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: semver
|
name: semver
|
||||||
version: 6.3.1
|
version: 7.3.4
|
||||||
type: npm
|
type: npm
|
||||||
summary: The semantic version parser used by npm.
|
summary: The semantic version parser used by npm.
|
||||||
homepage:
|
homepage: https://github.com/npm/node-semver#readme
|
||||||
license: isc
|
license: isc
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
26
.licenses/npm/semver-7.5.4.dep.yml
generated
26
.licenses/npm/semver-7.5.4.dep.yml
generated
@@ -1,26 +0,0 @@
|
|||||||
---
|
|
||||||
name: semver
|
|
||||||
version: 7.5.4
|
|
||||||
type: npm
|
|
||||||
summary: The semantic version parser used by npm.
|
|
||||||
homepage:
|
|
||||||
license: isc
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
The ISC License
|
|
||||||
|
|
||||||
Copyright (c) Isaac Z. Schlueter and Contributors
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted, provided that the above
|
|
||||||
copyright notice and this permission notice appear in all copies.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
||||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
||||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
||||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
||||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
notices: []
|
|
||||||
23
.licenses/npm/tough-cookie-3.0.1.dep.yml
generated
Normal file
23
.licenses/npm/tough-cookie-3.0.1.dep.yml
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
name: tough-cookie
|
||||||
|
version: 3.0.1
|
||||||
|
type: npm
|
||||||
|
summary: RFC6265 Cookies and Cookie Jar for node.js
|
||||||
|
homepage: https://github.com/salesforce/tough-cookie
|
||||||
|
license: bsd-3-clause
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
Copyright (c) 2015, Salesforce.com, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
notices: []
|
||||||
23
.licenses/npm/tough-cookie-4.0.0.dep.yml
generated
Normal file
23
.licenses/npm/tough-cookie-4.0.0.dep.yml
generated
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
---
|
||||||
|
name: tough-cookie
|
||||||
|
version: 4.0.0
|
||||||
|
type: npm
|
||||||
|
summary: RFC6265 Cookies and Cookie Jar for node.js
|
||||||
|
homepage: https://github.com/salesforce/tough-cookie
|
||||||
|
license: bsd-3-clause
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
Copyright (c) 2015, Salesforce.com, Inc.
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||||
|
|
||||||
|
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
|
||||||
|
|
||||||
|
3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
notices: []
|
||||||
35
.licenses/npm/tslib-2.5.0.dep.yml
generated
35
.licenses/npm/tslib-2.5.0.dep.yml
generated
@@ -1,35 +0,0 @@
|
|||||||
---
|
|
||||||
name: tslib
|
|
||||||
version: 2.5.0
|
|
||||||
type: npm
|
|
||||||
summary: Runtime library for TypeScript helper functions
|
|
||||||
homepage: https://www.typescriptlang.org/
|
|
||||||
license: 0bsd
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE.txt
|
|
||||||
text: |-
|
|
||||||
Copyright (c) Microsoft Corporation.
|
|
||||||
|
|
||||||
Permission to use, copy, modify, and/or distribute this software for any
|
|
||||||
purpose with or without fee is hereby granted.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
||||||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
||||||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
||||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
||||||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
||||||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
||||||
PERFORMANCE OF THIS SOFTWARE.
|
|
||||||
notices:
|
|
||||||
- sources: CopyrightNotice.txt
|
|
||||||
text: "/******************************************************************************\r\nCopyright
|
|
||||||
(c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute
|
|
||||||
this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE
|
|
||||||
SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD
|
|
||||||
TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS.
|
|
||||||
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR
|
|
||||||
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE,
|
|
||||||
DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS
|
|
||||||
ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS
|
|
||||||
SOFTWARE.\r\n*****************************************************************************
|
|
||||||
*/"
|
|
||||||
239
.licenses/npm/typescript.dep.yml
generated
239
.licenses/npm/typescript.dep.yml
generated
@@ -1,239 +0,0 @@
|
|||||||
---
|
|
||||||
name: typescript
|
|
||||||
version: 3.9.10
|
|
||||||
type: npm
|
|
||||||
summary: TypeScript is a language for application scale JavaScript development
|
|
||||||
homepage: https://www.typescriptlang.org/
|
|
||||||
license: apache-2.0
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE.txt
|
|
||||||
text: "Apache License\n\nVersion 2.0, January 2004\n\nhttp://www.apache.org/licenses/
|
|
||||||
\n\nTERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n1. Definitions.\n\n\"License\"
|
|
||||||
shall mean the terms and conditions for use, reproduction, and distribution as
|
|
||||||
defined by Sections 1 through 9 of this document.\n\n\"Licensor\" shall mean the
|
|
||||||
copyright owner or entity authorized by the copyright owner that is granting the
|
|
||||||
License.\n\n\"Legal Entity\" shall mean the union of the acting entity and all
|
|
||||||
other entities that control, are controlled by, or are under common control with
|
|
||||||
that entity. For the purposes of this definition, \"control\" means (i) the power,
|
|
||||||
direct or indirect, to cause the direction or management of such entity, whether
|
|
||||||
by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of
|
|
||||||
the outstanding shares, or (iii) beneficial ownership of such entity.\n\n\"You\"
|
|
||||||
(or \"Your\") shall mean an individual or Legal Entity exercising permissions
|
|
||||||
granted by this License.\n\n\"Source\" form shall mean the preferred form for
|
|
||||||
making modifications, including but not limited to software source code, documentation
|
|
||||||
source, and configuration files.\n\n\"Object\" form shall mean any form resulting
|
|
||||||
from mechanical transformation or translation of a Source form, including but
|
|
||||||
not limited to compiled object code, generated documentation, and conversions
|
|
||||||
to other media types.\n\n\"Work\" shall mean the work of authorship, whether in
|
|
||||||
Source or Object form, made available under the License, as indicated by a copyright
|
|
||||||
notice that is included in or attached to the work (an example is provided in
|
|
||||||
the Appendix below).\n\n\"Derivative Works\" shall mean any work, whether in Source
|
|
||||||
or Object form, that is based on (or derived from) the Work and for which the
|
|
||||||
editorial revisions, annotations, elaborations, or other modifications represent,
|
|
||||||
as a whole, an original work of authorship. For the purposes of this License,
|
|
||||||
Derivative Works shall not include works that remain separable from, or merely
|
|
||||||
link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.\n\n\"Contribution\"
|
|
||||||
shall mean any work of authorship, including the original version of the Work
|
|
||||||
and any modifications or additions to that Work or Derivative Works thereof, that
|
|
||||||
is intentionally submitted to Licensor for inclusion in the Work by the copyright
|
|
||||||
owner or by an individual or Legal Entity authorized to submit on behalf of the
|
|
||||||
copyright owner. For the purposes of this definition, \"submitted\" means any
|
|
||||||
form of electronic, verbal, or written communication sent to the Licensor or its
|
|
||||||
representatives, including but not limited to communication on electronic mailing
|
|
||||||
lists, source code control systems, and issue tracking systems that are managed
|
|
||||||
by, or on behalf of, the Licensor for the purpose of discussing and improving
|
|
||||||
the Work, but excluding communication that is conspicuously marked or otherwise
|
|
||||||
designated in writing by the copyright owner as \"Not a Contribution.\"\n\n\"Contributor\"
|
|
||||||
shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution
|
|
||||||
has been received by Licensor and subsequently incorporated within the Work.\n\n2.
|
|
||||||
Grant of Copyright License. Subject to the terms and conditions of this License,
|
|
||||||
each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge,
|
|
||||||
royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works
|
|
||||||
of, publicly display, publicly perform, sublicense, and distribute the Work and
|
|
||||||
such Derivative Works in Source or Object form.\n\n3. Grant of Patent License.
|
|
||||||
Subject to the terms and conditions of this License, each Contributor hereby grants
|
|
||||||
to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
||||||
(except as stated in this section) patent license to make, have made, use, offer
|
|
||||||
to sell, sell, import, and otherwise transfer the Work, where such license applies
|
|
||||||
only to those patent claims licensable by such Contributor that are necessarily
|
|
||||||
infringed by their Contribution(s) alone or by combination of their Contribution(s)
|
|
||||||
with the Work to which such Contribution(s) was submitted. If You institute patent
|
|
||||||
litigation against any entity (including a cross-claim or counterclaim in a lawsuit)
|
|
||||||
alleging that the Work or a Contribution incorporated within the Work constitutes
|
|
||||||
direct or contributory patent infringement, then any patent licenses granted to
|
|
||||||
You under this License for that Work shall terminate as of the date such litigation
|
|
||||||
is filed.\n\n4. Redistribution. You may reproduce and distribute copies of the
|
|
||||||
Work or Derivative Works thereof in any medium, with or without modifications,
|
|
||||||
and in Source or Object form, provided that You meet the following conditions:\n\nYou
|
|
||||||
must give any other recipients of the Work or Derivative Works a copy of this
|
|
||||||
License; and\n\nYou must cause any modified files to carry prominent notices stating
|
|
||||||
that You changed the files; and\n\nYou must retain, in the Source form of any
|
|
||||||
Derivative Works that You distribute, all copyright, patent, trademark, and attribution
|
|
||||||
notices from the Source form of the Work, excluding those notices that do not
|
|
||||||
pertain to any part of the Derivative Works; and\n\nIf the Work includes a \"NOTICE\"
|
|
||||||
text file as part of its distribution, then any Derivative Works that You distribute
|
|
||||||
must include a readable copy of the attribution notices contained within such
|
|
||||||
NOTICE file, excluding those notices that do not pertain to any part of the Derivative
|
|
||||||
Works, in at least one of the following places: within a NOTICE text file distributed
|
|
||||||
as part of the Derivative Works; within the Source form or documentation, if provided
|
|
||||||
along with the Derivative Works; or, within a display generated by the Derivative
|
|
||||||
Works, if and wherever such third-party notices normally appear. The contents
|
|
||||||
of the NOTICE file are for informational purposes only and do not modify the License.
|
|
||||||
You may add Your own attribution notices within Derivative Works that You distribute,
|
|
||||||
alongside or as an addendum to the NOTICE text from the Work, provided that such
|
|
||||||
additional attribution notices cannot be construed as modifying the License. You
|
|
||||||
may add Your own copyright statement to Your modifications and may provide additional
|
|
||||||
or different license terms and conditions for use, reproduction, or distribution
|
|
||||||
of Your modifications, or for any such Derivative Works as a whole, provided Your
|
|
||||||
use, reproduction, and distribution of the Work otherwise complies with the conditions
|
|
||||||
stated in this License.\n\n5. Submission of Contributions. Unless You explicitly
|
|
||||||
state otherwise, any Contribution intentionally submitted for inclusion in the
|
|
||||||
Work by You to the Licensor shall be under the terms and conditions of this License,
|
|
||||||
without any additional terms or conditions. Notwithstanding the above, nothing
|
|
||||||
herein shall supersede or modify the terms of any separate license agreement you
|
|
||||||
may have executed with Licensor regarding such Contributions.\n\n6. Trademarks.
|
|
||||||
This License does not grant permission to use the trade names, trademarks, service
|
|
||||||
marks, or product names of the Licensor, except as required for reasonable and
|
|
||||||
customary use in describing the origin of the Work and reproducing the content
|
|
||||||
of the NOTICE file.\n\n7. Disclaimer of Warranty. Unless required by applicable
|
|
||||||
law or agreed to in writing, Licensor provides the Work (and each Contributor
|
|
||||||
provides its Contributions) on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS
|
|
||||||
OF ANY KIND, either express or implied, including, without limitation, any warranties
|
|
||||||
or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR
|
|
||||||
PURPOSE. You are solely responsible for determining the appropriateness of using
|
|
||||||
or redistributing the Work and assume any risks associated with Your exercise
|
|
||||||
of permissions under this License.\n\n8. Limitation of Liability. In no event
|
|
||||||
and under no legal theory, whether in tort (including negligence), contract, or
|
|
||||||
otherwise, unless required by applicable law (such as deliberate and grossly negligent
|
|
||||||
acts) or agreed to in writing, shall any Contributor be liable to You for damages,
|
|
||||||
including any direct, indirect, special, incidental, or consequential damages
|
|
||||||
of any character arising as a result of this License or out of the use or inability
|
|
||||||
to use the Work (including but not limited to damages for loss of goodwill, work
|
|
||||||
stoppage, computer failure or malfunction, or any and all other commercial damages
|
|
||||||
or losses), even if such Contributor has been advised of the possibility of such
|
|
||||||
damages.\n\n9. Accepting Warranty or Additional Liability. While redistributing
|
|
||||||
the Work or Derivative Works thereof, You may choose to offer, and charge a fee
|
|
||||||
for, acceptance of support, warranty, indemnity, or other liability obligations
|
|
||||||
and/or rights consistent with this License. However, in accepting such obligations,
|
|
||||||
You may act only on Your own behalf and on Your sole responsibility, not on behalf
|
|
||||||
of any other Contributor, and only if You agree to indemnify, defend, and hold
|
|
||||||
each Contributor harmless for any liability incurred by, or claims asserted against,
|
|
||||||
such Contributor by reason of your accepting any such warranty or additional liability.\n\nEND
|
|
||||||
OF TERMS AND CONDITIONS\n"
|
|
||||||
notices:
|
|
||||||
- sources: AUTHORS.md
|
|
||||||
text: "TypeScript is authored by:\r\n\r\n - 0verk1ll\r\n - Abubaker Bashir\r\n -
|
|
||||||
Adam Freidin\r\n - Adam Postma\r\n - Adi Dahiya\r\n - Aditya Daflapurkar\r\n -
|
|
||||||
Adnan Chowdhury\r\n - Adrian Leonhard\r\n - Adrien Gibrat\r\n - Ahmad Farid\r\n
|
|
||||||
- Ajay Poshak\r\n - Alan Agius\r\n - Alan Pierce\r\n - Alessandro Vergani\r\n
|
|
||||||
- Alex Chugaev\r\n - Alex Eagle\r\n - Alex Khomchenko\r\n - Alex Ryan\r\n - Alexander\r\n
|
|
||||||
- Alexander Kuvaev\r\n - Alexander Rusakov\r\n - Alexander Tarasyuk\r\n - Ali
|
|
||||||
Sabzevari\r\n - Aluan Haddad\r\n - amaksimovich2\r\n - Anatoly Ressin\r\n - Anders
|
|
||||||
Hejlsberg\r\n - Anders Kaseorg\r\n - Andre Sutherland\r\n - Andreas Martin\r\n
|
|
||||||
- Andrej Baran\r\n - Andrew\r\n - Andrew Branch\r\n - Andrew Casey\r\n - Andrew
|
|
||||||
Faulkner\r\n - Andrew Ochsner\r\n - Andrew Stegmaier\r\n - Andrew Z Allen\r\n
|
|
||||||
- Andrey Roenko\r\n - Andrii Dieiev\r\n - András Parditka\r\n - Andy Hanson\r\n
|
|
||||||
- Anil Anar\r\n - Anix\r\n - Anton Khlynovskiy\r\n - Anton Tolmachev\r\n - Anubha
|
|
||||||
Mathur\r\n - AnyhowStep\r\n - Armando Aguirre\r\n - Arnaud Tournier\r\n - Arnav
|
|
||||||
Singh\r\n - Arpad Borsos\r\n - Artem Tyurin\r\n - Arthur Ozga\r\n - Asad Saeeduddin\r\n
|
|
||||||
- Austin Cummings\r\n - Avery Morin\r\n - Aziz Khambati\r\n - Basarat Ali Syed\r\n
|
|
||||||
- @begincalendar\r\n - Ben Duffield\r\n - Ben Lichtman\r\n - Ben Mosher\r\n -
|
|
||||||
Benedikt Meurer\r\n - Benjamin Bock\r\n - Benjamin Lichtman\r\n - Benny Neugebauer\r\n
|
|
||||||
- BigAru\r\n - Bill Ticehurst\r\n - Blaine Bublitz\r\n - Blake Embrey\r\n - @bluelovers\r\n
|
|
||||||
- @bootstraponline\r\n - Bowden Kelly\r\n - Bowden Kenny\r\n - Brad Zacher\r\n
|
|
||||||
- Brandon Banks\r\n - Brandon Bloom\r\n - Brandon Slade\r\n - Brendan Kenny\r\n
|
|
||||||
- Brett Mayen\r\n - Brian Terlson\r\n - Bryan Forbes\r\n - Caitlin Potter\r\n
|
|
||||||
- Caleb Sander\r\n - Cameron Taggart\r\n - @cedvdb\r\n - Charles\r\n - Charles
|
|
||||||
Pierce\r\n - Charly POLY\r\n - Chris Bubernak\r\n - Chris Patterson\r\n - christian\r\n
|
|
||||||
- Christophe Vidal\r\n - Chuck Jazdzewski\r\n - Clay Miller\r\n - Colby Russell\r\n
|
|
||||||
- Colin Snover\r\n - Collins Abitekaniza\r\n - Connor Clark\r\n - Cotton Hou\r\n
|
|
||||||
- csigs\r\n - Cyrus Najmabadi\r\n - Dafrok Zhang\r\n - Dahan Gong\r\n - Daiki
|
|
||||||
Nishikawa\r\n - Dan Corder\r\n - Dan Freeman\r\n - Dan Quirk\r\n - Dan Rollo\r\n
|
|
||||||
- Daniel Gooss\r\n - Daniel Imms\r\n - Daniel Krom\r\n - Daniel Król\r\n - Daniel
|
|
||||||
Lehenbauer\r\n - Daniel Rosenwasser\r\n - David Li\r\n - David Sheldrick\r\n -
|
|
||||||
David Sherret\r\n - David Souther\r\n - David Staheli\r\n - Denis Nedelyaev\r\n
|
|
||||||
- Derek P Sifford\r\n - Dhruv Rajvanshi\r\n - Dick van den Brink\r\n - Diogo Franco
|
|
||||||
(Kovensky)\r\n - Dirk Bäumer\r\n - Dirk Holtwick\r\n - Dmitrijs Minajevs\r\n -
|
|
||||||
Dom Chen\r\n - Donald Pipowitch\r\n - Doug Ilijev\r\n - dreamran43@gmail.com\r\n
|
|
||||||
- @e-cloud\r\n - Ecole Keine\r\n - Eddie Jaoude\r\n - Edward Thomson\r\n - EECOLOR\r\n
|
|
||||||
- Eli Barzilay\r\n - Elizabeth Dinella\r\n - Ely Alamillo\r\n - Eric Grube\r\n
|
|
||||||
- Eric Tsang\r\n - Erik Edrosa\r\n - Erik McClenney\r\n - Esakki Raj\r\n - Ethan
|
|
||||||
Resnick\r\n - Ethan Rubio\r\n - Eugene Timokhov\r\n - Evan Cahill\r\n - Evan Martin\r\n
|
|
||||||
- Evan Sebastian\r\n - ExE Boss\r\n - Eyas Sharaiha\r\n - Fabian Cook\r\n - @falsandtru\r\n
|
|
||||||
- Filipe Silva\r\n - @flowmemo\r\n - Forbes Lindesay\r\n - Francois Hendriks\r\n
|
|
||||||
- Francois Wouts\r\n - Frank Wallis\r\n - František Žiacik\r\n - Frederico Bittencourt\r\n
|
|
||||||
- fullheightcoding\r\n - Gabe Moothart\r\n - Gabriel Isenberg\r\n - Gabriela Araujo
|
|
||||||
Britto\r\n - Gabriela Britto\r\n - gb714us\r\n - Gilad Peleg\r\n - Godfrey Chan\r\n
|
|
||||||
- Gorka Hernández Estomba\r\n - Graeme Wicksted\r\n - Guillaume Salles\r\n - Guy
|
|
||||||
Bedford\r\n - hafiz\r\n - Halasi Tamás\r\n - Hendrik Liebau\r\n - Henry Mercer\r\n
|
|
||||||
- Herrington Darkholme\r\n - Hoang Pham\r\n - Holger Jeromin\r\n - Homa Wong\r\n
|
|
||||||
- Hye Sung Jung\r\n - Iain Monro\r\n - @IdeaHunter\r\n - Igor Novozhilov\r\n -
|
|
||||||
Igor Oleinikov\r\n - Ika\r\n - iliashkolyar\r\n - IllusionMH\r\n - Ingvar Stepanyan\r\n
|
|
||||||
- Ingvar Stepanyan\r\n - Isiah Meadows\r\n - ispedals\r\n - Ivan Enderlin\r\n
|
|
||||||
- Ivo Gabe de Wolff\r\n - Iwata Hidetaka\r\n - Jack Bates\r\n - Jack Williams\r\n
|
|
||||||
- Jake Boone\r\n - Jakub Korzeniowski\r\n - Jakub Młokosiewicz\r\n - James Henry\r\n
|
|
||||||
- James Keane\r\n - James Whitney\r\n - Jan Melcher\r\n - Jason Freeman\r\n -
|
|
||||||
Jason Jarrett\r\n - Jason Killian\r\n - Jason Ramsay\r\n - JBerger\r\n - Jean
|
|
||||||
Pierre\r\n - Jed Mao\r\n - Jeff Wilcox\r\n - Jeffrey Morlan\r\n - Jesse Schalken\r\n
|
|
||||||
- Jesse Trinity\r\n - Jing Ma\r\n - Jiri Tobisek\r\n - Joe Calzaretta\r\n - Joe
|
|
||||||
Chung\r\n - Joel Day\r\n - Joey Watts\r\n - Johannes Rieken\r\n - John Doe\r\n
|
|
||||||
- John Vilk\r\n - Jonathan Bond-Caron\r\n - Jonathan Park\r\n - Jonathan Toland\r\n
|
|
||||||
- Jordan Harband\r\n - Jordi Oliveras Rovira\r\n - Joscha Feth\r\n - Joseph Wunderlich\r\n
|
|
||||||
- Josh Abernathy\r\n - Josh Goldberg\r\n - Josh Kalderimis\r\n - Josh Soref\r\n
|
|
||||||
- Juan Luis Boya García\r\n - Julian Williams\r\n - Justin Bay\r\n - Justin Johansson\r\n
|
|
||||||
- jwbay\r\n - K. Preißer\r\n - Kagami Sascha Rosylight\r\n - Kanchalai Tanglertsampan\r\n
|
|
||||||
- karthikkp\r\n - Kate Miháliková\r\n - Keen Yee Liau\r\n - Keith Mashinter\r\n
|
|
||||||
- Ken Howard\r\n - Kenji Imamula\r\n - Kerem Kat\r\n - Kevin Donnelly\r\n - Kevin
|
|
||||||
Gibbons\r\n - Kevin Lang\r\n - Khải\r\n - Kitson Kelly\r\n - Klaus Meinhardt\r\n
|
|
||||||
- Kris Zyp\r\n - Kyle Kelley\r\n - Kārlis Gaņģis\r\n - laoxiong\r\n - Leon Aves\r\n
|
|
||||||
- Limon Monte\r\n - Lorant Pinter\r\n - Lucien Greathouse\r\n - Luka Hartwig\r\n
|
|
||||||
- Lukas Elmer\r\n - M.Yoshimura\r\n - Maarten Sijm\r\n - Magnus Hiie\r\n - Magnus
|
|
||||||
Kulke\r\n - Manish Bansal\r\n - Manish Giri\r\n - Marcus Noble\r\n - Marin Marinov\r\n
|
|
||||||
- Marius Schulz\r\n - Markus Johnsson\r\n - Markus Wolf\r\n - Martin\r\n - Martin
|
|
||||||
Hiller\r\n - Martin Johns\r\n - Martin Probst\r\n - Martin Vseticka\r\n - Martyn
|
|
||||||
Janes\r\n - Masahiro Wakame\r\n - Mateusz Burzyński\r\n - Matt Bierner\r\n - Matt
|
|
||||||
McCutchen\r\n - Matt Mitchell\r\n - Matthew Aynalem\r\n - Matthew Miller\r\n -
|
|
||||||
Mattias Buelens\r\n - Max Heiber\r\n - Maxwell Paul Brickner\r\n - @meyer\r\n
|
|
||||||
- Micah Zoltu\r\n - @micbou\r\n - Michael\r\n - Michael Crane\r\n - Michael Henderson\r\n
|
|
||||||
- Michael Tamm\r\n - Michael Tang\r\n - Michal Przybys\r\n - Mike Busyrev\r\n
|
|
||||||
- Mike Morearty\r\n - Milosz Piechocki\r\n - Mine Starks\r\n - Minh Nguyen\r\n
|
|
||||||
- Mohamed Hegazy\r\n - Mohsen Azimi\r\n - Mukesh Prasad\r\n - Myles Megyesi\r\n
|
|
||||||
- Nathan Day\r\n - Nathan Fenner\r\n - Nathan Shively-Sanders\r\n - Nathan Yee\r\n
|
|
||||||
- ncoley\r\n - Nicholas Yang\r\n - Nicu Micleușanu\r\n - @nieltg\r\n - Nima Zahedi\r\n
|
|
||||||
- Noah Chen\r\n - Noel Varanda\r\n - Noel Yoo\r\n - Noj Vek\r\n - nrcoley\r\n
|
|
||||||
- Nuno Arruda\r\n - Oleg Mihailik\r\n - Oleksandr Chekhovskyi\r\n - Omer Sheikh\r\n
|
|
||||||
- Orta Therox\r\n - Orta Therox\r\n - Oskar Grunning\r\n - Oskar Segersva¨rd\r\n
|
|
||||||
- Oussama Ben Brahim\r\n - Ozair Patel\r\n - Patrick McCartney\r\n - Patrick Zhong\r\n
|
|
||||||
- Paul Koerbitz\r\n - Paul van Brenk\r\n - @pcbro\r\n - Pedro Maltez\r\n - Pete
|
|
||||||
Bacon Darwin\r\n - Peter Burns\r\n - Peter Šándor\r\n - Philip Pesca\r\n - Philippe
|
|
||||||
Voinov\r\n - Pi Lanningham\r\n - Piero Cangianiello\r\n - Pierre-Antoine Mills\r\n
|
|
||||||
- @piloopin\r\n - Pranav Senthilnathan\r\n - Prateek Goel\r\n - Prateek Nayak\r\n
|
|
||||||
- Prayag Verma\r\n - Priyantha Lankapura\r\n - @progre\r\n - Punya Biswal\r\n
|
|
||||||
- r7kamura\r\n - Rado Kirov\r\n - Raj Dosanjh\r\n - rChaser53\r\n - Reiner Dolp\r\n
|
|
||||||
- Remo H. Jansen\r\n - @rflorian\r\n - Rhys van der Waerden\r\n - @rhysd\r\n -
|
|
||||||
Ricardo N Feliciano\r\n - Richard Karmazín\r\n - Richard Knoll\r\n - Roger Spratley\r\n
|
|
||||||
- Ron Buckton\r\n - Rostislav Galimsky\r\n - Rowan Wyborn\r\n - rpgeeganage\r\n
|
|
||||||
- Ruwan Pradeep Geeganage\r\n - Ryan Cavanaugh\r\n - Ryan Clarke\r\n - Ryohei
|
|
||||||
Ikegami\r\n - Salisbury, Tom\r\n - Sam Bostock\r\n - Sam Drugan\r\n - Sam El-Husseini\r\n
|
|
||||||
- Sam Lanning\r\n - Sangmin Lee\r\n - Sanket Mishra\r\n - Sarangan Rajamanickam\r\n
|
|
||||||
- Sasha Joseph\r\n - Sean Barag\r\n - Sergey Rubanov\r\n - Sergey Shandar\r\n
|
|
||||||
- Sergey Tychinin\r\n - Sergii Bezliudnyi\r\n - Sergio Baidon\r\n - Sharon Rolel\r\n
|
|
||||||
- Sheetal Nandi\r\n - Shengping Zhong\r\n - Sheon Han\r\n - Shyyko Serhiy\r\n
|
|
||||||
- Siddharth Singh\r\n - sisisin\r\n - Slawomir Sadziak\r\n - Solal Pirelli\r\n
|
|
||||||
- Soo Jae Hwang\r\n - Stan Thomas\r\n - Stanislav Iliev\r\n - Stanislav Sysoev\r\n
|
|
||||||
- Stas Vilchik\r\n - Stephan Ginthör\r\n - Steve Lucco\r\n - @styfle\r\n - Sudheesh
|
|
||||||
Singanamalla\r\n - Suhas\r\n - Suhas Deshpande\r\n - superkd37\r\n - Sébastien
|
|
||||||
Arod\r\n - @T18970237136\r\n - @t_\r\n - Tan Li Hau\r\n - Tapan Prakash\r\n -
|
|
||||||
Taras Mankovski\r\n - Tarik Ozket\r\n - Tetsuharu Ohzeki\r\n - The Gitter Badger\r\n
|
|
||||||
- Thomas den Hollander\r\n - Thorsten Ball\r\n - Tien Hoanhtien\r\n - Tim Lancina\r\n
|
|
||||||
- Tim Perry\r\n - Tim Schaub\r\n - Tim Suchanek\r\n - Tim Viiding-Spader\r\n -
|
|
||||||
Tingan Ho\r\n - Titian Cernicova-Dragomir\r\n - tkondo\r\n - Todd Thomson\r\n
|
|
||||||
- togru\r\n - Tom J\r\n - Torben Fitschen\r\n - Toxyxer\r\n - @TravCav\r\n - Troy
|
|
||||||
Tae\r\n - TruongSinh Tran-Nguyen\r\n - Tycho Grouwstra\r\n - uhyo\r\n - Vadi Taslim\r\n
|
|
||||||
- Vakhurin Sergey\r\n - Valera Rozuvan\r\n - Vilic Vane\r\n - Vimal Raghubir\r\n
|
|
||||||
- Vladimir Kurchatkin\r\n - Vladimir Matveev\r\n - Vyacheslav Pukhanov\r\n - Wenlu
|
|
||||||
Wang\r\n - Wes Souza\r\n - Wesley Wigham\r\n - William Orr\r\n - Wilson Hobbs\r\n
|
|
||||||
- xiaofa\r\n - xl1\r\n - Yacine Hmito\r\n - Yang Cao\r\n - York Yao\r\n - @yortus\r\n
|
|
||||||
- Yoshiki Shibukawa\r\n - Yuichi Nukiyama\r\n - Yuval Greenfield\r\n - Yuya Tanaka\r\n
|
|
||||||
- Z\r\n - Zeeshan Ahmed\r\n - Zev Spitz\r\n - Zhengbo Li\r\n - Zixiang Li\r\n
|
|
||||||
- @Zzzen\r\n - 阿卡琳"
|
|
||||||
34
.licenses/npm/undici.dep.yml
generated
34
.licenses/npm/undici.dep.yml
generated
@@ -1,34 +0,0 @@
|
|||||||
---
|
|
||||||
name: undici
|
|
||||||
version: 5.29.0
|
|
||||||
type: npm
|
|
||||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
|
||||||
homepage: https://undici.nodejs.org
|
|
||||||
license: mit
|
|
||||||
licenses:
|
|
||||||
- sources: LICENSE
|
|
||||||
text: |
|
|
||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) Matteo Collina and Undici contributors
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
- sources: README.md
|
|
||||||
text: MIT
|
|
||||||
notices: []
|
|
||||||
33
.licenses/npm/universalify.dep.yml
generated
Normal file
33
.licenses/npm/universalify.dep.yml
generated
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
---
|
||||||
|
name: universalify
|
||||||
|
version: 0.1.2
|
||||||
|
type: npm
|
||||||
|
summary: Make a callback- or promise-based function support both promises and callbacks.
|
||||||
|
homepage: https://github.com/RyanZim/universalify#readme
|
||||||
|
license: mit
|
||||||
|
licenses:
|
||||||
|
- sources: LICENSE
|
||||||
|
text: |
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (c) 2017, Ryan Zimmerman <opensrc@ryanzim.com>
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||||
|
this software and associated documentation files (the 'Software'), to deal in
|
||||||
|
the Software without restriction, including without limitation the rights to
|
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||||
|
subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
- sources: README.md
|
||||||
|
text: MIT
|
||||||
|
notices: []
|
||||||
2
.licenses/npm/xml2js.dep.yml
generated
2
.licenses/npm/xml2js.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: xml2js
|
name: xml2js
|
||||||
version: 0.5.0
|
version: 0.4.23
|
||||||
type: npm
|
type: npm
|
||||||
summary: Simple XML to JavaScript object converter.
|
summary: Simple XML to JavaScript object converter.
|
||||||
homepage: https://github.com/Leonidas-from-XIV/node-xml2js
|
homepage: https://github.com/Leonidas-from-XIV/node-xml2js
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
# Ignore list
|
|
||||||
/*
|
|
||||||
|
|
||||||
# Do not ignore these folders:
|
|
||||||
!__tests__/
|
|
||||||
!.github/
|
|
||||||
!src/
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
// This is a reusable configuration file copied from https://github.com/actions/reusable-workflows/tree/main/reusable-configurations. Please don't make changes to this file as it's the subject of an automatic update.
|
|
||||||
module.exports = {
|
|
||||||
printWidth: 80,
|
|
||||||
tabWidth: 2,
|
|
||||||
useTabs: false,
|
|
||||||
semi: true,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'none',
|
|
||||||
bracketSpacing: false,
|
|
||||||
arrowParens: 'avoid'
|
|
||||||
};
|
|
||||||
11
.prettierrc.json
Normal file
11
.prettierrc.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"printWidth": 100,
|
||||||
|
"tabWidth": 2,
|
||||||
|
"useTabs": false,
|
||||||
|
"semi": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"bracketSpacing": true,
|
||||||
|
"arrowParens": "avoid",
|
||||||
|
"parser": "typescript"
|
||||||
|
}
|
||||||
22
README.md
22
README.md
@@ -5,7 +5,7 @@
|
|||||||
[](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
|
[](https://github.com/actions/setup-java/actions/workflows/e2e-cache.yml)
|
||||||
|
|
||||||
The `setup-java` action provides the following functionality for GitHub Actions runners:
|
The `setup-java` action provides the following functionality for GitHub Actions runners:
|
||||||
- Downloading and setting up a requested version of Java. See [Usage](#usage) for a list of supported distributions.
|
- Downloading and setting up a requested version of Java. See [Usage](#Usage) for a list of supported distributions.
|
||||||
- Extracting and caching custom version of Java from a local file.
|
- Extracting and caching custom version of Java from a local file.
|
||||||
- Configuring runner for publishing using Apache Maven.
|
- Configuring runner for publishing using Apache Maven.
|
||||||
- Configuring runner for publishing using Gradle.
|
- Configuring runner for publishing using Gradle.
|
||||||
@@ -31,7 +31,7 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `distribution`: _(required)_ Java [distribution](#supported-distributions).
|
- `distribution`: _(required)_ Java [distribution](#supported-distributions).
|
||||||
|
|
||||||
- `java-package`: The packaging variant of the chosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
|
- `java-package`: The packaging variant of the choosen distribution. Possible values: `jdk`, `jre`, `jdk+fx`, `jre+fx`. Default value: `jdk`.
|
||||||
|
|
||||||
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
- `architecture`: The target architecture of the package. Possible values: `x86`, `x64`, `armv7`, `aarch64`, `ppc64le`. Default value: Derived from the runner machine.
|
||||||
|
|
||||||
@@ -39,12 +39,12 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
- `check-latest`: Setting this option makes the action to check for the latest available version for the version spec.
|
||||||
|
|
||||||
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predefined package managers. It can be one of "maven", "gradle" or "sbt".
|
- `cache`: Quick [setup caching](#caching-packages-dependencies) for the dependencies managed through one of the predifined package managers. It can be one of "maven", "gradle" or "sbt".
|
||||||
|
|
||||||
#### Maven options
|
#### Maven options
|
||||||
The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
|
The action has a bunch of inputs to generate maven's [settings.xml](https://maven.apache.org/settings.html) on the fly and pass the values to Apache Maven GPG Plugin as well as Apache Maven Toolchains. See [advanced usage](docs/advanced-usage.md) for more.
|
||||||
|
|
||||||
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists, set this to `false`.
|
- `overwrite-settings`: By default action overwrites the settings.xml. In order to skip generation of file if it exists set this to `false`.
|
||||||
|
|
||||||
- `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
|
- `server-id`: ID of the distributionManagement repository in the pom.xml file. Default is `github`.
|
||||||
|
|
||||||
@@ -56,7 +56,7 @@ This action allows you to work with Java and Scala projects.
|
|||||||
|
|
||||||
- `gpg-private-key`: GPG private key to import. Default is empty string.
|
- `gpg-private-key`: GPG private key to import. Default is empty string.
|
||||||
|
|
||||||
- `gpg-passphrase`: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
|
- `gpg-passphrase`: description: Environment variable name for the GPG private key passphrase. Default is GPG_PASSPHRASE.
|
||||||
|
|
||||||
- `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
|
- `mvn-toolchain-id`: Name of Maven Toolchain ID if the default name of `${distribution}_${java-version}` is not wanted.
|
||||||
|
|
||||||
@@ -103,21 +103,19 @@ Currently, the following distributions are supported:
|
|||||||
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
|
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
|
||||||
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
|
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
|
||||||
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
|
| `corretto` | Amazon Corretto Build of OpenJDK | [Link](https://aws.amazon.com/corretto/) | [Link](https://aws.amazon.com/corretto/faqs/)
|
||||||
| `semeru` | IBM Semeru Runtime Open Edition | [Link](https://developer.ibm.com/languages/java/semeru-runtimes/downloads/) | [Link](https://openjdk.java.net/legal/gplv2+ce.html) |
|
|
||||||
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
|
| `oracle` | Oracle JDK | [Link](https://www.oracle.com/java/technologies/downloads/) | [Link](https://java.com/freeuselicense)
|
||||||
| `dragonwell` | Alibaba Dragonwell JDK | [Link](https://dragonwell-jdk.io/) | [Link](https://www.aliyun.com/product/dragonwell/)
|
|
||||||
|
|
||||||
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
|
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
|
||||||
|
|
||||||
**NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` and `adopt-openj9`, to `temurin` and `semeru` respectively, to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
|
**NOTE:** AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
|
||||||
|
|
||||||
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
**NOTE:** For Azul Zulu OpenJDK architectures x64 and arm64 are mapped to x86 / arm with proper hw_bitness.
|
||||||
|
|
||||||
### Caching packages dependencies
|
### Caching packages dependencies
|
||||||
The action has a built-in functionality for caching and restoring dependencies. It uses [toolkit/cache](https://github.com/actions/toolkit/tree/main/packages/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
|
The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under hood for caching dependencies but requires less configuration settings. Supported package managers are gradle, maven and sbt. The format of the used cache key is `setup-java-${{ platform }}-${{ packageManager }}-${{ fileHash }}`, where the hash is based on the following files:
|
||||||
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, `gradle/*.versions.toml`, and `**/versions.properties`
|
- gradle: `**/*.gradle*`, `**/gradle-wrapper.properties`, `buildSrc/**/Versions.kt`, `buildSrc/**/Dependencies.kt`, and `gradle/*.versions.toml`
|
||||||
- maven: `**/pom.xml`
|
- maven: `**/pom.xml`
|
||||||
- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.scala`, `**/project/**.sbt`
|
- sbt: all sbt build definition files `**/*.sbt`, `**/project/build.properties`, `**/project/**.{scala,sbt}`
|
||||||
|
|
||||||
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
|
The workflow output `cache-hit` is set to indicate if an exact match was found for the key [as actions/cache does](https://github.com/actions/cache/tree/main#outputs).
|
||||||
|
|
||||||
@@ -227,8 +225,6 @@ In the example above multiple JDKs are installed for the same job. The result af
|
|||||||
- [Liberica](docs/advanced-usage.md#Liberica)
|
- [Liberica](docs/advanced-usage.md#Liberica)
|
||||||
- [Microsoft](docs/advanced-usage.md#Microsoft)
|
- [Microsoft](docs/advanced-usage.md#Microsoft)
|
||||||
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
- [Amazon Corretto](docs/advanced-usage.md#Amazon-Corretto)
|
||||||
- [Oracle](docs/advanced-usage.md#Oracle)
|
|
||||||
- [Alibaba Dragonwell](docs/advanced-usage.md#Alibaba-Dragonwell)
|
|
||||||
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
- [Installing custom Java 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)
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import * as io from '@actions/io';
|
import io = require('@actions/io');
|
||||||
|
import fs = require('fs');
|
||||||
|
import path = require('path');
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as fs from 'fs';
|
|
||||||
import * as path from 'path';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import * as auth from '../src/auth';
|
import * as auth from '../src/auth';
|
||||||
import {M2_DIR, MVN_SETTINGS_FILE} from '../src/constants';
|
import { M2_DIR, MVN_SETTINGS_FILE } from '../src/constants';
|
||||||
|
|
||||||
const m2Dir = path.join(__dirname, M2_DIR);
|
const m2Dir = path.join(__dirname, M2_DIR);
|
||||||
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
|
const settingsFile = path.join(m2Dir, MVN_SETTINGS_FILE);
|
||||||
@@ -42,13 +42,7 @@ describe('auth tests', () => {
|
|||||||
const altSettingsFile = path.join(altHome, MVN_SETTINGS_FILE);
|
const altSettingsFile = path.join(altHome, MVN_SETTINGS_FILE);
|
||||||
await io.rmRF(altHome); // ensure it doesn't already exist
|
await io.rmRF(altHome); // ensure it doesn't already exist
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, altHome, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
altHome,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(false);
|
expect(fs.existsSync(m2Dir)).toBe(false);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(false);
|
expect(fs.existsSync(settingsFile)).toBe(false);
|
||||||
@@ -67,19 +61,11 @@ describe('auth tests', () => {
|
|||||||
const username = 'UNAME';
|
const username = 'UNAME';
|
||||||
const password = 'TOKEN';
|
const password = 'TOKEN';
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password));
|
||||||
auth.generate(id, username, password)
|
|
||||||
);
|
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('creates settings.xml with additional configuration', async () => {
|
it('creates settings.xml with additional configuration', async () => {
|
||||||
@@ -88,14 +74,7 @@ describe('auth tests', () => {
|
|||||||
const password = 'TOKEN';
|
const password = 'TOKEN';
|
||||||
const gpgPassphrase = 'GPG';
|
const gpgPassphrase = 'GPG';
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true, gpgPassphrase);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true,
|
|
||||||
gpgPassphrase
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
@@ -109,24 +88,16 @@ describe('auth tests', () => {
|
|||||||
const username = 'USERNAME';
|
const username = 'USERNAME';
|
||||||
const password = 'PASSWORD';
|
const password = 'PASSWORD';
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, true);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(settingsFile, 'utf-8')).toEqual(auth.generate(id, username, password));
|
||||||
auth.generate(id, username, password)
|
|
||||||
);
|
|
||||||
}, 100000);
|
}, 100000);
|
||||||
|
|
||||||
it('does not overwrite existing settings.xml files', async () => {
|
it('does not overwrite existing settings.xml files', async () => {
|
||||||
@@ -134,18 +105,12 @@ describe('auth tests', () => {
|
|||||||
const username = 'USERNAME';
|
const username = 'USERNAME';
|
||||||
const password = 'PASSWORD';
|
const password = 'PASSWORD';
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
fs.writeFileSync(settingsFile, 'FAKE FILE');
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
|
|
||||||
await auth.createAuthenticationSettings(
|
await auth.createAuthenticationSettings(id, username, password, m2Dir, false);
|
||||||
id,
|
|
||||||
username,
|
|
||||||
password,
|
|
||||||
m2Dir,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(settingsFile)).toBe(true);
|
expect(fs.existsSync(settingsFile)).toBe(true);
|
||||||
@@ -194,8 +159,6 @@ describe('auth tests', () => {
|
|||||||
</servers>
|
</servers>
|
||||||
</settings>`;
|
</settings>`;
|
||||||
|
|
||||||
expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(
|
expect(auth.generate(id, username, password, gpgPassphrase)).toEqual(expectedSettings);
|
||||||
expectedSettings
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {mkdtempSync} from 'fs';
|
import { mkdtempSync } from 'fs';
|
||||||
import {tmpdir} from 'os';
|
import { tmpdir } from 'os';
|
||||||
import {join} from 'path';
|
import { join } from 'path';
|
||||||
import {restore, save} from '../src/cache';
|
import { restore, save } from '../src/cache';
|
||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
@@ -68,21 +68,17 @@ describe('dependency cache', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheRestore = jest
|
spyCacheRestore = jest
|
||||||
.spyOn(cache, 'restoreCache')
|
.spyOn(cache, 'restoreCache')
|
||||||
.mockImplementation((paths: string[], primaryKey: string) =>
|
.mockImplementation((paths: string[], primaryKey: string) => Promise.resolve(undefined));
|
||||||
Promise.resolve(undefined)
|
|
||||||
);
|
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if unsupported package manager specified', () => {
|
it('throws error if unsupported package manager specified', () => {
|
||||||
return expect(restore('ant')).rejects.toThrow(
|
return expect(restore('ant')).rejects.toThrowError('unknown package manager specified: ant');
|
||||||
'unknown package manager specified: ant'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('throws error if no pom.xml found', async () => {
|
it('throws error if no pom.xml found', async () => {
|
||||||
await expect(restore('maven')).rejects.toThrow(
|
await expect(restore('maven')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/pom.xml], make sure you have checked out the target repository`
|
)} matched to [**/pom.xml], make sure you have checked out the target repository`
|
||||||
@@ -92,43 +88,43 @@ describe('dependency cache', () => {
|
|||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
await restore('maven');
|
await restore('maven');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('maven cache is not found');
|
expect(spyInfo).toBeCalledWith('maven cache is not found');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
it('throws error if no build.gradle found', async () => {
|
it('throws error if no build.gradle found', async () => {
|
||||||
await expect(restore('gradle')).rejects.toThrow(
|
await expect(restore('gradle')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml,**/versions.properties], make sure you have checked out the target repository`
|
)} matched to [**/*.gradle*,**/gradle-wrapper.properties,buildSrc/**/Versions.kt,buildSrc/**/Dependencies.kt,gradle/*.versions.toml], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('downloads cache based on build.gradle', async () => {
|
it('downloads cache based on build.gradle', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
|
||||||
await restore('gradle');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
});
|
});
|
||||||
it('downloads cache based on build.gradle.kts', async () => {
|
it('downloads cache based on build.gradle.kts', async () => {
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
createFile(join(workspace, 'build.gradle.kts'));
|
||||||
|
|
||||||
await restore('gradle');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
});
|
});
|
||||||
it('downloads cache based on libs.versions.toml', async () => {
|
it('downloads cache based on libs.versions.toml', async () => {
|
||||||
createDirectory(join(workspace, 'gradle'));
|
createDirectory(join(workspace, 'gradle'));
|
||||||
createFile(join(workspace, 'gradle', 'libs.versions.toml'));
|
createFile(join(workspace, 'gradle', 'libs.versions.toml'));
|
||||||
|
|
||||||
await restore('gradle');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
it('downloads cache based on buildSrc/Versions.kt', async () => {
|
it('downloads cache based on buildSrc/Versions.kt', async () => {
|
||||||
@@ -136,56 +132,26 @@ describe('dependency cache', () => {
|
|||||||
createFile(join(workspace, 'buildSrc', 'Versions.kt'));
|
createFile(join(workspace, 'buildSrc', 'Versions.kt'));
|
||||||
|
|
||||||
await restore('gradle');
|
await restore('gradle');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
expect(spyInfo).toBeCalledWith('gradle cache is not found');
|
||||||
});
|
});
|
||||||
describe('for sbt', () => {
|
describe('for sbt', () => {
|
||||||
it('throws error if no build.sbt found', async () => {
|
it('throws error if no build.sbt found', async () => {
|
||||||
await expect(restore('sbt')).rejects.toThrow(
|
await expect(restore('sbt')).rejects.toThrowError(
|
||||||
`No file in ${projectRoot(
|
`No file in ${projectRoot(
|
||||||
workspace
|
workspace
|
||||||
)} matched to [**/*.sbt,**/project/build.properties,**/project/**.scala,**/project/**.sbt], make sure you have checked out the target repository`
|
)} matched to [**/*.sbt,**/project/build.properties,**/project/**.{scala,sbt}], make sure you have checked out the target repository`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('downloads cache', async () => {
|
it('downloads cache', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
|
|
||||||
await restore('sbt');
|
await restore('sbt');
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
expect(spyCacheRestore).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith('sbt cache is not found');
|
expect(spyInfo).toBeCalledWith('sbt cache is not found');
|
||||||
});
|
});
|
||||||
it('detects scala and sbt changes under **/project/ folder', async () => {
|
|
||||||
createFile(join(workspace, 'build.sbt'));
|
|
||||||
createDirectory(join(workspace, 'project'));
|
|
||||||
createFile(join(workspace, 'project/DependenciesV1.scala'));
|
|
||||||
|
|
||||||
await restore('sbt');
|
|
||||||
const firstCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
spySaveState.mockClear();
|
|
||||||
await restore('sbt');
|
|
||||||
const secondCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
// Make sure multiple restores produce the same cache
|
|
||||||
expect(firstCall).toBe(secondCall);
|
|
||||||
|
|
||||||
spySaveState.mockClear();
|
|
||||||
createFile(join(workspace, 'project/DependenciesV2.scala'));
|
|
||||||
await restore('sbt');
|
|
||||||
const thirdCall = spySaveState.mock.calls.toString();
|
|
||||||
|
|
||||||
expect(firstCall).not.toBe(thirdCall);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
it('downloads cache based on versions.properties', async () => {
|
|
||||||
createFile(join(workspace, 'versions.properties'));
|
|
||||||
|
|
||||||
await restore('gradle');
|
|
||||||
expect(spyCacheRestore).toHaveBeenCalled();
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith('gradle cache is not found');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('save', () => {
|
describe('save', () => {
|
||||||
@@ -197,16 +163,12 @@ describe('dependency cache', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyCacheSave = jest
|
spyCacheSave = jest
|
||||||
.spyOn(cache, 'saveCache')
|
.spyOn(cache, 'saveCache')
|
||||||
.mockImplementation((paths: string[], key: string) =>
|
.mockImplementation((paths: string[], key: string) => Promise.resolve(0));
|
||||||
Promise.resolve(0)
|
|
||||||
);
|
|
||||||
spyWarning.mockImplementation(() => null);
|
spyWarning.mockImplementation(() => null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('throws error if unsupported package manager specified', () => {
|
it('throws error if unsupported package manager specified', () => {
|
||||||
return expect(save('ant')).rejects.toThrow(
|
return expect(save('ant')).rejects.toThrowError('unknown package manager specified: ant');
|
||||||
'unknown package manager specified: ant'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('save with -1 cacheId , should not fail workflow', async () => {
|
it('save with -1 cacheId , should not fail workflow', async () => {
|
||||||
@@ -214,12 +176,10 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalled();
|
expect(spyInfo).toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('saves with error from toolkit, should fail workflow', async () => {
|
it('saves with error from toolkit, should fail workflow', async () => {
|
||||||
@@ -229,37 +189,31 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
expect.assertions(1);
|
expect.assertions(1);
|
||||||
await expect(save('maven')).rejects.toEqual(
|
await expect(save('maven')).rejects.toEqual(new cache.ValidationError('Validation failed'));
|
||||||
new cache.ValidationError('Validation failed')
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('for maven', () => {
|
describe('for maven', () => {
|
||||||
it('uploads cache even if no pom.xml found', async () => {
|
it('uploads cache even if no pom.xml found', async () => {
|
||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache', async () => {
|
it('uploads cache', async () => {
|
||||||
createFile(join(workspace, 'pom.xml'));
|
createFile(join(workspace, 'pom.xml'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('maven');
|
await save('maven');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('for gradle', () => {
|
describe('for gradle', () => {
|
||||||
@@ -267,39 +221,33 @@ describe('dependency cache', () => {
|
|||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on build.gradle', async () => {
|
it('uploads cache based on build.gradle', async () => {
|
||||||
createFile(join(workspace, 'build.gradle'));
|
createFile(join(workspace, 'build.gradle'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on build.gradle.kts', async () => {
|
it('uploads cache based on build.gradle.kts', async () => {
|
||||||
createFile(join(workspace, 'build.gradle.kts'));
|
createFile(join(workspace, 'build.gradle.kts'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache based on buildSrc/Versions.kt', async () => {
|
it('uploads cache based on buildSrc/Versions.kt', async () => {
|
||||||
createDirectory(join(workspace, 'buildSrc'));
|
createDirectory(join(workspace, 'buildSrc'));
|
||||||
@@ -307,50 +255,33 @@ describe('dependency cache', () => {
|
|||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('gradle');
|
await save('gradle');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('for sbt', () => {
|
describe('for sbt', () => {
|
||||||
it('uploads cache even if no build.sbt found', async () => {
|
it('uploads cache even if no build.sbt found', async () => {
|
||||||
createStateForMissingBuildFile();
|
createStateForMissingBuildFile();
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
it('does not upload cache if no restore run before', async () => {
|
it('does not upload cache if no restore run before', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
|
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).not.toHaveBeenCalled();
|
expect(spyCacheSave).not.toBeCalled();
|
||||||
expect(spyWarning).toHaveBeenCalledWith(
|
expect(spyWarning).toBeCalledWith('Error retrieving key from state.');
|
||||||
'Error retrieving key from state.'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('uploads cache', async () => {
|
it('uploads cache', async () => {
|
||||||
createFile(join(workspace, 'build.sbt'));
|
createFile(join(workspace, 'build.sbt'));
|
||||||
createStateForSuccessfulRestore();
|
createStateForSuccessfulRestore();
|
||||||
|
|
||||||
await save('sbt');
|
await save('sbt');
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
expect(spyInfo).toBeCalledWith(expect.stringMatching(/^Cache saved with the key:.*/));
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it('uploads cache based on versions.properties', async () => {
|
|
||||||
createFile(join(workspace, 'versions.properties'));
|
|
||||||
createStateForSuccessfulRestore();
|
|
||||||
|
|
||||||
await save('gradle');
|
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
|
||||||
expect(spyInfo).toHaveBeenCalledWith(
|
|
||||||
expect.stringMatching(/^Cache saved with the key:.*/)
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import {run as cleanup} from '../src/cleanup-java';
|
import { run as cleanup } from '../src/cleanup-java';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as util from '../src/util';
|
import * as util from '../src/util';
|
||||||
@@ -38,8 +38,8 @@ describe('cleanup', () => {
|
|||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
expect(spyWarning).not.toHaveBeenCalled();
|
expect(spyWarning).not.toBeCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('does not fail even though the save process throws error', async () => {
|
it('does not fail even though the save process throws error', async () => {
|
||||||
@@ -50,7 +50,7 @@ describe('cleanup', () => {
|
|||||||
return name === 'cache' ? 'gradle' : '';
|
return name === 'cache' ? 'gradle' : '';
|
||||||
});
|
});
|
||||||
await cleanup();
|
await cleanup();
|
||||||
expect(spyCacheSave).toHaveBeenCalled();
|
expect(spyCacheSave).toBeCalled();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,218 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"version": "17.0.7",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.1+12.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "16.0.2+7.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.19",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.15",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.15-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.15-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.13+8.1",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,14 +1,11 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import {IAdoptAvailableVersions} from '../../src/distributions/adopt/models';
|
|
||||||
import {
|
import { AdoptDistribution, AdoptImplementation } from '../../src/distributions/adopt/installer';
|
||||||
AdoptDistribution,
|
import { JavaInstallerOptions } from '../../src/distributions/base-models';
|
||||||
AdoptImplementation
|
|
||||||
} from '../../src/distributions/adopt/installer';
|
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
|
||||||
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/adopt.json';
|
let manifestData = require('../data/adopt.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@@ -30,82 +27,42 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot,
|
AdoptImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.OpenJ9,
|
AdoptImplementation.OpenJ9,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=openj9&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=openj9&page_size=20&page=0'
|
||||||
]
|
]
|
||||||
@@ -117,8 +74,7 @@ describe('getAvailableVersions', () => {
|
|||||||
expectedParameters
|
expectedParameters
|
||||||
) => {
|
) => {
|
||||||
const distribution = new AdoptDistribution(installerOptions, impl);
|
const distribution = new AdoptDistribution(installerOptions, impl);
|
||||||
const baseUrl =
|
const baseUrl = 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@@ -135,12 +91,12 @@ describe('getAvailableVersions', () => {
|
|||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
@@ -149,12 +105,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
@@ -171,12 +122,7 @@ describe('getAvailableVersions', () => {
|
|||||||
'find right toolchain folder',
|
'find right toolchain folder',
|
||||||
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
(impl: AdoptImplementation, packageType: string, expected: string) => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: packageType, checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
impl
|
impl
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -202,12 +148,8 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
||||||
|
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(installerOptions, AdoptImplementation.Hotspot);
|
||||||
installerOptions,
|
const baseUrl = 'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
AdoptImplementation.Hotspot
|
|
||||||
);
|
|
||||||
const baseUrl =
|
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptopenjdk&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@@ -234,63 +176,43 @@ describe('findPackageForDownload', () => {
|
|||||||
['15.0.1+9.1', '15.0.1+9.1']
|
['15.0.1+9.1', '15.0.1+9.1']
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
expect(resolvedVersion.version).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
it('version is found but binaries list is empty', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload']('9.0.8')).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload']('9.0.8')
|
/Could not find satisfied version for SemVer */
|
||||||
).rejects.toThrow(/Could not find satisfied version for SemVer */);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is not found', async () => {
|
it('version is not found', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
it('version list is empty', async () => {
|
||||||
const distribution = new AdoptDistribution(
|
const distribution = new AdoptDistribution(
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
AdoptImplementation.Hotspot
|
AdoptImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
distribution['getAvailableVersions'] = async () => [];
|
||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('11')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import * as util from '../../src/util';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../../src/distributions/base-installer';
|
import { JavaBase } from '../../src/distributions/base-installer';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
@@ -19,23 +19,14 @@ class EmptyJavaBase extends JavaBase {
|
|||||||
super('Empty', installerOptions);
|
super('Empty', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
return {
|
return {
|
||||||
version: '11.0.9',
|
version: '11.0.9',
|
||||||
path: path.join(
|
path: path.join('toolcache', this.toolcacheFolderName, '11.0.9', this.architecture)
|
||||||
'toolcache',
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
'11.0.9',
|
|
||||||
this.architecture
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersion = '11.0.9';
|
const availableVersion = '11.0.9';
|
||||||
if (!semver.satisfies(availableVersion, range)) {
|
if (!semver.satisfies(availableVersion, range)) {
|
||||||
throw new Error('Available version not found');
|
throw new Error('Available version not found');
|
||||||
@@ -69,111 +60,44 @@ describe('findInToolcache', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.8',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x64', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.8',
|
{ version: actualJavaVersion, path: javaPath }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false }, null],
|
||||||
{
|
[{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false }, null],
|
||||||
version: '11',
|
[{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false }, null],
|
||||||
architecture: 'x64',
|
[{ version: '11', architecture: 'x86', packageType: 'jre', checkLatest: false }, null]
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
null
|
|
||||||
]
|
|
||||||
])(`should find java for path %s -> %s`, (input, expected) => {
|
])(`should find java for path %s -> %s`, (input, expected) => {
|
||||||
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
spyTcFindAllVersions.mockReturnValue([actualJavaVersion]);
|
||||||
spyGetToolcachePath.mockImplementation(
|
spyGetToolcachePath.mockImplementation(
|
||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(actualJavaVersion, semverVersion)
|
return semver.satisfies(actualJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
@@ -181,63 +105,52 @@ describe('findInToolcache', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['11', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['11.0', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11.0', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['11.0.1', {version: '11.0.1', versionInPath: '11.0.1'}],
|
['11.0.1', { version: '11.0.1', versionInPath: '11.0.1' }],
|
||||||
['11.0.3', {version: '11.0.3+2', versionInPath: '11.0.3-2'}],
|
['11.0.3', { version: '11.0.3+2', versionInPath: '11.0.3-2' }],
|
||||||
['15', {version: '15.0.2+4', versionInPath: '15.0.2-4'}],
|
['15', { version: '15.0.2+4', versionInPath: '15.0.2-4' }],
|
||||||
['x', {version: '15.0.2+4', versionInPath: '15.0.2-4'}],
|
['x', { version: '15.0.2+4', versionInPath: '15.0.2-4' }],
|
||||||
['x-ea', {version: '17.4.4', versionInPath: '17.4.4-ea'}],
|
['x-ea', { version: '17.4.4', versionInPath: '17.4.4-ea' }],
|
||||||
[
|
['11-ea', { version: '11.3.3+5.2.1231421', versionInPath: '11.3.3-ea.5.2.1231421' }],
|
||||||
'11-ea',
|
['11.2-ea', { version: '11.2.1', versionInPath: '11.2.1-ea' }],
|
||||||
{version: '11.3.3+5.2.1231421', versionInPath: '11.3.3-ea.5.2.1231421'}
|
['11.2.1-ea', { version: '11.2.1', versionInPath: '11.2.1-ea' }]
|
||||||
],
|
])('should choose correct java from tool-cache for input %s', (input, expected) => {
|
||||||
['11.2-ea', {version: '11.2.1', versionInPath: '11.2.1-ea'}],
|
spyTcFindAllVersions.mockReturnValue([
|
||||||
['11.2.1-ea', {version: '11.2.1', versionInPath: '11.2.1-ea'}]
|
'17.4.4-ea',
|
||||||
])(
|
'11.0.2',
|
||||||
'should choose correct java from tool-cache for input %s',
|
'15.0.2-4',
|
||||||
(input, expected) => {
|
'11.0.3-2',
|
||||||
spyTcFindAllVersions.mockReturnValue([
|
'11.2.1-ea',
|
||||||
'17.4.4-ea',
|
'11.3.2-ea',
|
||||||
'11.0.2',
|
'11.3.2-ea.5',
|
||||||
'15.0.2-4',
|
'11.3.3-ea.5.2.1231421',
|
||||||
'11.0.3-2',
|
'12.3.2-0',
|
||||||
'11.2.1-ea',
|
'11.0.1'
|
||||||
'11.3.2-ea',
|
]);
|
||||||
'11.3.2-ea.5',
|
spyGetToolcachePath.mockImplementation(
|
||||||
'11.3.3-ea.5.2.1231421',
|
(toolname: string, javaVersion: string, architecture: string) =>
|
||||||
'12.3.2-0',
|
`/hostedtoolcache/${toolname}/${javaVersion}/${architecture}`
|
||||||
'11.0.1'
|
);
|
||||||
]);
|
mockJavaBase = new EmptyJavaBase({
|
||||||
spyGetToolcachePath.mockImplementation(
|
version: input,
|
||||||
(toolname: string, javaVersion: string, architecture: string) =>
|
architecture: 'x64',
|
||||||
`/hostedtoolcache/${toolname}/${javaVersion}/${architecture}`
|
packageType: 'jdk',
|
||||||
);
|
checkLatest: false
|
||||||
mockJavaBase = new EmptyJavaBase({
|
});
|
||||||
version: input,
|
const foundVersion = mockJavaBase['findInToolcache']();
|
||||||
architecture: 'x64',
|
expect(foundVersion).toEqual({
|
||||||
packageType: 'jdk',
|
version: expected.version,
|
||||||
checkLatest: false
|
path: `/hostedtoolcache/Java_Empty_jdk/${expected.versionInPath}/x64`
|
||||||
});
|
});
|
||||||
const foundVersion = mockJavaBase['findInToolcache']();
|
});
|
||||||
expect(foundVersion).toEqual({
|
|
||||||
version: expected.version,
|
|
||||||
path: `/hostedtoolcache/Java_Empty_jdk/${expected.versionInPath}/x64`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('setupJava', () => {
|
describe('setupJava', () => {
|
||||||
const actualJavaVersion = '11.0.9';
|
const actualJavaVersion = '11.0.9';
|
||||||
const installedJavaVersion = '11.0.8';
|
const installedJavaVersion = '11.0.8';
|
||||||
const javaPath = path.join('Java_Empty_jdk', installedJavaVersion, 'x86');
|
const javaPath = path.join('Java_Empty_jdk', installedJavaVersion, 'x86');
|
||||||
const javaPathInstalled = path.join(
|
const javaPathInstalled = path.join('toolcache', 'Java_Empty_jdk', actualJavaVersion, 'x86');
|
||||||
'toolcache',
|
|
||||||
'Java_Empty_jdk',
|
|
||||||
actualJavaVersion,
|
|
||||||
'x86'
|
|
||||||
);
|
|
||||||
|
|
||||||
let mockJavaBase: EmptyJavaBase;
|
let mockJavaBase: EmptyJavaBase;
|
||||||
|
|
||||||
@@ -255,16 +168,11 @@ describe('setupJava', () => {
|
|||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(installedJavaVersion, semverVersion)
|
return semver.satisfies(installedJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -298,46 +206,27 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.8', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.8',
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{version: installedJavaVersion, path: javaPath}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jdk', checkLatest: false},
|
{ version: '11', architecture: '', packageType: 'jdk', checkLatest: false },
|
||||||
{version: installedJavaVersion, path: javaPath}
|
{ version: installedJavaVersion, path: javaPath }
|
||||||
]
|
]
|
||||||
])('should find java locally for %s', async (input, expected) => {
|
])('should find java locally for %s', (input, expected) => {
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${expected.version} from tool-cache`);
|
||||||
`Resolved Java ${expected.version} from tool-cache`
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
'Trying to resolve the latest version from remote'
|
'Trying to resolve the latest version from remote'
|
||||||
);
|
);
|
||||||
@@ -346,47 +235,20 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'), version: '11.0.9' }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64'), version: '11.0.9' }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jdk', '11.0.9', 'x64'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '11',
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x64'), version: '11.0.9' }
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x64'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jre', checkLatest: false},
|
{ version: '11', architecture: '', packageType: 'jre', checkLatest: false },
|
||||||
{
|
{ path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'), version: '11.0.9' }
|
||||||
path: path.join('toolcache', 'Java_Empty_jre', '11.0.9', 'x86'),
|
|
||||||
version: '11.0.9'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
])('download java with configuration %s', async (input, expected) => {
|
])('download java with configuration %s', async (input, expected) => {
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
@@ -395,176 +257,93 @@ describe('setupJava', () => {
|
|||||||
expect(spyCoreAddPath).toHaveBeenCalled();
|
expect(spyCoreAddPath).toHaveBeenCalled();
|
||||||
expect(spyCoreExportVariable).toHaveBeenCalled();
|
expect(spyCoreExportVariable).toHaveBeenCalled();
|
||||||
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
expect(spyCoreExportVariable).toHaveBeenCalledWith(
|
||||||
`JAVA_HOME_${input.version}_${(
|
`JAVA_HOME_${input.version}_${(input.architecture || 'x86').toLocaleUpperCase()}`,
|
||||||
input.architecture || 'x86'
|
|
||||||
).toLocaleUpperCase()}`,
|
|
||||||
expected.path
|
expected.path
|
||||||
);
|
);
|
||||||
expect(spyCoreSetOutput).toHaveBeenCalled();
|
expect(spyCoreSetOutput).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
'Trying to resolve the latest version from remote'
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${expected.version}`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved latest version as ${expected.version}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Java ${expected.version} was downloaded`);
|
||||||
`Java ${expected.version} was downloaded`
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.9', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.9',
|
{ version: '11.0.9', path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: '11.0.9', path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.9', architecture: '', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.9',
|
{ version: '11.0.9', path: javaPathInstalled }
|
||||||
architecture: '',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: '11.0.9', path: javaPathInstalled}
|
|
||||||
]
|
]
|
||||||
])(
|
])('should check the latest java version for %s and resolve locally', async (input, expected) => {
|
||||||
'should check the latest java version for %s and resolve locally',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
async (input, expected) => {
|
mockJavaBase['findInToolcache'] = () => ({ version: '11.0.9', path: expected.path });
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
mockJavaBase['findInToolcache'] = () => ({
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
version: '11.0.9',
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${expected.version}`);
|
||||||
path: expected.path
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${expected.version} from tool-cache`);
|
||||||
});
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
});
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
'Trying to resolve the latest version from remote'
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved latest version as ${expected.version}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${expected.version} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.x', architecture: 'x86', packageType: 'jdk', checkLatest: true },
|
||||||
version: '11.0.x',
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: true
|
|
||||||
},
|
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{version: '11', architecture: '', packageType: 'jdk', checkLatest: true},
|
{ version: '11', architecture: '', packageType: 'jdk', checkLatest: true },
|
||||||
{version: actualJavaVersion, path: javaPathInstalled}
|
{ version: actualJavaVersion, path: javaPathInstalled }
|
||||||
]
|
]
|
||||||
])(
|
])('should check the latest java version for %s and download', async (input, expected) => {
|
||||||
'should check the latest java version for %s and download',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
async (input, expected) => {
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to resolve the latest version from remote');
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved latest version as ${actualJavaVersion}`);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
||||||
'Trying to resolve the latest version from remote'
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Java ${actualJavaVersion} was downloaded`);
|
||||||
);
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Setting Java ${expected.version} as the default`);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
});
|
||||||
`Resolved latest version as ${actualJavaVersion}`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith('Trying to download...');
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Java ${actualJavaVersion} was downloaded`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Setting Java ${expected.version} as the default`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[{ version: '15', architecture: 'x86', packageType: 'jre', checkLatest: false }],
|
||||||
{
|
[{ version: '11.0.7', architecture: 'x64', packageType: 'jre', checkLatest: false }]
|
||||||
version: '15',
|
])('should throw an error for Available version not found for %s', async input => {
|
||||||
architecture: 'x86',
|
mockJavaBase = new EmptyJavaBase(input);
|
||||||
packageType: 'jre',
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError('Available version not found');
|
||||||
checkLatest: false
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
}
|
expect(spyCoreAddPath).not.toHaveBeenCalled();
|
||||||
],
|
expect(spyCoreExportVariable).not.toHaveBeenCalled();
|
||||||
[
|
expect(spyCoreSetOutput).not.toHaveBeenCalled();
|
||||||
{
|
});
|
||||||
version: '11.0.7',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should throw an error for Available version not found for %s',
|
|
||||||
async input => {
|
|
||||||
mockJavaBase = new EmptyJavaBase(input);
|
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
|
||||||
'Available version not found'
|
|
||||||
);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
expect(spyCoreAddPath).not.toHaveBeenCalled();
|
|
||||||
expect(spyCoreExportVariable).not.toHaveBeenCalled();
|
|
||||||
expect(spyCoreSetOutput).not.toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('normalizeVersion', () => {
|
describe('normalizeVersion', () => {
|
||||||
const DummyJavaBase = JavaBase as any;
|
const DummyJavaBase = JavaBase as any;
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
['11', {version: '11', stable: true}],
|
['11', { version: '11', stable: true }],
|
||||||
['11.0', {version: '11.0', stable: true}],
|
['11.0', { version: '11.0', stable: true }],
|
||||||
['11.0.10', {version: '11.0.10', stable: true}],
|
['11.0.10', { version: '11.0.10', stable: true }],
|
||||||
['11-ea', {version: '11', stable: false}],
|
['11-ea', { version: '11', stable: false }],
|
||||||
['11.0.2-ea', {version: '11.0.2', stable: false}]
|
['11.0.2-ea', { version: '11.0.2', stable: false }]
|
||||||
])('normalizeVersion from %s to %s', (input, expected) => {
|
])('normalizeVersion from %s to %s', (input, expected) => {
|
||||||
expect(DummyJavaBase.prototype.normalizeVersion.call(null, input)).toEqual(
|
expect(DummyJavaBase.prototype.normalizeVersion.call(null, input)).toEqual(expected);
|
||||||
expected
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('normalizeVersion should throw an error for non semver', () => {
|
it('normalizeVersion should throw an error for non semver', () => {
|
||||||
const version = '11g';
|
const version = '11g';
|
||||||
expect(
|
expect(DummyJavaBase.prototype.normalizeVersion.bind(null, version)).toThrowError(
|
||||||
DummyJavaBase.prototype.normalizeVersion.bind(null, version)
|
|
||||||
).toThrow(
|
|
||||||
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
`The string '${version}' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -574,14 +353,14 @@ describe('getToolcacheVersionName', () => {
|
|||||||
const DummyJavaBase = JavaBase as any;
|
const DummyJavaBase = JavaBase as any;
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[{version: '11', stable: true}, '11'],
|
[{ version: '11', stable: true }, '11'],
|
||||||
[{version: '11.0.2', stable: true}, '11.0.2'],
|
[{ version: '11.0.2', stable: true }, '11.0.2'],
|
||||||
[{version: '11.0.2+4', stable: true}, '11.0.2-4'],
|
[{ version: '11.0.2+4', stable: true }, '11.0.2-4'],
|
||||||
[{version: '11.0.2+4.1.2563234', stable: true}, '11.0.2-4.1.2563234'],
|
[{ version: '11.0.2+4.1.2563234', stable: true }, '11.0.2-4.1.2563234'],
|
||||||
[{version: '11.0', stable: false}, '11.0-ea'],
|
[{ version: '11.0', stable: false }, '11.0-ea'],
|
||||||
[{version: '11.0.3', stable: false}, '11.0.3-ea'],
|
[{ version: '11.0.3', stable: false }, '11.0.3-ea'],
|
||||||
[{version: '11.0.3+4', stable: false}, '11.0.3-ea.4'],
|
[{ version: '11.0.3+4', stable: false }, '11.0.3-ea.4'],
|
||||||
[{version: '11.0.3+4.2.256', stable: false}, '11.0.3-ea.4.2.256']
|
[{ version: '11.0.3+4.2.256', stable: false }, '11.0.3-ea.4.2.256']
|
||||||
])('returns correct version name for %s', (input, expected) => {
|
])('returns correct version name for %s', (input, expected) => {
|
||||||
const inputVersion = input.stable ? '11' : '11-ea';
|
const inputVersion = input.stable ? '11' : '11-ea';
|
||||||
const mockJavaBase = new EmptyJavaBase({
|
const mockJavaBase = new EmptyJavaBase({
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
import { JavaInstallerOptions } from '../../src/distributions/base-models';
|
||||||
|
|
||||||
import {CorrettoDistribution} from '../../src/distributions/corretto/installer';
|
import { CorrettoDistribution } from '../../src/distributions/corretto/installer';
|
||||||
import * as util from '../../src/util';
|
import * as util from '../../src/util';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import {isGeneratorFunction} from 'util/types';
|
import { isGeneratorFunction } from 'util/types';
|
||||||
|
|
||||||
import manifestData from '../data/corretto.json';
|
const manifestData = require('../data/corretto.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@@ -19,10 +19,7 @@ describe('getAvailableVersions', () => {
|
|||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData
|
result: manifestData
|
||||||
});
|
});
|
||||||
spyGetDownloadArchiveExtension = jest.spyOn(
|
spyGetDownloadArchiveExtension = jest.spyOn(util, 'getDownloadArchiveExtension');
|
||||||
util,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
@@ -47,66 +44,16 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jdk', checkLatest: false }, 'macos', 6],
|
||||||
|
[{ version: '16', architecture: 'x86', packageType: 'jdk', checkLatest: false }, 'macos', 0],
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jre', checkLatest: false }, 'macos', 0],
|
||||||
|
[{ version: '16', architecture: 'x64', packageType: 'jdk', checkLatest: false }, 'linux', 6],
|
||||||
[
|
[
|
||||||
{
|
{ version: '18', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
6
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'macos',
|
|
||||||
0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'linux',
|
|
||||||
6
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '18',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'windows',
|
'windows',
|
||||||
6
|
6
|
||||||
],
|
],
|
||||||
[
|
[{ version: '18', architecture: 'x64', packageType: 'jre', checkLatest: false }, 'windows', 1]
|
||||||
{
|
|
||||||
version: '18',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'windows',
|
|
||||||
1
|
|
||||||
]
|
|
||||||
])(
|
])(
|
||||||
'fetch expected amount of available versions for %s',
|
'fetch expected amount of available versions for %s',
|
||||||
async (
|
async (
|
||||||
@@ -119,9 +66,7 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
expect(availableVersions).not.toBeNull();
|
expect(availableVersions).not.toBeNull();
|
||||||
expect(availableVersions.length).toBe(
|
expect(availableVersions.length).toBe(expectedAmountOfAvailableVersions);
|
||||||
expectedAmountOfAvailableVersions
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -150,9 +95,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, platform);
|
mockPlatform(distribution, platform);
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
const availableVersion = await distribution['findPackageForDownload'](version);
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
});
|
});
|
||||||
@@ -167,9 +110,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
'Early access versions are not supported'
|
||||||
).rejects.toThrow('Early access versions are not supported');
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with non major version expect to throw not supported error', async () => {
|
it('with non major version expect to throw not supported error', async () => {
|
||||||
@@ -182,9 +125,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
'Only major versions are supported'
|
||||||
).rejects.toThrow('Only major versions are supported');
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('with unfound version throw could not find error', async () => {
|
it('with unfound version throw could not find error', async () => {
|
||||||
@@ -197,9 +140,9 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
mockPlatform(distribution, 'linux');
|
mockPlatform(distribution, 'linux');
|
||||||
|
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload'](version)).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload'](version)
|
"Could not find satisfied version for SemVer '4'"
|
||||||
).rejects.toThrow("Could not find satisfied version for SemVer '4'");
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
@@ -223,19 +166,14 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
const expectedLink = `https://corretto.aws/downloads/resources/17.0.2.8.1/amazon-corretto-17.0.2.8.1-macosx-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
const availableVersion = await distribution['findPackageForDownload'](version);
|
||||||
version
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
expect(availableVersion).not.toBeNull();
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
expect(availableVersion.url).toBe(expectedLink);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
const mockPlatform = (
|
const mockPlatform = (distribution: CorrettoDistribution, platform: string) => {
|
||||||
distribution: CorrettoDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
distribution['getPlatformOption'] = () => platform;
|
||||||
const mockedExtension = platform === 'windows' ? 'zip' : 'tar.gz';
|
const mockedExtension = platform === 'windows' ? 'zip' : 'tar.gz';
|
||||||
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
spyGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
||||||
|
|||||||
@@ -1,226 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import {DragonwellDistribution} from '../../src/distributions/dragonwell/installer';
|
|
||||||
import * as utils from '../../src/util';
|
|
||||||
|
|
||||||
import manifestData from '../data/dragonwell.json';
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
let spyUtilGetDownloadArchiveExtension: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient.mockReturnValue({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData
|
|
||||||
});
|
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
|
||||||
utils,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
|
||||||
});
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
jest.resetAllMocks();
|
|
||||||
jest.clearAllMocks();
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
});
|
|
||||||
|
|
||||||
const mockPlatform = (
|
|
||||||
distribution: DragonwellDistribution,
|
|
||||||
platform: string
|
|
||||||
) => {
|
|
||||||
distribution['getPlatformOption'] = () => platform;
|
|
||||||
const mockedExtension = platform == 'windows' ? 'zip' : 'tar.gz';
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue(mockedExtension);
|
|
||||||
};
|
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
|
||||||
it.each([
|
|
||||||
['8', 'x86', 'linux', 0],
|
|
||||||
['8', 'aarch64', 'linux', 24],
|
|
||||||
['8.6.6', 'x64', 'linux', 27],
|
|
||||||
['8', 'x86', 'anolis', 0],
|
|
||||||
['8', 'x86', 'windows', 0],
|
|
||||||
['8', 'x86', 'mac', 0],
|
|
||||||
['11', 'x64', 'linux', 27],
|
|
||||||
['11', 'aarch64', 'linux', 24],
|
|
||||||
['17', 'riscv', 'linux', 0],
|
|
||||||
['16.0.1', 'x64', 'linux', 27]
|
|
||||||
])(
|
|
||||||
'should get right number of available versions from JSON',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
arch: string,
|
|
||||||
platform: string,
|
|
||||||
len: number
|
|
||||||
) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
expect(availableVersions.length).toBe(len);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'8.13.14',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell8/releases/download/dragonwell-extended-8.13.14_jdk8u352-ga/Alibaba_Dragonwell_Extended_8.13.14_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11',
|
|
||||||
'alpine-linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_alpine-linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.0.17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell11/releases/download/dragonwell-extended-11.0.17.13_jdk-11.0.17-ga/Alibaba_Dragonwell_Extended_11.0.17.13.8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'linux',
|
|
||||||
'aarch64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_aarch64_linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'windows',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_windows.zip'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17',
|
|
||||||
'alpine-linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.5.0.5%2B8_jdk-17.0.5-ga/Alibaba_Dragonwell_Standard_17.0.5.0.5.8_x64_alpine-linux.tar.gz'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'17.0.4',
|
|
||||||
'linux',
|
|
||||||
'x64',
|
|
||||||
'https://github.com/alibaba/dragonwell17/releases/download/dragonwell-standard-17.0.4.0.4%2B8_jdk-17.0.4-ga/Alibaba_Dragonwell_Standard_17.0.4.0.4%2B8_x64_linux.tar.gz'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'should return proper link according to the specified java-version, platform and arch',
|
|
||||||
async (
|
|
||||||
jdkVersion: string,
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
expectedLink: string
|
|
||||||
) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
const availableVersion = await distribution['findPackageForDownload'](
|
|
||||||
jdkVersion
|
|
||||||
);
|
|
||||||
expect(availableVersion).not.toBeNull();
|
|
||||||
expect(availableVersion.url).toBe(expectedLink);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['8', 'alpine-linux', 'x64'],
|
|
||||||
['8', 'macos', 'aarch64'],
|
|
||||||
['11', 'macos', 'aarch64'],
|
|
||||||
['17', 'linux', 'riscv']
|
|
||||||
])(
|
|
||||||
'should throw when required version of JDK can not be found in the JSON',
|
|
||||||
async (jdkVersion: string, platform: string, arch: string) => {
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow(
|
|
||||||
`Couldn't find any satisfied version for the specified java-version: "${jdkVersion}" and architecture: "${arch}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('should throw when required package type is not jdk', async () => {
|
|
||||||
const jdkVersion = '17';
|
|
||||||
const arch = 'x64';
|
|
||||||
const platform = 'linux';
|
|
||||||
const distribution = new DragonwellDistribution({
|
|
||||||
version: jdkVersion,
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
mockPlatform(distribution, platform);
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](jdkVersion)
|
|
||||||
).rejects.toThrow('Dragonwell provides only the `jdk` package type');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
import {LibericaDistributions} from '../../src/distributions/liberica/installer';
|
import { LibericaDistributions } from '../../src/distributions/liberica/installer';
|
||||||
import {
|
import { ArchitectureOptions, LibericaVersion } from '../../src/distributions/liberica/models';
|
||||||
ArchitectureOptions,
|
import { HttpClient } from '@actions/http-client';
|
||||||
LibericaVersion
|
|
||||||
} from '../../src/distributions/liberica/models';
|
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/liberica.json';
|
const manifestData = require('../data/liberica.json') as LibericaVersion[];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@@ -16,7 +13,7 @@ describe('getAvailableVersions', () => {
|
|||||||
spyHttpClient.mockReturnValue({
|
spyHttpClient.mockReturnValue({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as LibericaVersion[]
|
result: manifestData
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -28,57 +25,27 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.x', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.x',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16.0.2', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16.0.2', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '16.0.2',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'armv7', packageType: 'jdk+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'armv7',
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'aarch64', packageType: 'jre+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'aarch64',
|
|
||||||
packageType: 'jre+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, urlParams) => {
|
])('build correct url for %s -> %s', async (input, urlParams) => {
|
||||||
@@ -100,8 +67,8 @@ describe('getAvailableVersions', () => {
|
|||||||
arch: string;
|
arch: string;
|
||||||
};
|
};
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', { bitness: '64', arch: 'x86' }],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['arm64', { bitness: '64', arch: 'arm' }]
|
||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
@@ -142,24 +109,21 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['x86', {bitness: '32', arch: 'x86'}],
|
['x86', { bitness: '32', arch: 'x86' }],
|
||||||
['x64', {bitness: '64', arch: 'x86'}],
|
['x64', { bitness: '64', arch: 'x86' }],
|
||||||
['armv7', {bitness: '32', arch: 'arm'}],
|
['armv7', { bitness: '32', arch: 'arm' }],
|
||||||
['aarch64', {bitness: '64', arch: 'arm'}],
|
['aarch64', { bitness: '64', arch: 'arm' }],
|
||||||
['ppc64le', {bitness: '64', arch: 'ppc'}]
|
['ppc64le', { bitness: '64', arch: 'ppc' }]
|
||||||
] as [string, ArchitectureOptions][])(
|
] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => {
|
||||||
'parse architecture %s -> %s',
|
const distributions = new LibericaDistributions({
|
||||||
(input, expected) => {
|
architecture: input,
|
||||||
const distributions = new LibericaDistributions({
|
checkLatest: false,
|
||||||
architecture: input,
|
packageType: '',
|
||||||
checkLatest: false,
|
version: ''
|
||||||
packageType: '',
|
});
|
||||||
version: ''
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
||||||
}
|
});
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
||||||
const distributions = new LibericaDistributions({
|
const distributions = new LibericaDistributions({
|
||||||
@@ -235,9 +199,9 @@ describe('getPlatformOption', () => {
|
|||||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
||||||
'not support os version %s',
|
'not support os version %s',
|
||||||
input => {
|
input => {
|
||||||
expect(() =>
|
expect(() => distributions['getPlatformOption'](input as NodeJS.Platform)).toThrow(
|
||||||
distributions['getPlatformOption'](input as NodeJS.Platform)
|
/Platform '\w+' is not supported\. Supported platforms: .+/
|
||||||
).toThrow(/Platform '\w+' is not supported\. Supported platforms: .+/);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -251,33 +215,9 @@ describe('convertVersionToSemver', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 12, buildVersion: 7 }, '11.0.12+7'],
|
||||||
{
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 12, buildVersion: 0 }, '11.0.12'],
|
||||||
featureVersion: 11,
|
[{ featureVersion: 11, interimVersion: 0, updateVersion: 0, buildVersion: 13 }, '11.0.0+13']
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 7
|
|
||||||
},
|
|
||||||
'11.0.12+7'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 12,
|
|
||||||
buildVersion: 0
|
|
||||||
},
|
|
||||||
'11.0.12'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
featureVersion: 11,
|
|
||||||
interimVersion: 0,
|
|
||||||
updateVersion: 0,
|
|
||||||
buildVersion: 13
|
|
||||||
},
|
|
||||||
'11.0.0+13'
|
|
||||||
]
|
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const actual = distributions['convertVersionToSemver']({
|
const actual = distributions['convertVersionToSemver']({
|
||||||
downloadUrl: '',
|
downloadUrl: '',
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import path from 'path';
|
|||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import * as util from '../../src/util';
|
import * as util from '../../src/util';
|
||||||
|
|
||||||
import {LocalDistribution} from '../../src/distributions/local/installer';
|
import { LocalDistribution } from '../../src/distributions/local/installer';
|
||||||
|
|
||||||
describe('setupJava', () => {
|
describe('setupJava', () => {
|
||||||
const actualJavaVersion = '11.1.10';
|
const actualJavaVersion = '11.1.10';
|
||||||
@@ -27,7 +27,7 @@ describe('setupJava', () => {
|
|||||||
let spyFsReadDir: jest.SpyInstance;
|
let spyFsReadDir: jest.SpyInstance;
|
||||||
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
let spyUtilsExtractJdkFile: jest.SpyInstance;
|
||||||
let spyPathResolve: jest.SpyInstance;
|
let spyPathResolve: jest.SpyInstance;
|
||||||
const expectedJdkFile = 'JavaLocalJdkFile';
|
let expectedJdkFile = 'JavaLocalJdkFile';
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
spyGetToolcachePath = jest.spyOn(util, 'getToolcachePath');
|
||||||
@@ -35,27 +35,18 @@ describe('setupJava', () => {
|
|||||||
(toolname: string, javaVersion: string, architecture: string) => {
|
(toolname: string, javaVersion: string, architecture: string) => {
|
||||||
const semverVersion = new semver.Range(javaVersion);
|
const semverVersion = new semver.Range(javaVersion);
|
||||||
|
|
||||||
if (
|
if (path.basename(javaPath) !== architecture || !javaPath.includes(toolname)) {
|
||||||
path.basename(javaPath) !== architecture ||
|
|
||||||
!javaPath.includes(toolname)
|
|
||||||
) {
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return semver.satisfies(actualJavaVersion, semverVersion)
|
return semver.satisfies(actualJavaVersion, semverVersion) ? javaPath : '';
|
||||||
? javaPath
|
|
||||||
: '';
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
spyTcCacheDir = jest.spyOn(tc, 'cacheDir');
|
||||||
spyTcCacheDir.mockImplementation(
|
spyTcCacheDir.mockImplementation(
|
||||||
(
|
(archivePath: string, toolcacheFolderName: string, version: string, architecture: string) =>
|
||||||
archivePath: string,
|
path.join(toolcacheFolderName, version, architecture)
|
||||||
toolcacheFolderName: string,
|
|
||||||
version: string,
|
|
||||||
architecture: string
|
|
||||||
) => path.join(toolcacheFolderName, version, architecture)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
spyTcFindAllVersions = jest.spyOn(tc, 'findAllVersions');
|
||||||
@@ -83,7 +74,7 @@ describe('setupJava', () => {
|
|||||||
|
|
||||||
spyFsStat = jest.spyOn(fs, 'statSync');
|
spyFsStat = jest.spyOn(fs, 'statSync');
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
spyFsStat.mockImplementation((file: string) => {
|
||||||
return {isFile: () => file === expectedJdkFile};
|
return { isFile: () => file === expectedJdkFile };
|
||||||
});
|
});
|
||||||
|
|
||||||
// Spy on util methods
|
// Spy on util methods
|
||||||
@@ -117,9 +108,7 @@ describe('setupJava', () => {
|
|||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@@ -141,9 +130,7 @@ describe('setupJava', () => {
|
|||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
expect(spyGetToolcachePath).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Resolved Java ${actualJavaVersion} from tool-cache`);
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@@ -168,9 +155,7 @@ describe('setupJava', () => {
|
|||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
`Resolved Java ${actualJavaVersion} from tool-cache`
|
||||||
);
|
);
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
@@ -186,163 +171,46 @@ describe('setupJava', () => {
|
|||||||
const jdkFile = 'not_existing_one';
|
const jdkFile = 'not_existing_one';
|
||||||
const expected = {
|
const expected = {
|
||||||
javaVersion: '11.0.289',
|
javaVersion: '11.0.289',
|
||||||
javaPath: path.join(
|
javaPath: path.join('Java_jdkfile_jdk', inputs.version, inputs.architecture)
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture
|
|
||||||
)
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
expected.javaPath = path.join(
|
expected.javaPath = path.join('Java_jdkfile_jdk', inputs.version, inputs.architecture);
|
||||||
'Java_jdkfile_jdk',
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
|
||||||
inputs.version,
|
|
||||||
inputs.architecture
|
|
||||||
);
|
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
|
||||||
"JDK file was not found in path 'not_existing_one'"
|
"JDK file was not found in path 'not_existing_one'"
|
||||||
);
|
);
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
`Resolved Java ${actualJavaVersion} from tool-cache`
|
||||||
);
|
);
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
expect(spyCoreInfo).not.toHaveBeenCalledWith(`Extracting Java from '${jdkFile}'`);
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
expect(spyCoreInfo).toHaveBeenCalledWith(
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('java is resolved from toolcache including Contents/Home on MacOS', async () => {
|
|
||||||
const inputs = {
|
|
||||||
version: actualJavaVersion,
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
};
|
|
||||||
const jdkFile = 'not_existing_one';
|
|
||||||
const expected = {
|
|
||||||
version: actualJavaVersion,
|
|
||||||
path: path.join(
|
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture,
|
|
||||||
'Contents',
|
|
||||||
'Home'
|
|
||||||
)
|
|
||||||
};
|
|
||||||
const originalPlatform = process.platform;
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: 'darwin'
|
|
||||||
});
|
|
||||||
|
|
||||||
spyFsStat = jest.spyOn(fs, 'existsSync');
|
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
|
||||||
return file.endsWith('Home');
|
|
||||||
});
|
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
|
||||||
expect(spyGetToolcachePath).toHaveBeenCalled();
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: originalPlatform
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('java is unpacked from jdkfile including Contents/Home on MacOS', async () => {
|
|
||||||
const inputs = {
|
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
};
|
|
||||||
const jdkFile = expectedJdkFile;
|
|
||||||
const expected = {
|
|
||||||
version: '11.0.289',
|
|
||||||
path: path.join(
|
|
||||||
'Java_jdkfile_jdk',
|
|
||||||
inputs.version,
|
|
||||||
inputs.architecture,
|
|
||||||
'Contents',
|
|
||||||
'Home'
|
|
||||||
)
|
|
||||||
};
|
|
||||||
const originalPlatform = process.platform;
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: 'darwin'
|
|
||||||
});
|
|
||||||
spyFsStat = jest.spyOn(fs, 'existsSync');
|
|
||||||
spyFsStat.mockImplementation((file: string) => {
|
|
||||||
return file.endsWith('Home');
|
|
||||||
});
|
|
||||||
|
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
|
||||||
await expect(mockJavaBase.setupJava()).resolves.toEqual(expected);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
expect(spyCoreInfo).not.toHaveBeenCalledWith(
|
|
||||||
`Resolved Java ${actualJavaVersion} from tool-cache`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Extracting Java from '${jdkFile}'`
|
|
||||||
);
|
|
||||||
expect(spyCoreInfo).toHaveBeenCalledWith(
|
|
||||||
`Java ${inputs.version} was not found in tool-cache. Trying to unpack JDK file...`
|
|
||||||
);
|
|
||||||
Object.defineProperty(process, 'platform', {
|
|
||||||
value: originalPlatform
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '8.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '12.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '12.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'otherJdkFile'
|
'otherJdkFile'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.1.11', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.1.11',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'not_existing_one'
|
'not_existing_one'
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
`Throw an error if jdkfile has wrong path, inputs %s, jdkfile %s, real name ${expectedJdkFile}`,
|
`Throw an error if jdkfile has wrong path, inputs %s, jdkfile %s, real name ${expectedJdkFile}`,
|
||||||
async (inputs, jdkFile) => {
|
async (inputs, jdkFile) => {
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError(
|
||||||
/JDK file was not found in path */
|
/JDK file was not found in path */
|
||||||
);
|
);
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
@@ -350,41 +218,18 @@ describe('setupJava', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
[{ version: '8.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false }, ''],
|
||||||
[
|
[
|
||||||
{
|
{ version: '7.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
''
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '7.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
undefined
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11.0.289', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11.0.289',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
undefined
|
undefined
|
||||||
]
|
]
|
||||||
])(
|
])('Throw an error if jdkfile is not specified, inputs %s', async (inputs, jdkFile) => {
|
||||||
'Throw an error if jdkfile is not specified, inputs %s',
|
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
||||||
async (inputs, jdkFile) => {
|
await expect(mockJavaBase.setupJava()).rejects.toThrowError("'jdkFile' is not specified");
|
||||||
mockJavaBase = new LocalDistribution(inputs, jdkFile);
|
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
||||||
await expect(mockJavaBase.setupJava()).rejects.toThrow(
|
});
|
||||||
"'jdkFile' is not specified"
|
|
||||||
);
|
|
||||||
expect(spyTcFindAllVersions).toHaveBeenCalled();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {MicrosoftDistributions} from '../../src/distributions/microsoft/installer';
|
import { MicrosoftDistributions } from '../../src/distributions/microsoft/installer';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import data from '../data/microsoft.json';
|
import data from '../../src/distributions/microsoft/microsoft-openjdk-versions.json';
|
||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
@@ -36,8 +36,8 @@ describe('findPackageForDownload', () => {
|
|||||||
],
|
],
|
||||||
[
|
[
|
||||||
'17.x',
|
'17.x',
|
||||||
'17.0.7',
|
'17.0.3',
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-17.0.7-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
'https://aka.ms/download-jdk/microsoft-jdk-17.0.3-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'16.0.x',
|
'16.0.x',
|
||||||
@@ -53,11 +53,6 @@ describe('findPackageForDownload', () => {
|
|||||||
'11.0.15',
|
'11.0.15',
|
||||||
'11.0.15',
|
'11.0.15',
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.15-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
'https://aka.ms/download-jdk/microsoft-jdk-11.0.15-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||||
],
|
|
||||||
[
|
|
||||||
'11.x',
|
|
||||||
'11.0.19',
|
|
||||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.19-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
|
||||||
]
|
]
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
@@ -78,9 +73,7 @@ describe('findPackageForDownload', () => {
|
|||||||
archive = 'tar.gz';
|
archive = 'tar.gz';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
const url = expectedUrl
|
const url = expectedUrl.replace('{{OS_TYPE}}', os).replace('{{ARCHIVE_TYPE}}', archive);
|
||||||
.replace('{{OS_TYPE}}', os)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archive);
|
|
||||||
expect(result.url).toBe(url);
|
expect(result.url).toBe(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -102,7 +95,7 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const result = await distro['findPackageForDownload'](version);
|
const result = await distro['findPackageForDownload'](version);
|
||||||
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-${distroArch}.tar.gz`;
|
const expectedUrl = `https://aka.ms/download-jdk/microsoft-jdk-17.0.3-linux-${distroArch}.tar.gz`;
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
expect(result.url).toBe(expectedUrl);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
import {OracleDistribution} from '../../src/distributions/oracle/installer';
|
import { OracleDistribution } from '../../src/distributions/oracle/installer';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {getDownloadArchiveExtension} from '../../src/util';
|
import { getDownloadArchiveExtension } from '../../src/util';
|
||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
describe('findPackageForDownload', () => {
|
||||||
let distribution: OracleDistribution;
|
let distribution: OracleDistribution;
|
||||||
let spyDebug: jest.SpyInstance;
|
let spyDebug: jest.SpyInstance;
|
||||||
let spyHttpClient: jest.SpyInstance;
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
distribution = new OracleDistribution({
|
distribution = new OracleDistribution({
|
||||||
@@ -23,19 +21,19 @@ describe('findPackageForDownload', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
'20',
|
'19',
|
||||||
'20',
|
'19',
|
||||||
'https://download.oracle.com/java/20/latest/jdk-20_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/19/latest/jdk-19_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'18',
|
'19.0.1',
|
||||||
'18',
|
'19.0.1',
|
||||||
'https://download.oracle.com/java/18/archive/jdk-18_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/19/archive/jdk-19.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'20.0.1',
|
'18.0.2.1',
|
||||||
'20.0.1',
|
'18.0.2.1',
|
||||||
'https://download.oracle.com/java/20/archive/jdk-20.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/18/archive/jdk-18.0.2.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'17',
|
'17',
|
||||||
@@ -48,39 +46,11 @@ describe('findPackageForDownload', () => {
|
|||||||
'https://download.oracle.com/java/17/archive/jdk-17.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
'https://download.oracle.com/java/17/archive/jdk-17.0.1_{{OS_TYPE}}-x64_bin.{{ARCHIVE_TYPE}}'
|
||||||
]
|
]
|
||||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||||
/* Needed only for this particular test because some urls might change */
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'head');
|
|
||||||
spyHttpClient.mockReturnValue(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 200
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE - Should fail to retrieve 18 from latest and check archive instead
|
|
||||||
*/
|
|
||||||
if (input === '18') {
|
|
||||||
spyHttpClient.mockReturnValueOnce(
|
|
||||||
Promise.resolve({
|
|
||||||
message: {
|
|
||||||
statusCode: 404
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = await distribution['findPackageForDownload'](input);
|
const result = await distribution['findPackageForDownload'](input);
|
||||||
|
|
||||||
jest.restoreAllMocks();
|
|
||||||
|
|
||||||
expect(result.version).toBe(expectedVersion);
|
expect(result.version).toBe(expectedVersion);
|
||||||
const osType = distribution.getPlatform();
|
const osType = distribution.getPlatform();
|
||||||
const archiveType = getDownloadArchiveExtension();
|
const archiveType = getDownloadArchiveExtension();
|
||||||
const url = expectedUrl
|
const url = expectedUrl.replace('{{OS_TYPE}}', osType).replace('{{ARCHIVE_TYPE}}', archiveType);
|
||||||
.replace('{{OS_TYPE}}', osType)
|
|
||||||
.replace('{{ARCHIVE_TYPE}}', archiveType);
|
|
||||||
expect(result.url).toBe(url);
|
expect(result.url).toBe(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -93,7 +63,7 @@ describe('findPackageForDownload', () => {
|
|||||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||||
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
jest.spyOn(os, 'platform').mockReturnValue('linux');
|
||||||
|
|
||||||
const version = '18';
|
const version = '17';
|
||||||
const distro = new OracleDistribution({
|
const distro = new OracleDistribution({
|
||||||
version,
|
version,
|
||||||
architecture: '', // to get default value
|
architecture: '', // to get default value
|
||||||
@@ -107,7 +77,7 @@ describe('findPackageForDownload', () => {
|
|||||||
}
|
}
|
||||||
const archiveType = getDownloadArchiveExtension();
|
const archiveType = getDownloadArchiveExtension();
|
||||||
const result = await distro['findPackageForDownload'](version);
|
const result = await distro['findPackageForDownload'](version);
|
||||||
const expectedUrl = `https://download.oracle.com/java/18/archive/jdk-18_${osType}-${distroArch}_bin.${archiveType}`;
|
const expectedUrl = `https://download.oracle.com/java/17/latest/jdk-17_${osType}-${distroArch}_bin.${archiveType}`;
|
||||||
|
|
||||||
expect(result.url).toBe(expectedUrl);
|
expect(result.url).toBe(expectedUrl);
|
||||||
}
|
}
|
||||||
@@ -120,5 +90,8 @@ describe('findPackageForDownload', () => {
|
|||||||
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('11')).rejects.toThrow(
|
||||||
/Oracle JDK is only supported for JDK 17 and later/
|
/Oracle JDK is only supported for JDK 17 and later/
|
||||||
);
|
);
|
||||||
|
await expect(distribution['findPackageForDownload']('18')).rejects.toThrow(
|
||||||
|
/Could not find Oracle JDK for SemVer */
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,287 +0,0 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
|
||||||
|
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
|
||||||
import {SemeruDistribution} from '../../src/distributions/semeru/installer';
|
|
||||||
|
|
||||||
import manifestData from '../data/semeru.json';
|
|
||||||
|
|
||||||
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.each([
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=openj9&page_size=20&page=0'
|
|
||||||
]
|
|
||||||
])(
|
|
||||||
'build correct url for %s',
|
|
||||||
async (installerOptions: JavaInstallerOptions, expectedParameters) => {
|
|
||||||
const distribution = new SemeruDistribution(installerOptions);
|
|
||||||
const baseUrl =
|
|
||||||
'https://api.adoptopenjdk.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=ibm&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
|
||||||
|
|
||||||
await distribution['getAvailableVersions']();
|
|
||||||
|
|
||||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
|
||||||
expect(spyHttpClient.mock.calls[0][0]).toBe(expectedUrl);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('load available versions', async () => {
|
|
||||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
|
||||||
spyHttpClient
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as any
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: manifestData as any
|
|
||||||
})
|
|
||||||
.mockReturnValueOnce({
|
|
||||||
statusCode: 200,
|
|
||||||
headers: {},
|
|
||||||
result: []
|
|
||||||
});
|
|
||||||
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
|
||||||
expect(availableVersions).not.toBeNull();
|
|
||||||
expect(availableVersions.length).toBe(manifestData.length * 2);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
['jdk', 'Java_IBM_Semeru_jdk'],
|
|
||||||
['jre', 'Java_IBM_Semeru_jre']
|
|
||||||
])('find right toolchain folder', (packageType: string, expected: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// @ts-ignore - because it is protected
|
|
||||||
expect(distribution.toolcacheFolderName).toBe(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('findPackageForDownload', () => {
|
|
||||||
it.each([
|
|
||||||
['8', '8.0.322+6'],
|
|
||||||
['16', '16.0.2+7'],
|
|
||||||
['16.0', '16.0.2+7'],
|
|
||||||
['16.0.2', '16.0.2+7'],
|
|
||||||
['8.x', '8.0.322+6'],
|
|
||||||
['x', '17.0.2+8']
|
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '9.0.8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload']('9.0.8')
|
|
||||||
).rejects.toThrow(/Could not find satisfied version for SemVer */);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version is not found', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '7.x',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
|
|
||||||
/Could not find satisfied version for SemVer */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
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 */
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
it.each(['x64', 'x86', 'ppc64le', 'ppc64', 's390x', 'aarch64'])(
|
|
||||||
'correct Semeru `%s` architecture resolves',
|
|
||||||
async (arch: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload']('8');
|
|
||||||
expect(resolvedVersion.version).not.toBeNull();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['zos', 'z/OS', 'z/os', 'test0987654321=', '++=++', 'myArch'])(
|
|
||||||
'incorrect Semeru `%s` architecture throws',
|
|
||||||
async (arch: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: arch,
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
`Unsupported architecture for IBM Semeru: ${arch}, the following are supported: x64, x86, ppc64le, ppc64, s390x, aarch64`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['9-ea', '17-ea', '8-ea', '4-ea'])(
|
|
||||||
'early access version are illegal for Semeru (%s)',
|
|
||||||
async (version: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: version,
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(
|
|
||||||
distribution['findPackageForDownload'](version)
|
|
||||||
).rejects.toThrow(
|
|
||||||
'IBM Semeru does not provide builds for early access versions'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each([
|
|
||||||
'jdk+fx',
|
|
||||||
'jre+fx',
|
|
||||||
'test',
|
|
||||||
'test2',
|
|
||||||
'jdk-fx',
|
|
||||||
'javafx',
|
|
||||||
'jdk-javafx',
|
|
||||||
'ibm',
|
|
||||||
' '
|
|
||||||
])(
|
|
||||||
'rejects incorrect `%s` Semeru package type',
|
|
||||||
async (packageType: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
|
||||||
'IBM Semeru only provide `jdk` and `jre` package types'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it.each(['jdk', 'jre'])(
|
|
||||||
'accepts correct `%s` Semeru package type',
|
|
||||||
async (packageType: string) => {
|
|
||||||
const distribution = new SemeruDistribution({
|
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
});
|
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
|
||||||
const resolvedVersion = await distribution['findPackageForDownload']('8');
|
|
||||||
await expect(resolvedVersion.version).toMatch(/8[0-9.]+/);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
it('fails when long release name is used', async () => {
|
|
||||||
expect(
|
|
||||||
() =>
|
|
||||||
new SemeruDistribution({
|
|
||||||
version: 'jdk-16.0.2+7_openj9-0.27.1',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
})
|
|
||||||
).toThrow(
|
|
||||||
"The string 'jdk-16.0.2+7_openj9-0.27.1' is not valid SemVer notation for a Java version. Please check README file for code snippets and more detailed information"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import {
|
import {
|
||||||
TemurinDistribution,
|
TemurinDistribution,
|
||||||
TemurinImplementation
|
TemurinImplementation
|
||||||
} from '../../src/distributions/temurin/installer';
|
} from '../../src/distributions/temurin/installer';
|
||||||
import {JavaInstallerOptions} from '../../src/distributions/base-models';
|
import { JavaInstallerOptions } from '../../src/distributions/base-models';
|
||||||
|
|
||||||
import manifestData from '../data/temurin.json';
|
let manifestData = require('../data/temurin.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@@ -28,42 +28,22 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '16', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot,
|
TemurinImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot,
|
TemurinImplementation.Hotspot,
|
||||||
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x86&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '16',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot,
|
TemurinImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jre&release_type=ga&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '16-ea', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '16-ea',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot,
|
TemurinImplementation.Hotspot,
|
||||||
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
'os=mac&architecture=x64&image_type=jdk&release_type=ea&jvm_impl=hotspot&page_size=20&page=0'
|
||||||
]
|
]
|
||||||
@@ -75,8 +55,7 @@ describe('getAvailableVersions', () => {
|
|||||||
expectedParameters
|
expectedParameters
|
||||||
) => {
|
) => {
|
||||||
const distribution = new TemurinDistribution(installerOptions, impl);
|
const distribution = new TemurinDistribution(installerOptions, impl);
|
||||||
const baseUrl =
|
const baseUrl = 'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptium&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptium&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@@ -93,12 +72,12 @@ describe('getAvailableVersions', () => {
|
|||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
headers: {},
|
headers: {},
|
||||||
result: manifestData as any
|
result: manifestData
|
||||||
})
|
})
|
||||||
.mockReturnValueOnce({
|
.mockReturnValueOnce({
|
||||||
statusCode: 200,
|
statusCode: 200,
|
||||||
@@ -107,12 +86,7 @@ describe('getAvailableVersions', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
const availableVersions = await distribution['getAvailableVersions']();
|
const availableVersions = await distribution['getAvailableVersions']();
|
||||||
@@ -127,12 +101,7 @@ describe('getAvailableVersions', () => {
|
|||||||
'find right toolchain folder',
|
'find right toolchain folder',
|
||||||
(impl: TemurinImplementation, packageType: string, expected: string) => {
|
(impl: TemurinImplementation, packageType: string, expected: string) => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: packageType, checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: packageType,
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
impl
|
impl
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -158,12 +127,8 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
const expectedParameters = `os=mac&architecture=${distroArch}&image_type=jdk&release_type=ga&jvm_impl=hotspot&page_size=20&page=0`;
|
||||||
|
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(installerOptions, TemurinImplementation.Hotspot);
|
||||||
installerOptions,
|
const baseUrl = 'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D';
|
||||||
TemurinImplementation.Hotspot
|
|
||||||
);
|
|
||||||
const baseUrl =
|
|
||||||
'https://api.adoptium.net/v3/assets/version/%5B1.0,100.0%5D';
|
|
||||||
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptium&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
const expectedUrl = `${baseUrl}?project=jdk&vendor=adoptium&heap_size=normal&sort_method=DEFAULT&sort_order=DESC&${expectedParameters}`;
|
||||||
distribution['getPlatformOption'] = () => 'mac';
|
distribution['getPlatformOption'] = () => 'mac';
|
||||||
|
|
||||||
@@ -185,63 +150,43 @@ describe('findPackageForDownload', () => {
|
|||||||
['x', '16.0.2+7']
|
['x', '16.0.2+7']
|
||||||
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
])('version is resolved correctly %s -> %s', async (input, expected) => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
const resolvedVersion = await distribution['findPackageForDownload'](input);
|
||||||
expect(resolvedVersion.version).toBe(expected);
|
expect(resolvedVersion.version).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is found but binaries list is empty', async () => {
|
it('version is found but binaries list is empty', async () => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '9.0.8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '9.0.8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(
|
await expect(distribution['findPackageForDownload']('9.0.8')).rejects.toThrowError(
|
||||||
distribution['findPackageForDownload']('9.0.8')
|
/Could not find satisfied version for SemVer */
|
||||||
).rejects.toThrow(/Could not find satisfied version for SemVer */);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version is not found', async () => {
|
it('version is not found', async () => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '7.x', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '7.x',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => manifestData as any;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('7.x')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('version list is empty', async () => {
|
it('version list is empty', async () => {
|
||||||
const distribution = new TemurinDistribution(
|
const distribution = new TemurinDistribution(
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
TemurinImplementation.Hotspot
|
TemurinImplementation.Hotspot
|
||||||
);
|
);
|
||||||
distribution['getAvailableVersions'] = async () => [];
|
distribution['getAvailableVersions'] = async () => [];
|
||||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
await expect(distribution['findPackageForDownload']('8')).rejects.toThrowError(
|
||||||
/Could not find satisfied version for SemVer */
|
/Could not find satisfied version for SemVer */
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import {HttpClient} from '@actions/http-client';
|
import { HttpClient } from '@actions/http-client';
|
||||||
import * as semver from 'semver';
|
import * as semver from 'semver';
|
||||||
import {ZuluDistribution} from '../../src/distributions/zulu/installer';
|
import { ZuluDistribution } from '../../src/distributions/zulu/installer';
|
||||||
import {IZuluVersions} from '../../src/distributions/zulu/models';
|
import { IZuluVersions } from '../../src/distributions/zulu/models';
|
||||||
import * as utils from '../../src/util';
|
import * as utils from '../../src/util';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
import manifestData from '../data/zulu-releases-default.json';
|
const manifestData = require('../data/zulu-releases-default.json') as [];
|
||||||
|
|
||||||
describe('getAvailableVersions', () => {
|
describe('getAvailableVersions', () => {
|
||||||
let spyHttpClient: jest.SpyInstance;
|
let spyHttpClient: jest.SpyInstance;
|
||||||
@@ -19,10 +19,7 @@ describe('getAvailableVersions', () => {
|
|||||||
result: manifestData as IZuluVersions[]
|
result: manifestData as IZuluVersions[]
|
||||||
});
|
});
|
||||||
|
|
||||||
spyUtilGetDownloadArchiveExtension = jest.spyOn(
|
spyUtilGetDownloadArchiveExtension = jest.spyOn(utils, 'getDownloadArchiveExtension');
|
||||||
utils,
|
|
||||||
'getDownloadArchiveExtension'
|
|
||||||
);
|
|
||||||
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
spyUtilGetDownloadArchiveExtension.mockReturnValue('tar.gz');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -34,75 +31,35 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ga'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11-ea', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11-ea',
|
|
||||||
architecture: 'x86',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=32&release_status=ea'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=false&arch=x86&hw_bitness=64&release_status=ga'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jdk+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jdk+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '8', architecture: 'x64', packageType: 'jre+fx', checkLatest: false },
|
||||||
version: '8',
|
|
||||||
architecture: 'x64',
|
|
||||||
packageType: 'jre+fx',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
'?os=macos&ext=tar.gz&bundle_type=jre&javafx=true&arch=x86&hw_bitness=64&release_status=ga&features=fx'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'arm64', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'arm64',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=64&release_status=ga'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
{
|
{ version: '11', architecture: 'arm', packageType: 'jdk', checkLatest: false },
|
||||||
version: '11',
|
|
||||||
architecture: 'arm',
|
|
||||||
packageType: 'jdk',
|
|
||||||
checkLatest: false
|
|
||||||
},
|
|
||||||
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
'?os=macos&ext=tar.gz&bundle_type=jdk&javafx=false&arch=arm&hw_bitness=&release_status=ga'
|
||||||
]
|
]
|
||||||
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
])('build correct url for %s -> %s', async (input, parsedUrl) => {
|
||||||
@@ -121,8 +78,8 @@ describe('getAvailableVersions', () => {
|
|||||||
arch: string;
|
arch: string;
|
||||||
};
|
};
|
||||||
it.each([
|
it.each([
|
||||||
['amd64', {bitness: '64', arch: 'x86'}],
|
['amd64', { bitness: '64', arch: 'x86' }],
|
||||||
['arm64', {bitness: '64', arch: 'arm'}]
|
['arm64', { bitness: '64', arch: 'arm' }]
|
||||||
])(
|
])(
|
||||||
'defaults to os.arch(): %s mapped to distro arch: %s',
|
'defaults to os.arch(): %s mapped to distro arch: %s',
|
||||||
async (osArch: string, distroArch: DistroArch) => {
|
async (osArch: string, distroArch: DistroArch) => {
|
||||||
@@ -158,10 +115,10 @@ describe('getAvailableVersions', () => {
|
|||||||
|
|
||||||
describe('getArchitectureOptions', () => {
|
describe('getArchitectureOptions', () => {
|
||||||
it.each([
|
it.each([
|
||||||
[{architecture: 'x64'}, {arch: 'x86', hw_bitness: '64', abi: ''}],
|
[{ architecture: 'x64' }, { arch: 'x86', hw_bitness: '64', abi: '' }],
|
||||||
[{architecture: 'x86'}, {arch: 'x86', hw_bitness: '32', abi: ''}],
|
[{ architecture: 'x86' }, { arch: 'x86', hw_bitness: '32', abi: '' }],
|
||||||
[{architecture: 'x32'}, {arch: 'x32', hw_bitness: '', abi: ''}],
|
[{ architecture: 'x32' }, { arch: 'x32', hw_bitness: '', abi: '' }],
|
||||||
[{architecture: 'arm'}, {arch: 'arm', hw_bitness: '', abi: ''}]
|
[{ architecture: 'arm' }, { arch: 'arm', hw_bitness: '', abi: '' }]
|
||||||
])('%s -> %s', (input, expected) => {
|
])('%s -> %s', (input, expected) => {
|
||||||
const distribution = new ZuluDistribution({
|
const distribution = new ZuluDistribution({
|
||||||
version: '11',
|
version: '11',
|
||||||
@@ -194,9 +151,7 @@ describe('findPackageForDownload', () => {
|
|||||||
checkLatest: false
|
checkLatest: false
|
||||||
});
|
});
|
||||||
distribution['getAvailableVersions'] = async () => manifestData;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
const result = await distribution['findPackageForDownload'](
|
const result = await distribution['findPackageForDownload'](distribution['version']);
|
||||||
distribution['version']
|
|
||||||
);
|
|
||||||
expect(result.version).toBe(expected);
|
expect(result.version).toBe(expected);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -224,6 +179,25 @@ describe('findPackageForDownload', () => {
|
|||||||
distribution['getAvailableVersions'] = async () => manifestData;
|
distribution['getAvailableVersions'] = async () => manifestData;
|
||||||
await expect(
|
await expect(
|
||||||
distribution['findPackageForDownload'](distribution['version'])
|
distribution['findPackageForDownload'](distribution['version'])
|
||||||
).rejects.toThrow(/Could not find satisfied version for semver */);
|
).rejects.toThrowError(/Could not find satisfied version for semver */);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('convertVersionToSemver', () => {
|
||||||
|
it.each([
|
||||||
|
[[12], '12'],
|
||||||
|
[[12, 0], '12.0'],
|
||||||
|
[[12, 0, 2], '12.0.2'],
|
||||||
|
[[12, 0, 2, 1], '12.0.2+1'],
|
||||||
|
[[12, 0, 2, 1, 3], '12.0.2+1']
|
||||||
|
])('%s -> %s', (input: number[], expected: string) => {
|
||||||
|
const distribution = new ZuluDistribution({
|
||||||
|
version: '18',
|
||||||
|
architecture: 'x86',
|
||||||
|
packageType: 'jdk',
|
||||||
|
checkLatest: false
|
||||||
|
});
|
||||||
|
const actual = distribution['convertVersionToSemver'](input);
|
||||||
|
expect(actual).toBe(expected);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as path from 'path';
|
import path = require('path');
|
||||||
import * as io from '@actions/io';
|
import io = require('@actions/io');
|
||||||
import * as exec from '@actions/exec';
|
import exec = require('@actions/exec');
|
||||||
import * as gpg from '../src/gpg';
|
|
||||||
|
|
||||||
jest.mock('@actions/exec', () => {
|
jest.mock('@actions/exec', () => {
|
||||||
return {
|
return {
|
||||||
@@ -12,6 +11,8 @@ jest.mock('@actions/exec', () => {
|
|||||||
const tempDir = path.join(__dirname, 'runner', 'temp');
|
const tempDir = path.join(__dirname, 'runner', 'temp');
|
||||||
process.env['RUNNER_TEMP'] = tempDir;
|
process.env['RUNNER_TEMP'] = tempDir;
|
||||||
|
|
||||||
|
import gpg = require('../src/gpg');
|
||||||
|
|
||||||
describe('gpg tests', () => {
|
describe('gpg tests', () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await io.mkdirP(tempDir);
|
await io.mkdirP(tempDir);
|
||||||
@@ -32,11 +33,7 @@ describe('gpg tests', () => {
|
|||||||
|
|
||||||
expect(keyId).toBeNull();
|
expect(keyId).toBeNull();
|
||||||
|
|
||||||
expect(exec.exec).toHaveBeenCalledWith(
|
expect(exec.exec).toHaveBeenCalledWith('gpg', expect.anything(), expect.anything());
|
||||||
'gpg',
|
|
||||||
expect.anything(),
|
|
||||||
expect.anything()
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -45,11 +42,7 @@ describe('gpg tests', () => {
|
|||||||
const keyId = 'asdfhjkl';
|
const keyId = 'asdfhjkl';
|
||||||
await gpg.deleteKey(keyId);
|
await gpg.deleteKey(keyId);
|
||||||
|
|
||||||
expect(exec.exec).toHaveBeenCalledWith(
|
expect(exec.exec).toHaveBeenCalledWith('gpg', expect.anything(), expect.anything());
|
||||||
'gpg',
|
|
||||||
expect.anything(),
|
|
||||||
expect.anything()
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import * as path from 'path';
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import * as toolchains from '../src/toolchains';
|
import * as toolchains from '../src/toolchains';
|
||||||
import {M2_DIR, MVN_TOOLCHAINS_FILE} from '../src/constants';
|
import { M2_DIR, MVN_TOOLCHAINS_FILE } from '../src/constants';
|
||||||
|
|
||||||
const m2Dir = path.join(__dirname, M2_DIR);
|
const m2Dir = path.join(__dirname, M2_DIR);
|
||||||
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
|
const toolchainsFile = path.join(m2Dir, MVN_TOOLCHAINS_FILE);
|
||||||
@@ -77,9 +77,9 @@ describe('toolchains tests', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const result = `<?xml version="1.0"?>
|
const result = `<?xml version="1.0"?>
|
||||||
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
|
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||||
<toolchain>
|
<toolchain>
|
||||||
<type>jdk</type>
|
<type>jdk</type>
|
||||||
<provides>
|
<provides>
|
||||||
@@ -168,7 +168,7 @@ describe('toolchains tests', () => {
|
|||||||
</toolchain>
|
</toolchain>
|
||||||
</toolchains>`;
|
</toolchains>`;
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(toolchainsFile, originalFile);
|
fs.writeFileSync(toolchainsFile, originalFile);
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
||||||
@@ -223,7 +223,7 @@ describe('toolchains tests', () => {
|
|||||||
</toolchain>
|
</toolchain>
|
||||||
</toolchains>`;
|
</toolchains>`;
|
||||||
|
|
||||||
fs.mkdirSync(m2Dir, {recursive: true});
|
fs.mkdirSync(m2Dir, { recursive: true });
|
||||||
fs.writeFileSync(toolchainsFile, originalFile);
|
fs.writeFileSync(toolchainsFile, originalFile);
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
||||||
@@ -248,9 +248,9 @@ describe('toolchains tests', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const expectedToolchains = `<?xml version="1.0"?>
|
const expectedToolchains = `<?xml version="1.0"?>
|
||||||
<toolchains xmlns="http://maven.apache.org/TOOLCHAINS/1.1.0"
|
<toolchains xmlns="https://maven.apache.org/TOOLCHAINS/1.1.0"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
xsi:schemaLocation="https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd">
|
||||||
<toolchain>
|
<toolchain>
|
||||||
<type>jdk</type>
|
<type>jdk</type>
|
||||||
<provides>
|
<provides>
|
||||||
@@ -279,26 +279,14 @@ describe('toolchains tests', () => {
|
|||||||
const version = '17';
|
const version = '17';
|
||||||
const distributionName = 'temurin';
|
const distributionName = 'temurin';
|
||||||
const id = 'temurin_17';
|
const id = 'temurin_17';
|
||||||
const jdkHome =
|
const jdkHome = '/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
|
||||||
'/opt/hostedtoolcache/Java_Temurin-Hotspot_jdk/17.0.1-12/x64';
|
|
||||||
|
|
||||||
await toolchains.configureToolchains(
|
await toolchains.configureToolchains(version, distributionName, jdkHome, undefined);
|
||||||
version,
|
|
||||||
distributionName,
|
|
||||||
jdkHome,
|
|
||||||
undefined
|
|
||||||
);
|
|
||||||
|
|
||||||
expect(fs.existsSync(m2Dir)).toBe(true);
|
expect(fs.existsSync(m2Dir)).toBe(true);
|
||||||
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
expect(fs.existsSync(toolchainsFile)).toBe(true);
|
||||||
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
|
expect(fs.readFileSync(toolchainsFile, 'utf-8')).toEqual(
|
||||||
toolchains.generateToolchainDefinition(
|
toolchains.generateToolchainDefinition('', version, distributionName, id, jdkHome)
|
||||||
'',
|
|
||||||
version,
|
|
||||||
distributionName,
|
|
||||||
id,
|
|
||||||
jdkHome
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
}, 100000);
|
}, 100000);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import {
|
import { isVersionSatisfies, isCacheFeatureAvailable } from '../src/util';
|
||||||
convertVersionToSemver,
|
|
||||||
isVersionSatisfies,
|
|
||||||
isCacheFeatureAvailable
|
|
||||||
} from '../src/util';
|
|
||||||
|
|
||||||
jest.mock('@actions/cache');
|
jest.mock('@actions/cache');
|
||||||
jest.mock('@actions/core');
|
jest.mock('@actions/core');
|
||||||
@@ -24,13 +20,10 @@ describe('isVersionSatisfies', () => {
|
|||||||
['2.5.1+3', '2.5.1+2', false],
|
['2.5.1+3', '2.5.1+2', false],
|
||||||
['15.0.0+14', '15.0.0+14.1.202003190635', false],
|
['15.0.0+14', '15.0.0+14.1.202003190635', false],
|
||||||
['15.0.0+14.1.202003190635', '15.0.0+14.1.202003190635', true]
|
['15.0.0+14.1.202003190635', '15.0.0+14.1.202003190635', true]
|
||||||
])(
|
])('%s, %s -> %s', (inputRange: string, inputVersion: string, expected: boolean) => {
|
||||||
'%s, %s -> %s',
|
const actual = isVersionSatisfies(inputRange, inputVersion);
|
||||||
(inputRange: string, inputVersion: string, expected: boolean) => {
|
expect(actual).toBe(expected);
|
||||||
const actual = isVersionSatisfies(inputRange, inputVersion);
|
});
|
||||||
expect(actual).toBe(expected);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isCacheFeatureAvailable', () => {
|
describe('isCacheFeatureAvailable', () => {
|
||||||
@@ -51,8 +44,7 @@ describe('isCacheFeatureAvailable', () => {
|
|||||||
it('isCacheFeatureAvailable disabled on dotcom', () => {
|
it('isCacheFeatureAvailable disabled on dotcom', () => {
|
||||||
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
jest.spyOn(cache, 'isFeatureAvailable').mockImplementation(() => false);
|
||||||
const infoMock = jest.spyOn(core, 'warning');
|
const infoMock = jest.spyOn(core, 'warning');
|
||||||
const message =
|
const message = 'The runner was not able to contact the cache service. Caching will be skipped';
|
||||||
'The runner was not able to contact the cache service. Caching will be skipped';
|
|
||||||
try {
|
try {
|
||||||
process.env['GITHUB_SERVER_URL'] = 'http://github.com';
|
process.env['GITHUB_SERVER_URL'] = 'http://github.com';
|
||||||
expect(isCacheFeatureAvailable()).toBe(false);
|
expect(isCacheFeatureAvailable()).toBe(false);
|
||||||
@@ -67,16 +59,3 @@ describe('isCacheFeatureAvailable', () => {
|
|||||||
expect(isCacheFeatureAvailable()).toBe(true);
|
expect(isCacheFeatureAvailable()).toBe(true);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('convertVersionToSemver', () => {
|
|
||||||
it.each([
|
|
||||||
['12', '12'],
|
|
||||||
['12.0', '12.0'],
|
|
||||||
['12.0.2', '12.0.2'],
|
|
||||||
['12.0.2.1', '12.0.2+1'],
|
|
||||||
['12.0.2.1.0', '12.0.2+1.0']
|
|
||||||
])('%s -> %s', (input: string, expected: string) => {
|
|
||||||
const actual = convertVersionToSemver(input);
|
|
||||||
expect(actual).toBe(expected);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|||||||
37568
dist/cleanup/index.js
vendored
37568
dist/cleanup/index.js
vendored
File diff suppressed because one or more lines are too long
41216
dist/setup/index.js
vendored
41216
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -7,7 +7,6 @@
|
|||||||
- [Microsoft](#Microsoft)
|
- [Microsoft](#Microsoft)
|
||||||
- [Amazon Corretto](#Amazon-Corretto)
|
- [Amazon Corretto](#Amazon-Corretto)
|
||||||
- [Oracle](#Oracle)
|
- [Oracle](#Oracle)
|
||||||
- [Alibaba Dragonwell](#Alibaba-Dragonwell)
|
|
||||||
- [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)
|
||||||
@@ -125,18 +124,6 @@ steps:
|
|||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
### Alibaba Dragonwell
|
|
||||||
**NOTE:** Alibaba Dragonwell only provides jdk.
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'dragonwell'
|
|
||||||
java-version: '8'
|
|
||||||
- run: java -cp java HelloWorldApp
|
|
||||||
```
|
|
||||||
|
|
||||||
## Installing custom Java package type
|
## Installing custom Java package type
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
@@ -159,7 +146,7 @@ steps:
|
|||||||
with:
|
with:
|
||||||
distribution: '<distribution>'
|
distribution: '<distribution>'
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
architecture: x86 # optional - default value derived from the runner machine
|
architecture: x86 # optional - defaults to x64
|
||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -181,31 +168,6 @@ steps:
|
|||||||
- run: java -cp java HelloWorldApp
|
- run: java -cp java HelloWorldApp
|
||||||
```
|
```
|
||||||
|
|
||||||
If your use-case requires a custom distribution (in the example, alpine-linux is used) or a version that is not provided by setup-java and you want to always install the latest version during runtime, then you can use the following code to auto-download the latest JDK, determine the semver needed for setup-java, and setup-java will take care of the installation and caching on the VM:
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
steps:
|
|
||||||
- name: fetch latest temurin JDK
|
|
||||||
id: fetch_latest_jdk
|
|
||||||
run: |
|
|
||||||
major_version={{ env.JAVA_VERSION }} # Example 8 or 11 or 17
|
|
||||||
cd $RUNNER_TEMP
|
|
||||||
response=$(curl -s "https://api.github.com/repos/adoptium/temurin${major_version}-binaries/releases")
|
|
||||||
latest_jdk_download_url=$(echo "$response" | jq -r '.[0].assets[] | select(.name | contains("jdk_x64_alpine-linux") and endswith(".tar.gz")) | .browser_download_url')
|
|
||||||
curl -Ls "$latest_jdk_download_url" -o java_package.tar.gz
|
|
||||||
latest_jdk_json_url=$(jdk_download_url "$response" | jq -r '.[0].assets[] | select(.name | contains("jdk_x64_alpine-linux") and endswith(".tar.gz.json")) | .browser_download_url')
|
|
||||||
latest_semver_version=$(curl -sL $latest_jdk_json_url | jq -r 'version.semver')
|
|
||||||
echo "java_version=$latest_semver_version" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'jdkfile'
|
|
||||||
jdkFile: ${{ runner.temp }}/java_package.tar.gz
|
|
||||||
java-version: {{ steps.fetch_latest_jdk.outputs.java_version }}
|
|
||||||
architecture: x64
|
|
||||||
- run: java -cp java HelloWorldApp
|
|
||||||
```
|
|
||||||
|
|
||||||
## Testing against different Java distributions
|
## Testing against different Java distributions
|
||||||
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
|
**NOTE:** The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.
|
||||||
```yaml
|
```yaml
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
|
|||||||
|
|
||||||
- To implement new features or fix bugs, you need to make changes to the `.ts` files, which are located in the `src` folder
|
- To implement new features or fix bugs, you need to make changes to the `.ts` files, which are located in the `src` folder
|
||||||
- To comply with the code style, **you need to run the `format` script**
|
- To comply with the code style, **you need to run the `format` script**
|
||||||
- To lint the code, **you need to run the `lint:fix` script**
|
|
||||||
- To transpile source code to `javascript` we use [NCC](https://github.com/vercel/ncc). **It is very important to run the `build` script after making changes**, otherwise your changes will not get into the final `javascript` build
|
- To transpile source code to `javascript` we use [NCC](https://github.com/vercel/ncc). **It is very important to run the `build` script after making changes**, otherwise your changes will not get into the final `javascript` build
|
||||||
|
|
||||||
**Learn more about how to implement tests:**
|
**Learn more about how to implement tests:**
|
||||||
|
|||||||
3648
package-lock.json
generated
3648
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
17
package.json
17
package.json
@@ -6,10 +6,9 @@
|
|||||||
"main": "dist/setup/index.js",
|
"main": "dist/setup/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
|
"build": "ncc build -o dist/setup src/setup-java.ts && ncc build -o dist/cleanup src/cleanup-java.ts",
|
||||||
"format": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --write \"**/*.{ts,yml,yaml}\"",
|
"format": "prettier --write \"{,!(node_modules)/**/}*.ts\"",
|
||||||
"format-check": "prettier --no-error-on-unmatched-pattern --config ./.prettierrc.js --check \"**/*.{ts,yml,yaml}\"",
|
"format-check": "prettier --check \"{,!(node_modules)/**/}*.ts\"",
|
||||||
"lint": "eslint --config ./.eslintrc.js \"**/*.ts\"",
|
"lint": "echo \"Fake command that does nothing. It is used in reusable workflows\"",
|
||||||
"lint:fix": "eslint --config ./.eslintrc.js \"**/*.ts\" --fix",
|
|
||||||
"prerelease": "npm run-script build",
|
"prerelease": "npm run-script build",
|
||||||
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
|
"release": "git add -f dist/setup/index.js dist/cleanup/index.js",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
@@ -26,7 +25,7 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.0.3",
|
"@actions/cache": "^3.0.4",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@actions/exec": "^1.0.4",
|
"@actions/exec": "^1.0.4",
|
||||||
"@actions/glob": "^0.2.0",
|
"@actions/glob": "^0.2.0",
|
||||||
@@ -40,16 +39,10 @@
|
|||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/node": "^16.11.25",
|
"@types/node": "^16.11.25",
|
||||||
"@types/semver": "^7.3.4",
|
"@types/semver": "^7.3.4",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.54.0",
|
|
||||||
"@typescript-eslint/parser": "^5.54.0",
|
|
||||||
"@vercel/ncc": "^0.33.4",
|
"@vercel/ncc": "^0.33.4",
|
||||||
"eslint": "^8.35.0",
|
|
||||||
"eslint-config-prettier": "^8.6.0",
|
|
||||||
"eslint-plugin-jest": "^27.2.1",
|
|
||||||
"eslint-plugin-node": "^11.1.0",
|
|
||||||
"jest": "^27.2.5",
|
"jest": "^27.2.5",
|
||||||
"jest-circus": "^27.2.5",
|
"jest-circus": "^27.2.5",
|
||||||
"prettier": "^2.8.4",
|
"prettier": "^1.19.1",
|
||||||
"ts-jest": "^27.0.5",
|
"ts-jest": "^27.0.5",
|
||||||
"typescript": "^4.2.3"
|
"typescript": "^4.2.3"
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/auth.ts
23
src/auth.ts
@@ -5,25 +5,20 @@ import * as io from '@actions/io';
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
import * as os from 'os';
|
import * as os from 'os';
|
||||||
|
|
||||||
import {create as xmlCreate} from 'xmlbuilder2';
|
import { create as xmlCreate } from 'xmlbuilder2';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
import * as gpg from './gpg';
|
import * as gpg from './gpg';
|
||||||
import {getBooleanInput} from './util';
|
import { getBooleanInput } from './util';
|
||||||
|
|
||||||
export async function configureAuthentication() {
|
export async function configureAuthentication() {
|
||||||
const id = core.getInput(constants.INPUT_SERVER_ID);
|
const id = core.getInput(constants.INPUT_SERVER_ID);
|
||||||
const username = core.getInput(constants.INPUT_SERVER_USERNAME);
|
const username = core.getInput(constants.INPUT_SERVER_USERNAME);
|
||||||
const password = core.getInput(constants.INPUT_SERVER_PASSWORD);
|
const password = core.getInput(constants.INPUT_SERVER_PASSWORD);
|
||||||
const settingsDirectory =
|
const settingsDirectory =
|
||||||
core.getInput(constants.INPUT_SETTINGS_PATH) ||
|
core.getInput(constants.INPUT_SETTINGS_PATH) || path.join(os.homedir(), constants.M2_DIR);
|
||||||
path.join(os.homedir(), constants.M2_DIR);
|
const overwriteSettings = getBooleanInput(constants.INPUT_OVERWRITE_SETTINGS, true);
|
||||||
const overwriteSettings = getBooleanInput(
|
|
||||||
constants.INPUT_OVERWRITE_SETTINGS,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
const gpgPrivateKey =
|
const gpgPrivateKey =
|
||||||
core.getInput(constants.INPUT_GPG_PRIVATE_KEY) ||
|
core.getInput(constants.INPUT_GPG_PRIVATE_KEY) || constants.INPUT_DEFAULT_GPG_PRIVATE_KEY;
|
||||||
constants.INPUT_DEFAULT_GPG_PRIVATE_KEY;
|
|
||||||
const gpgPassphrase =
|
const gpgPassphrase =
|
||||||
core.getInput(constants.INPUT_GPG_PASSPHRASE) ||
|
core.getInput(constants.INPUT_GPG_PASSPHRASE) ||
|
||||||
(gpgPrivateKey ? constants.INPUT_DEFAULT_GPG_PASSPHRASE : undefined);
|
(gpgPrivateKey ? constants.INPUT_DEFAULT_GPG_PASSPHRASE : undefined);
|
||||||
@@ -74,7 +69,7 @@ export function generate(
|
|||||||
password: string,
|
password: string,
|
||||||
gpgPassphrase?: string | undefined
|
gpgPassphrase?: string | undefined
|
||||||
) {
|
) {
|
||||||
const xmlObj: {[key: string]: any} = {
|
const xmlObj: { [key: string]: any } = {
|
||||||
settings: {
|
settings: {
|
||||||
'@xmlns': 'http://maven.apache.org/SETTINGS/1.0.0',
|
'@xmlns': 'http://maven.apache.org/SETTINGS/1.0.0',
|
||||||
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
||||||
@@ -107,11 +102,7 @@ export function generate(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function write(
|
async function write(directory: string, settings: string, overwriteSettings: boolean) {
|
||||||
directory: string,
|
|
||||||
settings: string,
|
|
||||||
overwriteSettings: boolean
|
|
||||||
) {
|
|
||||||
const location = path.join(directory, constants.MVN_SETTINGS_FILE);
|
const location = path.join(directory, constants.MVN_SETTINGS_FILE);
|
||||||
const settingsExists = fs.existsSync(location);
|
const settingsExists = fs.existsSync(location);
|
||||||
if (settingsExists && overwriteSettings) {
|
if (settingsExists && overwriteSettings) {
|
||||||
|
|||||||
38
src/cache.ts
38
src/cache.ts
@@ -2,7 +2,7 @@
|
|||||||
* @fileoverview this file provides methods handling dependency cache
|
* @fileoverview this file provides methods handling dependency cache
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {join} from 'path';
|
import { join } from 'path';
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
@@ -29,18 +29,14 @@ const supportedPackageManager: PackageManager[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'gradle',
|
id: 'gradle',
|
||||||
path: [
|
path: [join(os.homedir(), '.gradle', 'caches'), join(os.homedir(), '.gradle', 'wrapper')],
|
||||||
join(os.homedir(), '.gradle', 'caches'),
|
|
||||||
join(os.homedir(), '.gradle', 'wrapper')
|
|
||||||
],
|
|
||||||
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
|
// https://github.com/actions/cache/blob/0638051e9af2c23d10bb70fa9beffcad6cff9ce3/examples.md#java---gradle
|
||||||
pattern: [
|
pattern: [
|
||||||
'**/*.gradle*',
|
'**/*.gradle*',
|
||||||
'**/gradle-wrapper.properties',
|
'**/gradle-wrapper.properties',
|
||||||
'buildSrc/**/Versions.kt',
|
'buildSrc/**/Versions.kt',
|
||||||
'buildSrc/**/Dependencies.kt',
|
'buildSrc/**/Dependencies.kt',
|
||||||
'gradle/*.versions.toml',
|
'gradle/*.versions.toml'
|
||||||
'**/versions.properties'
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -54,26 +50,18 @@ const supportedPackageManager: PackageManager[] = [
|
|||||||
'!' + join(os.homedir(), '.sbt', '*.lock'),
|
'!' + join(os.homedir(), '.sbt', '*.lock'),
|
||||||
'!' + join(os.homedir(), '**', 'ivydata-*.properties')
|
'!' + join(os.homedir(), '**', 'ivydata-*.properties')
|
||||||
],
|
],
|
||||||
pattern: [
|
pattern: ['**/*.sbt', '**/project/build.properties', '**/project/**.{scala,sbt}']
|
||||||
'**/*.sbt',
|
|
||||||
'**/project/build.properties',
|
|
||||||
'**/project/**.scala',
|
|
||||||
'**/project/**.sbt'
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
function getCoursierCachePath(): string {
|
function getCoursierCachePath(): string {
|
||||||
if (os.type() === 'Linux') return join(os.homedir(), '.cache', 'coursier');
|
if (os.type() === 'Linux') return join(os.homedir(), '.cache', 'coursier');
|
||||||
if (os.type() === 'Darwin')
|
if (os.type() === 'Darwin') return join(os.homedir(), 'Library', 'Caches', 'Coursier');
|
||||||
return join(os.homedir(), 'Library', 'Caches', 'Coursier');
|
|
||||||
return join(os.homedir(), 'AppData', 'Local', 'Coursier', 'Cache');
|
return join(os.homedir(), 'AppData', 'Local', 'Coursier', 'Cache');
|
||||||
}
|
}
|
||||||
|
|
||||||
function findPackageManager(id: string): PackageManager {
|
function findPackageManager(id: string): PackageManager {
|
||||||
const packageManager = supportedPackageManager.find(
|
const packageManager = supportedPackageManager.find(packageManager => packageManager.id === id);
|
||||||
packageManager => packageManager.id === id
|
|
||||||
);
|
|
||||||
if (packageManager === undefined) {
|
if (packageManager === undefined) {
|
||||||
throw new Error(`unknown package manager specified: ${id}`);
|
throw new Error(`unknown package manager specified: ${id}`);
|
||||||
}
|
}
|
||||||
@@ -137,9 +125,7 @@ export async function save(id: string) {
|
|||||||
return;
|
return;
|
||||||
} else if (matchedKey === primaryKey) {
|
} else if (matchedKey === primaryKey) {
|
||||||
// no change in target directories
|
// no change in target directories
|
||||||
core.info(
|
core.info(`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`);
|
||||||
`Cache hit occurred on the primary key ${primaryKey}, not saving cache.`
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -165,14 +151,8 @@ export async function save(id: string) {
|
|||||||
* @returns true if the given error seems related to the {@link https://github.com/actions/cache/issues/454|running Gradle Daemon issue}.
|
* @returns true if the given error seems related to the {@link https://github.com/actions/cache/issues/454|running Gradle Daemon issue}.
|
||||||
* @see {@link https://github.com/actions/cache/issues/454#issuecomment-840493935|why --no-daemon is necessary}
|
* @see {@link https://github.com/actions/cache/issues/454#issuecomment-840493935|why --no-daemon is necessary}
|
||||||
*/
|
*/
|
||||||
function isProbablyGradleDaemonProblem(
|
function isProbablyGradleDaemonProblem(packageManager: PackageManager, error: Error) {
|
||||||
packageManager: PackageManager,
|
if (packageManager.id !== 'gradle' || process.env['RUNNER_OS'] !== 'Windows') {
|
||||||
error: Error
|
|
||||||
) {
|
|
||||||
if (
|
|
||||||
packageManager.id !== 'gradle' ||
|
|
||||||
process.env['RUNNER_OS'] !== 'Windows'
|
|
||||||
) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const message = error.message || '';
|
const message = error.message || '';
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as gpg from './gpg';
|
import * as gpg from './gpg';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
import {isJobStatusSuccess} from './util';
|
import { isJobStatusSuccess } from './util';
|
||||||
import {save} from './cache';
|
import { save } from './cache';
|
||||||
|
|
||||||
async function removePrivateKeyFromKeychain() {
|
async function removePrivateKeyFromKeychain() {
|
||||||
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, {required: false})) {
|
if (core.getInput(constants.INPUT_GPG_PRIVATE_KEY, { required: false })) {
|
||||||
core.info('Removing private key from keychain');
|
core.info('Removing private key from keychain');
|
||||||
try {
|
try {
|
||||||
const keyFingerprint = core.getState(
|
const keyFingerprint = core.getState(constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT);
|
||||||
constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT
|
|
||||||
);
|
|
||||||
await gpg.deleteKey(keyFingerprint);
|
await gpg.deleteKey(keyFingerprint);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.setFailed(`Failed to remove private key due to: ${error.message}`);
|
core.setFailed(`Failed to remove private key due to: ${error.message}`);
|
||||||
|
|||||||
@@ -5,18 +5,10 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {IAdoptAvailableVersions} from './models';
|
import { IAdoptAvailableVersions } from './models';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
JavaDownloadRelease,
|
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
isVersionSatisfies
|
|
||||||
} from '../../util';
|
|
||||||
|
|
||||||
export enum AdoptImplementation {
|
export enum AdoptImplementation {
|
||||||
Hotspot = 'Hotspot',
|
Hotspot = 'Hotspot',
|
||||||
@@ -31,9 +23,7 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
super(`Adopt-${jvmImpl}`, installerOptions);
|
super(`Adopt-${jvmImpl}`, installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
const availableVersionsWithBinaries = availableVersionsRaw
|
const availableVersionsWithBinaries = availableVersionsRaw
|
||||||
.filter(item => item.binaries.length > 0)
|
.filter(item => item.binaries.length > 0)
|
||||||
@@ -50,12 +40,9 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
return -semver.compareBuild(a.version, b.version);
|
return -semver.compareBuild(a.version, b.version);
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolvedFullVersion =
|
const resolvedFullVersion = satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
||||||
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
|
||||||
if (!resolvedFullVersion) {
|
if (!resolvedFullVersion) {
|
||||||
const availableOptions = availableVersionsWithBinaries
|
const availableOptions = availableVersionsWithBinaries.map(item => item.version).join(', ');
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
const availableOptionsMessage = availableOptions
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
@@ -67,31 +54,27 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
return resolvedFullVersion;
|
return resolvedFullVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
let javaPath: string;
|
||||||
): Promise<JavaInstallerResults> {
|
let extractedJavaPath: string;
|
||||||
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
let extension = getDownloadArchiveExtension();
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
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);
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
javaPath = await tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||||
archivePath,
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
version,
|
|
||||||
this.architecture
|
|
||||||
);
|
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get toolcacheFolderName(): string {
|
protected get toolcacheFolderName(): string {
|
||||||
@@ -111,7 +94,7 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
const releaseType = this.stable ? 'ga' : 'ea';
|
const releaseType = this.stable ? 'ga' : 'ea';
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
console.time('Retrieving available versions for Adopt took'); // eslint-disable-line no-console
|
console.time('adopt-retrieve-available-versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseRequestArguments = [
|
const baseRequestArguments = [
|
||||||
@@ -136,9 +119,7 @@ export class AdoptDistribution extends JavaBase {
|
|||||||
const availableVersionsUrl = `https://api.adoptopenjdk.net/v3/assets/version/${versionRange}?${requestArguments}`;
|
const availableVersionsUrl = `https://api.adoptopenjdk.net/v3/assets/version/${versionRange}?${requestArguments}`;
|
||||||
if (core.isDebug() && page_index === 0) {
|
if (core.isDebug() && page_index === 0) {
|
||||||
// url is identical except page_index so print it once for debug
|
// url is identical except page_index so print it once for debug
|
||||||
core.debug(
|
core.debug(`Gathering available versions from '${availableVersionsUrl}'`);
|
||||||
`Gathering available versions from '${availableVersionsUrl}'`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const paginationPage = (
|
const paginationPage = (
|
||||||
@@ -155,11 +136,9 @@ export class AdoptDistribution 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 Adopt took'); // eslint-disable-line no-console
|
console.timeEnd('adopt-retrieve-available-versions');
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
console.log(`Available versions: [${availableVersions.length}]`);
|
||||||
core.debug(
|
console.log(availableVersions.map(item => item.version_data.semver).join(', '));
|
||||||
availableVersions.map(item => item.version_data.semver).join(', ')
|
|
||||||
);
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,13 +4,9 @@ import * as fs from 'fs';
|
|||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import * as httpm from '@actions/http-client';
|
import * as httpm from '@actions/http-client';
|
||||||
import {getToolcachePath, isVersionSatisfies} from '../util';
|
import { getToolcachePath, isVersionSatisfies } from '../util';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from './base-models';
|
||||||
JavaDownloadRelease,
|
import { MACOS_JAVA_CONTENT_POSTFIX } from '../constants';
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from './base-models';
|
|
||||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../constants';
|
|
||||||
import os from 'os';
|
import os from 'os';
|
||||||
|
|
||||||
export abstract class JavaBase {
|
export abstract class JavaBase {
|
||||||
@@ -21,16 +17,13 @@ export abstract class JavaBase {
|
|||||||
protected stable: boolean;
|
protected stable: boolean;
|
||||||
protected checkLatest: boolean;
|
protected checkLatest: boolean;
|
||||||
|
|
||||||
constructor(
|
constructor(protected distribution: string, installerOptions: JavaInstallerOptions) {
|
||||||
protected distribution: string,
|
|
||||||
installerOptions: JavaInstallerOptions
|
|
||||||
) {
|
|
||||||
this.http = new httpm.HttpClient('actions/setup-java', undefined, {
|
this.http = new httpm.HttpClient('actions/setup-java', undefined, {
|
||||||
allowRetries: true,
|
allowRetries: true,
|
||||||
maxRetries: 3
|
maxRetries: 3
|
||||||
});
|
});
|
||||||
|
|
||||||
({version: this.version, stable: this.stable} = this.normalizeVersion(
|
({ version: this.version, stable: this.stable } = this.normalizeVersion(
|
||||||
installerOptions.version
|
installerOptions.version
|
||||||
));
|
));
|
||||||
this.architecture = installerOptions.architecture || os.arch();
|
this.architecture = installerOptions.architecture || os.arch();
|
||||||
@@ -38,12 +31,8 @@ export abstract class JavaBase {
|
|||||||
this.checkLatest = installerOptions.checkLatest;
|
this.checkLatest = installerOptions.checkLatest;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract downloadTool(
|
protected abstract downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults>;
|
||||||
javaRelease: JavaDownloadRelease
|
protected abstract findPackageForDownload(range: string): Promise<JavaDownloadRelease>;
|
||||||
): Promise<JavaInstallerResults>;
|
|
||||||
protected abstract findPackageForDownload(
|
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease>;
|
|
||||||
|
|
||||||
public async setupJava(): Promise<JavaInstallerResults> {
|
public async setupJava(): Promise<JavaInstallerResults> {
|
||||||
let foundJava = this.findInToolcache();
|
let foundJava = this.findInToolcache();
|
||||||
@@ -63,10 +52,7 @@ export abstract class JavaBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// JDK folder may contain postfix "Contents/Home" on macOS
|
// JDK folder may contain postfix "Contents/Home" on macOS
|
||||||
const macOSPostfixPath = path.join(
|
const macOSPostfixPath = path.join(foundJava.path, MACOS_JAVA_CONTENT_POSTFIX);
|
||||||
foundJava.path,
|
|
||||||
MACOS_JAVA_CONTENT_POSTFIX
|
|
||||||
);
|
|
||||||
if (process.platform === 'darwin' && fs.existsSync(macOSPostfixPath)) {
|
if (process.platform === 'darwin' && fs.existsSync(macOSPostfixPath)) {
|
||||||
foundJava.path = macOSPostfixPath;
|
foundJava.path = macOSPostfixPath;
|
||||||
}
|
}
|
||||||
@@ -110,12 +96,7 @@ export abstract class JavaBase {
|
|||||||
// so replace "/hostedtoolcache/Java/11.0.3-4/x64" to "/hostedtoolcache/Java/11.0.3+4/x64" when retrieves to cache
|
// so replace "/hostedtoolcache/Java/11.0.3-4/x64" to "/hostedtoolcache/Java/11.0.3+4/x64" when retrieves to cache
|
||||||
// related issue: https://github.com/actions/virtual-environments/issues/3014
|
// related issue: https://github.com/actions/virtual-environments/issues/3014
|
||||||
.replace('-', '+'),
|
.replace('-', '+'),
|
||||||
path:
|
path: getToolcachePath(this.toolcacheFolderName, item, this.architecture) || '',
|
||||||
getToolcachePath(
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
item,
|
|
||||||
this.architecture
|
|
||||||
) || '',
|
|
||||||
stable: !item.includes('-ea')
|
stable: !item.includes('-ea')
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
@@ -168,10 +149,7 @@ export abstract class JavaBase {
|
|||||||
core.setOutput('distribution', this.distribution);
|
core.setOutput('distribution', this.distribution);
|
||||||
core.setOutput('path', toolPath);
|
core.setOutput('path', toolPath);
|
||||||
core.setOutput('version', version);
|
core.setOutput('version', version);
|
||||||
core.exportVariable(
|
core.exportVariable(`JAVA_HOME_${majorVersion}_${this.architecture.toUpperCase()}`, toolPath);
|
||||||
`JAVA_HOME_${majorVersion}_${this.architecture.toUpperCase()}`,
|
|
||||||
toolPath
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected distributionArchitecture(): string {
|
protected distributionArchitecture(): string {
|
||||||
|
|||||||
@@ -2,30 +2,17 @@ import * as core from '@actions/core';
|
|||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {
|
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
|
||||||
extractJdkFile,
|
import { JavaBase } from '../base-installer';
|
||||||
getDownloadArchiveExtension,
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
convertVersionToSemver
|
import { ICorrettoAllAvailableVersions, ICorrettoAvailableVersions } from './models';
|
||||||
} from '../../util';
|
|
||||||
import {JavaBase} from '../base-installer';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {
|
|
||||||
ICorrettoAllAvailableVersions,
|
|
||||||
ICorrettoAvailableVersions
|
|
||||||
} from './models';
|
|
||||||
|
|
||||||
export class CorrettoDistribution extends JavaBase {
|
export class CorrettoDistribution extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
super('Corretto', installerOptions);
|
super('Corretto', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
@@ -33,10 +20,7 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(
|
const extractedJavaPath = await extractJdkFile(javaArchivePath, getDownloadArchiveExtension());
|
||||||
javaArchivePath,
|
|
||||||
getDownloadArchiveExtension()
|
|
||||||
);
|
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
@@ -49,12 +33,10 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
if (!this.stable) {
|
if (!this.stable) {
|
||||||
throw new Error('Early access versions are not supported');
|
throw new Error('Early access versions are not supported');
|
||||||
}
|
}
|
||||||
@@ -66,17 +48,14 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
.filter(item => item.version == version)
|
.filter(item => item.version == version)
|
||||||
.map(item => {
|
.map(item => {
|
||||||
return {
|
return {
|
||||||
version: convertVersionToSemver(item.correttoVersion),
|
version: item.correttoVersion,
|
||||||
url: item.downloadLink
|
url: item.downloadLink
|
||||||
} as JavaDownloadRelease;
|
} as JavaDownloadRelease;
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolvedVersion =
|
const resolvedVersion = matchingVersions.length > 0 ? matchingVersions[0] : null;
|
||||||
matchingVersions.length > 0 ? matchingVersions[0] : null;
|
|
||||||
if (!resolvedVersion) {
|
if (!resolvedVersion) {
|
||||||
const availableOptions = availableVersions
|
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
const availableOptionsMessage = availableOptions
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
@@ -93,61 +72,43 @@ 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 Coretto took'); // eslint-disable-line no-console
|
console.time('corretto-retrieve-available-versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
const availableVersionsUrl =
|
const availableVersionsUrl =
|
||||||
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
|
'https://corretto.github.io/corretto-downloads/latest_links/indexmap_with_checksum.json';
|
||||||
const fetchCurrentVersions =
|
const fetchCurrentVersions = await this.http.getJson<ICorrettoAllAvailableVersions>(
|
||||||
await this.http.getJson<ICorrettoAllAvailableVersions>(
|
availableVersionsUrl
|
||||||
availableVersionsUrl
|
);
|
||||||
);
|
|
||||||
const fetchedCurrentVersions = fetchCurrentVersions.result;
|
const fetchedCurrentVersions = fetchCurrentVersions.result;
|
||||||
if (!fetchedCurrentVersions) {
|
if (!fetchedCurrentVersions) {
|
||||||
throw Error(
|
throw Error(`Could not fetch latest corretto versions from ${availableVersionsUrl}`);
|
||||||
`Could not fetch latest corretto versions from ${availableVersionsUrl}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const eligibleVersions =
|
const eligibleVersions = fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
|
||||||
fetchedCurrentVersions?.[platform]?.[arch]?.[imageType];
|
const availableVersions = this.getAvailableVersionsForPlatform(eligibleVersions);
|
||||||
const availableVersions =
|
|
||||||
this.getAvailableVersionsForPlatform(eligibleVersions);
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
core.startGroup('Print information about available versions');
|
this.printAvailableVersions(availableVersions);
|
||||||
console.timeEnd('Retrieving available versions for Coretto took'); // eslint-disable-line no-console
|
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
|
||||||
core.debug(
|
|
||||||
availableVersions
|
|
||||||
.map(item => `${item.version}: ${item.correttoVersion}`)
|
|
||||||
.join(', ')
|
|
||||||
);
|
|
||||||
core.endGroup();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return availableVersions;
|
return availableVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getAvailableVersionsForPlatform(
|
private getAvailableVersionsForPlatform(
|
||||||
eligibleVersions:
|
eligibleVersions: ICorrettoAllAvailableVersions['os']['arch']['imageType'] | undefined
|
||||||
| ICorrettoAllAvailableVersions['os']['arch']['imageType']
|
|
||||||
| undefined
|
|
||||||
): ICorrettoAvailableVersions[] {
|
): ICorrettoAvailableVersions[] {
|
||||||
const availableVersions: ICorrettoAvailableVersions[] = [];
|
const availableVersions: ICorrettoAvailableVersions[] = [];
|
||||||
|
|
||||||
for (const version in eligibleVersions) {
|
for (const version in eligibleVersions) {
|
||||||
const availableVersion = eligibleVersions[version];
|
const availableVersion = eligibleVersions[version];
|
||||||
for (const fileType in availableVersion) {
|
for (const fileType in availableVersion) {
|
||||||
const skipNonExtractableBinaries =
|
const skipNonExtractableBinaries = fileType != getDownloadArchiveExtension();
|
||||||
fileType != getDownloadArchiveExtension();
|
|
||||||
if (skipNonExtractableBinaries) {
|
if (skipNonExtractableBinaries) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const availableVersionDetails = availableVersion[fileType];
|
const availableVersionDetails = availableVersion[fileType];
|
||||||
const correttoVersion = this.getCorrettoVersion(
|
const correttoVersion = this.getCorrettoVersion(availableVersionDetails.resource);
|
||||||
availableVersionDetails.resource
|
|
||||||
);
|
|
||||||
|
|
||||||
availableVersions.push({
|
availableVersions.push({
|
||||||
checksum: availableVersionDetails.checksum,
|
checksum: availableVersionDetails.checksum,
|
||||||
@@ -163,6 +124,16 @@ export class CorrettoDistribution extends JavaBase {
|
|||||||
return availableVersions;
|
return availableVersions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private printAvailableVersions(availableVersions: ICorrettoAvailableVersions[]) {
|
||||||
|
core.startGroup('Print information about available versions');
|
||||||
|
console.timeEnd('corretto-retrieve-available-versions');
|
||||||
|
console.log(`Available versions: [${availableVersions.length}]`);
|
||||||
|
console.log(
|
||||||
|
availableVersions.map(item => `${item.version}: ${item.correttoVersion}`).join(', ')
|
||||||
|
);
|
||||||
|
core.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
private getPlatformOption(): string {
|
private getPlatformOption(): string {
|
||||||
// Corretto has its own platform names so we need to map them
|
// Corretto has its own platform names so we need to map them
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
import {JavaBase} from './base-installer';
|
import { JavaBase } from './base-installer';
|
||||||
import {JavaInstallerOptions} from './base-models';
|
import { JavaInstallerOptions } from './base-models';
|
||||||
import {LocalDistribution} from './local/installer';
|
import { LocalDistribution } from './local/installer';
|
||||||
import {ZuluDistribution} from './zulu/installer';
|
import { ZuluDistribution } from './zulu/installer';
|
||||||
import {AdoptDistribution, AdoptImplementation} from './adopt/installer';
|
import { AdoptDistribution, AdoptImplementation } from './adopt/installer';
|
||||||
import {TemurinDistribution, TemurinImplementation} from './temurin/installer';
|
import { TemurinDistribution, TemurinImplementation } from './temurin/installer';
|
||||||
import {LibericaDistributions} from './liberica/installer';
|
import { LibericaDistributions } from './liberica/installer';
|
||||||
import {MicrosoftDistributions} from './microsoft/installer';
|
import { MicrosoftDistributions } from './microsoft/installer';
|
||||||
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';
|
|
||||||
|
|
||||||
enum JavaDistribution {
|
enum JavaDistribution {
|
||||||
Adopt = 'adopt',
|
Adopt = 'adopt',
|
||||||
@@ -20,10 +18,8 @@ enum JavaDistribution {
|
|||||||
Liberica = 'liberica',
|
Liberica = 'liberica',
|
||||||
JdkFile = 'jdkfile',
|
JdkFile = 'jdkfile',
|
||||||
Microsoft = 'microsoft',
|
Microsoft = 'microsoft',
|
||||||
Semeru = 'semeru',
|
|
||||||
Corretto = 'corretto',
|
Corretto = 'corretto',
|
||||||
Oracle = 'oracle',
|
Oracle = 'oracle'
|
||||||
Dragonwell = 'dragonwell'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getJavaDistribution(
|
export function getJavaDistribution(
|
||||||
@@ -36,34 +32,21 @@ export function getJavaDistribution(
|
|||||||
return new LocalDistribution(installerOptions, jdkFile);
|
return new LocalDistribution(installerOptions, jdkFile);
|
||||||
case JavaDistribution.Adopt:
|
case JavaDistribution.Adopt:
|
||||||
case JavaDistribution.AdoptHotspot:
|
case JavaDistribution.AdoptHotspot:
|
||||||
return new AdoptDistribution(
|
return new AdoptDistribution(installerOptions, AdoptImplementation.Hotspot);
|
||||||
installerOptions,
|
|
||||||
AdoptImplementation.Hotspot
|
|
||||||
);
|
|
||||||
case JavaDistribution.AdoptOpenJ9:
|
case JavaDistribution.AdoptOpenJ9:
|
||||||
return new AdoptDistribution(
|
return new AdoptDistribution(installerOptions, AdoptImplementation.OpenJ9);
|
||||||
installerOptions,
|
|
||||||
AdoptImplementation.OpenJ9
|
|
||||||
);
|
|
||||||
case JavaDistribution.Temurin:
|
case JavaDistribution.Temurin:
|
||||||
return new TemurinDistribution(
|
return new TemurinDistribution(installerOptions, TemurinImplementation.Hotspot);
|
||||||
installerOptions,
|
|
||||||
TemurinImplementation.Hotspot
|
|
||||||
);
|
|
||||||
case JavaDistribution.Zulu:
|
case JavaDistribution.Zulu:
|
||||||
return new ZuluDistribution(installerOptions);
|
return new ZuluDistribution(installerOptions);
|
||||||
case JavaDistribution.Liberica:
|
case JavaDistribution.Liberica:
|
||||||
return new LibericaDistributions(installerOptions);
|
return new LibericaDistributions(installerOptions);
|
||||||
case JavaDistribution.Microsoft:
|
case JavaDistribution.Microsoft:
|
||||||
return new MicrosoftDistributions(installerOptions);
|
return new MicrosoftDistributions(installerOptions);
|
||||||
case JavaDistribution.Semeru:
|
|
||||||
return new SemeruDistribution(installerOptions);
|
|
||||||
case JavaDistribution.Corretto:
|
case JavaDistribution.Corretto:
|
||||||
return new CorrettoDistribution(installerOptions);
|
return new CorrettoDistribution(installerOptions);
|
||||||
case JavaDistribution.Oracle:
|
case JavaDistribution.Oracle:
|
||||||
return new OracleDistribution(installerOptions);
|
return new OracleDistribution(installerOptions);
|
||||||
case JavaDistribution.Dragonwell:
|
|
||||||
return new DragonwellDistribution(installerOptions);
|
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,245 +0,0 @@
|
|||||||
import * as core from '@actions/core';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import semver from 'semver';
|
|
||||||
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
|
||||||
import {
|
|
||||||
convertVersionToSemver,
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
getGitHubHttpHeaders,
|
|
||||||
isVersionSatisfies
|
|
||||||
} from '../../util';
|
|
||||||
import {IDragonwellVersions, IDragonwellAllVersions} from './models';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
|
|
||||||
export class DragonwellDistribution extends JavaBase {
|
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
|
||||||
super('Dragonwell', installerOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
if (!this.stable) {
|
|
||||||
throw new Error('Early access versions are not supported by Dragonwell');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.packageType !== 'jdk') {
|
|
||||||
throw new Error('Dragonwell provides only the `jdk` package type');
|
|
||||||
}
|
|
||||||
|
|
||||||
const availableVersions = await this.getAvailableVersions();
|
|
||||||
|
|
||||||
const matchedVersions = availableVersions
|
|
||||||
.filter(item => {
|
|
||||||
return isVersionSatisfies(version, item.jdk_version);
|
|
||||||
})
|
|
||||||
.map(item => {
|
|
||||||
return {
|
|
||||||
version: item.jdk_version,
|
|
||||||
url: item.download_link
|
|
||||||
} as JavaDownloadRelease;
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!matchedVersions.length) {
|
|
||||||
throw new Error(
|
|
||||||
`Couldn't find any satisfied version for the specified java-version: "${version}" and architecture: "${this.architecture}".`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const resolvedVersion = matchedVersions[0];
|
|
||||||
return resolvedVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async getAvailableVersions(): Promise<IDragonwellVersions[]> {
|
|
||||||
const platform = this.getPlatformOption();
|
|
||||||
const arch = this.distributionArchitecture();
|
|
||||||
|
|
||||||
let fetchedDragonwellJson = await this.fetchJsonFromPrimaryUrl();
|
|
||||||
|
|
||||||
if (!fetchedDragonwellJson) {
|
|
||||||
fetchedDragonwellJson = await this.fetchJsonFromBackupUrl();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!fetchedDragonwellJson) {
|
|
||||||
throw new Error(
|
|
||||||
`Couldn't fetch Dragonwell versions information from both primary and backup urls`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
core.debug(
|
|
||||||
'Successfully fetched information about available Dragonwell versions'
|
|
||||||
);
|
|
||||||
|
|
||||||
const availableVersions = this.parseVersions(
|
|
||||||
platform,
|
|
||||||
arch,
|
|
||||||
fetchedDragonwellJson
|
|
||||||
);
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
core.startGroup('Print information about available versions');
|
|
||||||
core.debug(availableVersions.map(item => item.jdk_version).join(', '));
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
return availableVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async downloadTool(
|
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
|
||||||
);
|
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(
|
|
||||||
javaArchivePath,
|
|
||||||
getDownloadArchiveExtension()
|
|
||||||
);
|
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
|
||||||
archivePath,
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
version,
|
|
||||||
this.architecture
|
|
||||||
);
|
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
|
||||||
}
|
|
||||||
|
|
||||||
private parseVersions(
|
|
||||||
platform: string,
|
|
||||||
arch: string,
|
|
||||||
dragonwellVersions: IDragonwellAllVersions
|
|
||||||
): IDragonwellVersions[] {
|
|
||||||
const eligibleVersions: IDragonwellVersions[] = [];
|
|
||||||
|
|
||||||
for (const majorVersion in dragonwellVersions) {
|
|
||||||
const majorVersionMap = dragonwellVersions[majorVersion];
|
|
||||||
for (let jdkVersion in majorVersionMap) {
|
|
||||||
const jdkVersionMap = majorVersionMap[jdkVersion];
|
|
||||||
if (!(platform in jdkVersionMap)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const platformMap = jdkVersionMap[platform];
|
|
||||||
if (!(arch in platformMap)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
const archMap = platformMap[arch];
|
|
||||||
|
|
||||||
if (jdkVersion === 'latest') {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Some version of Dragonwell JDK are numerated with help of non-semver notation (more then 3 digits).
|
|
||||||
// Common practice is to transform excess digits to the so-called semver build part, which is prefixed with the plus sign, to be able to operate with them using semver tools.
|
|
||||||
const jdkVersionNums: string[] = jdkVersion
|
|
||||||
.replace('+', '.')
|
|
||||||
.split('.');
|
|
||||||
jdkVersion = convertVersionToSemver(
|
|
||||||
`${jdkVersionNums.slice(0, 3).join('.')}.${
|
|
||||||
jdkVersionNums[jdkVersionNums.length - 1]
|
|
||||||
}`
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const edition in archMap) {
|
|
||||||
eligibleVersions.push({
|
|
||||||
os: platform,
|
|
||||||
architecture: arch,
|
|
||||||
jdk_version: jdkVersion,
|
|
||||||
checksum: archMap[edition].sha256 ?? '',
|
|
||||||
download_link: archMap[edition].download_url,
|
|
||||||
edition: edition,
|
|
||||||
image_type: 'jdk'
|
|
||||||
});
|
|
||||||
break; // Get the first available link to the JDK. In most cases it should point to the Extended version of JDK, in rare cases like with v17 it points to the Standard version (the only available).
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const sortedVersions = this.sortParsedVersions(eligibleVersions);
|
|
||||||
|
|
||||||
return sortedVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Sorts versions in descending order as by default data in JSON isn't sorted
|
|
||||||
private sortParsedVersions(
|
|
||||||
eligibleVersions: IDragonwellVersions[]
|
|
||||||
): IDragonwellVersions[] {
|
|
||||||
const sortedVersions = eligibleVersions.sort((versionObj1, versionObj2) => {
|
|
||||||
const version1 = versionObj1.jdk_version;
|
|
||||||
const version2 = versionObj2.jdk_version;
|
|
||||||
return semver.compareBuild(version1, version2);
|
|
||||||
});
|
|
||||||
return sortedVersions.reverse();
|
|
||||||
}
|
|
||||||
|
|
||||||
private getPlatformOption(): string {
|
|
||||||
switch (process.platform) {
|
|
||||||
case 'win32':
|
|
||||||
return 'windows';
|
|
||||||
default:
|
|
||||||
return process.platform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async fetchJsonFromPrimaryUrl(): Promise<IDragonwellAllVersions | null> {
|
|
||||||
const primaryUrl = 'https://dragonwell-jdk.io/map_with_checksum.json';
|
|
||||||
try {
|
|
||||||
core.debug(
|
|
||||||
`Trying to fetch available Dragonwell versions info from the primary url: ${primaryUrl}`
|
|
||||||
);
|
|
||||||
const fetchedDragonwellJson = (
|
|
||||||
await this.http.getJson<IDragonwellAllVersions>(primaryUrl)
|
|
||||||
).result;
|
|
||||||
return fetchedDragonwellJson;
|
|
||||||
} catch (err) {
|
|
||||||
core.debug(
|
|
||||||
`Fetching Dragonwell versions info from the primary link: ${primaryUrl} ended up with the error: ${err.message}`
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async fetchJsonFromBackupUrl(): Promise<IDragonwellAllVersions | null> {
|
|
||||||
const owner = 'dragonwell-releng';
|
|
||||||
const repository = 'dragonwell-setup-java';
|
|
||||||
const branch = 'main';
|
|
||||||
const filePath = 'releases.json';
|
|
||||||
|
|
||||||
const backupUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
|
||||||
|
|
||||||
const headers = getGitHubHttpHeaders();
|
|
||||||
|
|
||||||
try {
|
|
||||||
core.debug(
|
|
||||||
`Trying to fetch available Dragonwell versions info from the backup url: ${backupUrl}`
|
|
||||||
);
|
|
||||||
const fetchedDragonwellJson = (
|
|
||||||
await this.http.getJson<IDragonwellAllVersions>(backupUrl, headers)
|
|
||||||
).result;
|
|
||||||
return fetchedDragonwellJson;
|
|
||||||
} catch (err) {
|
|
||||||
core.debug(
|
|
||||||
`Fetching Dragonwell versions info from the backup url: ${backupUrl} ended up with the error: ${err.message}`
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
export interface IDragonwellAllVersions {
|
|
||||||
[major: string]: {
|
|
||||||
[jdk_version: string]: {
|
|
||||||
[os: string]: {
|
|
||||||
[arch: string]: {
|
|
||||||
[edition: string]: {
|
|
||||||
content_type: string;
|
|
||||||
sha256: string;
|
|
||||||
name: string;
|
|
||||||
download_url: string;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface IDragonwellVersions {
|
|
||||||
os: string;
|
|
||||||
architecture: string;
|
|
||||||
jdk_version: string;
|
|
||||||
checksum: string;
|
|
||||||
download_link: string;
|
|
||||||
edition: string;
|
|
||||||
image_type: string;
|
|
||||||
}
|
|
||||||
@@ -1,17 +1,9 @@
|
|||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
import {
|
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
isVersionSatisfies
|
|
||||||
} 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';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
@@ -25,9 +17,7 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
super('Liberica', installerOptions);
|
super('Liberica', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
@@ -47,12 +37,10 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
|
|
||||||
const availableVersions = availableVersionsRaw.map(item => ({
|
const availableVersions = availableVersionsRaw.map(item => ({
|
||||||
@@ -65,9 +53,7 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
||||||
|
|
||||||
if (!satisfiedVersion) {
|
if (!satisfiedVersion) {
|
||||||
const availableOptions = availableVersions
|
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
const availableOptionsMessage = availableOptions
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
@@ -81,20 +67,21 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
|
|
||||||
private async getAvailableVersions(): Promise<LibericaVersion[]> {
|
private async getAvailableVersions(): Promise<LibericaVersion[]> {
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
console.time('Retrieving available versions for Liberica took'); // eslint-disable-line no-console
|
console.time('liberica-retrieve-available-versions');
|
||||||
}
|
}
|
||||||
const url = this.prepareAvailableVersionsUrl();
|
const url = this.prepareAvailableVersionsUrl();
|
||||||
|
|
||||||
core.debug(`Gathering available versions from '${url}'`);
|
if (core.isDebug()) {
|
||||||
|
core.debug(`Gathering available versions from '${url}'`);
|
||||||
|
}
|
||||||
|
|
||||||
const availableVersions =
|
const availableVersions = (await this.http.getJson<LibericaVersion[]>(url)).result ?? [];
|
||||||
(await this.http.getJson<LibericaVersion[]>(url)).result ?? [];
|
|
||||||
|
|
||||||
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 Liberica took'); // eslint-disable-line no-console
|
console.timeEnd('liberica-retrieve-available-versions');
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
console.log(`Available versions: [${availableVersions.length}]`);
|
||||||
core.debug(availableVersions.map(item => item.version).join(', '));
|
console.log(availableVersions.map(item => item.version));
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -108,8 +95,7 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
...this.getArchitectureOptions(),
|
...this.getArchitectureOptions(),
|
||||||
'build-type': this.stable ? 'all' : 'ea',
|
'build-type': this.stable ? 'all' : 'ea',
|
||||||
'installation-type': 'archive',
|
'installation-type': 'archive',
|
||||||
fields:
|
fields: 'downloadUrl,version,featureVersion,interimVersion,updateVersion,buildVersion'
|
||||||
'downloadUrl,version,featureVersion,interimVersion,updateVersion,buildVersion'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const searchParams = new URLSearchParams(urlOptions).toString();
|
const searchParams = new URLSearchParams(urlOptions).toString();
|
||||||
@@ -129,15 +115,15 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'x86':
|
case 'x86':
|
||||||
return {bitness: '32', arch: 'x86'};
|
return { bitness: '32', arch: 'x86' };
|
||||||
case 'x64':
|
case 'x64':
|
||||||
return {bitness: '64', arch: 'x86'};
|
return { bitness: '64', arch: 'x86' };
|
||||||
case 'armv7':
|
case 'armv7':
|
||||||
return {bitness: '32', arch: 'arm'};
|
return { bitness: '32', arch: 'arm' };
|
||||||
case 'aarch64':
|
case 'aarch64':
|
||||||
return {bitness: '64', arch: 'arm'};
|
return { bitness: '64', arch: 'arm' };
|
||||||
case 'ppc64le':
|
case 'ppc64le':
|
||||||
return {bitness: '64', arch: 'ppc'};
|
return { bitness: '64', arch: 'ppc' };
|
||||||
default:
|
default:
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Architecture '${this.architecture}' is not supported. Supported architectures: ${supportedArchitectures}`
|
`Architecture '${this.architecture}' is not supported. Supported architectures: ${supportedArchitectures}`
|
||||||
@@ -145,9 +131,7 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getPlatformOption(
|
private getPlatformOption(platform: NodeJS.Platform = process.platform): OsVersions {
|
||||||
platform: NodeJS.Platform = process.platform
|
|
||||||
): OsVersions {
|
|
||||||
switch (platform) {
|
switch (platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
return 'macos';
|
return 'macos';
|
||||||
@@ -166,11 +150,8 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private convertVersionToSemver(version: LibericaVersion): string {
|
private convertVersionToSemver(version: LibericaVersion): string {
|
||||||
const {buildVersion, featureVersion, interimVersion, updateVersion} =
|
let { buildVersion, featureVersion, interimVersion, updateVersion } = version;
|
||||||
version;
|
const mainVersion = [featureVersion, interimVersion, updateVersion].join('.');
|
||||||
const mainVersion = [featureVersion, interimVersion, updateVersion].join(
|
|
||||||
'.'
|
|
||||||
);
|
|
||||||
if (buildVersion != 0) {
|
if (buildVersion != 0) {
|
||||||
return `${mainVersion}+${buildVersion}`;
|
return `${mainVersion}+${buildVersion}`;
|
||||||
}
|
}
|
||||||
@@ -178,7 +159,7 @@ export class LibericaDistributions extends JavaBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected distributionArchitecture(): string {
|
protected distributionArchitecture(): string {
|
||||||
const arch = super.distributionArchitecture();
|
let arch = super.distributionArchitecture();
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'arm':
|
case 'arm':
|
||||||
return 'armv7';
|
return 'armv7';
|
||||||
|
|||||||
@@ -3,12 +3,7 @@
|
|||||||
export type Bitness = '32' | '64';
|
export type Bitness = '32' | '64';
|
||||||
export type ArchType = 'arm' | 'ppc' | 'sparc' | 'x86';
|
export type ArchType = 'arm' | 'ppc' | 'sparc' | 'x86';
|
||||||
|
|
||||||
export type OsVersions =
|
export type OsVersions = 'linux' | 'linux-musl' | 'macos' | 'solaris' | 'windows';
|
||||||
| 'linux'
|
|
||||||
| 'linux-musl'
|
|
||||||
| 'macos'
|
|
||||||
| 'solaris'
|
|
||||||
| 'windows';
|
|
||||||
|
|
||||||
export interface ArchitectureOptions {
|
export interface ArchitectureOptions {
|
||||||
bitness: Bitness;
|
bitness: Bitness;
|
||||||
|
|||||||
@@ -3,21 +3,15 @@ import * as core from '@actions/core';
|
|||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
import semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {
|
import { JavaInstallerOptions, JavaDownloadRelease, JavaInstallerResults } from '../base-models';
|
||||||
JavaInstallerOptions,
|
import { extractJdkFile } from '../../util';
|
||||||
JavaDownloadRelease,
|
import { MACOS_JAVA_CONTENT_POSTFIX } from '../../constants';
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {extractJdkFile} from '../../util';
|
|
||||||
import {MACOS_JAVA_CONTENT_POSTFIX} from '../../constants';
|
|
||||||
|
|
||||||
export class LocalDistribution extends JavaBase {
|
export class LocalDistribution extends JavaBase {
|
||||||
constructor(
|
constructor(installerOptions: JavaInstallerOptions, private jdkFile?: string) {
|
||||||
installerOptions: JavaInstallerOptions,
|
|
||||||
private jdkFile?: string
|
|
||||||
) {
|
|
||||||
super('jdkfile', installerOptions);
|
super('jdkfile', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -27,9 +21,7 @@ export class LocalDistribution extends JavaBase {
|
|||||||
if (foundJava) {
|
if (foundJava) {
|
||||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||||
} else {
|
} else {
|
||||||
core.info(
|
core.info(`Java ${this.version} was not found in tool-cache. Trying to unpack JDK file...`);
|
||||||
`Java ${this.version} was not found in tool-cache. Trying to unpack JDK file...`
|
|
||||||
);
|
|
||||||
if (!this.jdkFile) {
|
if (!this.jdkFile) {
|
||||||
throw new Error("'jdkFile' is not specified");
|
throw new Error("'jdkFile' is not specified");
|
||||||
}
|
}
|
||||||
@@ -47,47 +39,38 @@ export class LocalDistribution extends JavaBase {
|
|||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||||
const javaVersion = this.version;
|
const javaVersion = this.version;
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
let javaPath = await tc.cacheDir(
|
||||||
archivePath,
|
archivePath,
|
||||||
this.toolcacheFolderName,
|
this.toolcacheFolderName,
|
||||||
this.getToolcacheVersionName(javaVersion),
|
this.getToolcacheVersionName(javaVersion),
|
||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// for different Java distributions, postfix can exist or not so need to check both cases
|
||||||
|
if (
|
||||||
|
process.platform === 'darwin' &&
|
||||||
|
fs.existsSync(path.join(javaPath, MACOS_JAVA_CONTENT_POSTFIX))
|
||||||
|
) {
|
||||||
|
javaPath = path.join(javaPath, MACOS_JAVA_CONTENT_POSTFIX);
|
||||||
|
}
|
||||||
|
|
||||||
foundJava = {
|
foundJava = {
|
||||||
version: javaVersion,
|
version: javaVersion,
|
||||||
path: javaPath
|
path: javaPath
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
// JDK folder may contain postfix "Contents/Home" on macOS
|
|
||||||
const macOSPostfixPath = path.join(
|
|
||||||
foundJava.path,
|
|
||||||
MACOS_JAVA_CONTENT_POSTFIX
|
|
||||||
);
|
|
||||||
if (process.platform === 'darwin' && fs.existsSync(macOSPostfixPath)) {
|
|
||||||
foundJava.path = macOSPostfixPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info(`Setting Java ${foundJava.version} as default`);
|
core.info(`Setting Java ${foundJava.version} as default`);
|
||||||
|
|
||||||
this.setJavaDefault(foundJava.version, foundJava.path);
|
this.setJavaDefault(foundJava.version, foundJava.path);
|
||||||
return foundJava;
|
return foundJava;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||||
version: string // eslint-disable-line @typescript-eslint/no-unused-vars
|
throw new Error('This method should not be implemented in local file provider');
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
throw new Error(
|
|
||||||
'This method should not be implemented in local file provider'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease // eslint-disable-line @typescript-eslint/no-unused-vars
|
throw new Error('This method should not be implemented in local file provider');
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
throw new Error(
|
|
||||||
'This method should not be implemented in local file provider'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,19 @@
|
|||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
JavaDownloadRelease,
|
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
getGitHubHttpHeaders
|
|
||||||
} 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';
|
||||||
|
import { OutgoingHttpHeaders } from 'http';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import {ITypedResponse} from '@actions/http-client/interfaces';
|
import { ITypedResponse } from '@actions/http-client/interfaces';
|
||||||
|
|
||||||
export class MicrosoftDistributions extends JavaBase {
|
export class MicrosoftDistributions extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
super('Microsoft', installerOptions);
|
super('Microsoft', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
@@ -42,12 +33,10 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
if (arch !== 'x64' && arch !== 'aarch64') {
|
if (arch !== 'x64' && arch !== 'aarch64') {
|
||||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
||||||
@@ -58,9 +47,7 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.packageType !== 'jdk') {
|
if (this.packageType !== 'jdk') {
|
||||||
throw new Error(
|
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
|
||||||
'Microsoft Build of OpenJDK provides only the `jdk` package type'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const manifest = await this.getAvailableVersions();
|
const manifest = await this.getAvailableVersions();
|
||||||
@@ -79,32 +66,29 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return { url: foundRelease.files[0].download_url, version: foundRelease.version };
|
||||||
url: foundRelease.files[0].download_url,
|
|
||||||
version: foundRelease.version
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
|
private async getAvailableVersions(): Promise<tc.IToolRelease[] | null> {
|
||||||
// TODO get these dynamically!
|
// TODO get these dynamically!
|
||||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||||
|
const token = core.getInput('token');
|
||||||
|
const auth = !token ? undefined : `token ${token}`;
|
||||||
const owner = 'actions';
|
const owner = 'actions';
|
||||||
const repository = 'setup-java';
|
const repository = 'setup-java';
|
||||||
const branch = 'main';
|
const branch = 'main';
|
||||||
const filePath =
|
const filePath = 'src/distributions/microsoft/microsoft-openjdk-versions.json';
|
||||||
'src/distributions/microsoft/microsoft-openjdk-versions.json';
|
|
||||||
|
|
||||||
let releases: tc.IToolRelease[] | null = null;
|
let releases: tc.IToolRelease[] | null = null;
|
||||||
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
const fileUrl = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
||||||
|
|
||||||
const headers = getGitHubHttpHeaders();
|
const headers: OutgoingHttpHeaders = {
|
||||||
|
authorization: auth,
|
||||||
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
|
};
|
||||||
|
|
||||||
let response: ITypedResponse<tc.IToolRelease[]> | null = null;
|
let response: ITypedResponse<tc.IToolRelease[]> | null = null;
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
console.time('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl, headers);
|
response = await this.http.getJson<tc.IToolRelease[]>(fileUrl, headers);
|
||||||
if (!response.result) {
|
if (!response.result) {
|
||||||
@@ -121,14 +105,6 @@ export class MicrosoftDistributions extends JavaBase {
|
|||||||
releases = response.result;
|
releases = response.result;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (core.isDebug() && releases) {
|
|
||||||
core.startGroup('Print information about available versions');
|
|
||||||
console.timeEnd('Retrieving available versions for Microsoft took'); // eslint-disable-line no-console
|
|
||||||
core.debug(`Available versions: [${releases.length}]`);
|
|
||||||
core.debug(releases.map(item => item.version).join(', '));
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
return releases;
|
return releases;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,152 +1,4 @@
|
|||||||
[
|
[
|
||||||
{
|
|
||||||
"version": "17.0.7",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.7-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.7-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.6",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.6-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.6-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.6-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.6-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.6-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.6-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.5",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.5-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.5-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.5-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.5-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.5-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.5-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "17.0.4",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.4-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.4-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.4-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.4-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-17.0.4-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.4-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"version": "17.0.3",
|
"version": "17.0.3",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
@@ -258,154 +110,6 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"version": "11.0.19",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.19-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.19-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.18",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.18-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.18-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.18-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.18-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.18-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.18-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.17",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.17-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.17-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.17-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.17-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.17-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.17-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"version": "11.0.16",
|
|
||||||
"stable": true,
|
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
|
||||||
"files": [
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.16-macos-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-macos-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.16-linux-x64.tar.gz",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-linux-x64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.16-windows-x64.zip",
|
|
||||||
"arch": "x64",
|
|
||||||
"platform": "win32",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-windows-x64.zip"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.16-macos-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "darwin",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-macos-aarch64.tar.gz"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "microsoft-jdk-11.0.16-linux-aarch64.tar.gz",
|
|
||||||
"arch": "aarch64",
|
|
||||||
"platform": "linux",
|
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-11.0.16-linux-aarch64.tar.gz"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"version": "11.0.15",
|
"version": "11.0.15",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
@@ -474,4 +178,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1,3 +1,2 @@
|
|||||||
/* eslint @typescript-eslint/no-unused-vars: "off" -- There is a bug with this rule, it's not working properly with types */
|
|
||||||
type OsVersions = 'linux' | 'macos' | 'windows';
|
type OsVersions = 'linux' | 'macos' | 'windows';
|
||||||
type ArchiveType = 'tar.gz' | 'zip';
|
type ArchiveType = 'tar.gz' | 'zip';
|
||||||
|
|||||||
@@ -4,14 +4,10 @@ import * as tc from '@actions/tool-cache';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
JavaDownloadRelease,
|
import { extractJdkFile, getDownloadArchiveExtension } from '../../util';
|
||||||
JavaInstallerOptions,
|
import { HttpCodes } from '@actions/http-client';
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {extractJdkFile, getDownloadArchiveExtension} from '../../util';
|
|
||||||
import {HttpCodes} from '@actions/http-client';
|
|
||||||
|
|
||||||
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
const ORACLE_DL_BASE = 'https://download.oracle.com/java';
|
||||||
|
|
||||||
@@ -20,36 +16,32 @@ export class OracleDistribution extends JavaBase {
|
|||||||
super('Oracle', installerOptions);
|
super('Oracle', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
let extension = getDownloadArchiveExtension();
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
let 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);
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
let javaPath = await tc.cacheDir(
|
||||||
archivePath,
|
archivePath,
|
||||||
this.toolcacheFolderName,
|
this.toolcacheFolderName,
|
||||||
version,
|
version,
|
||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||||
range: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
if (arch !== 'x64' && arch !== 'aarch64') {
|
if (arch !== 'x64' && arch !== 'aarch64') {
|
||||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
||||||
@@ -65,48 +57,33 @@ export class OracleDistribution extends JavaBase {
|
|||||||
|
|
||||||
const platform = this.getPlatform();
|
const platform = this.getPlatform();
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
|
let major;
|
||||||
const isOnlyMajorProvided = !range.includes('.');
|
let fileUrl;
|
||||||
const major = isOnlyMajorProvided ? range : range.split('.')[0];
|
if (range.includes('.')) {
|
||||||
|
major = range.split('.')[0];
|
||||||
const possibleUrls: string[] = [];
|
fileUrl = `${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||||
|
} else {
|
||||||
/**
|
major = range;
|
||||||
* NOTE
|
fileUrl = `${ORACLE_DL_BASE}/${range}/latest/jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||||
* If only major version was provided we will check it under /latest first
|
|
||||||
* in order to retrieve the latest possible version if possible,
|
|
||||||
* otherwise we will fall back to /archive where we are guaranteed to
|
|
||||||
* find any version if it exists
|
|
||||||
*/
|
|
||||||
if (isOnlyMajorProvided) {
|
|
||||||
possibleUrls.push(
|
|
||||||
`${ORACLE_DL_BASE}/${major}/latest/jdk-${major}_${platform}-${arch}_bin.${extension}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
possibleUrls.push(
|
|
||||||
`${ORACLE_DL_BASE}/${major}/archive/jdk-${range}_${platform}-${arch}_bin.${extension}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (parseInt(major) < 17) {
|
if (parseInt(major) < 17) {
|
||||||
throw new Error('Oracle JDK is only supported for JDK 17 and later');
|
throw new Error('Oracle JDK is only supported for JDK 17 and later');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const url of possibleUrls) {
|
const response = await this.http.head(fileUrl);
|
||||||
const response = await this.http.head(url);
|
|
||||||
|
|
||||||
if (response.message.statusCode === HttpCodes.OK) {
|
if (response.message.statusCode === HttpCodes.NotFound) {
|
||||||
return {url, version: range};
|
throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
|
||||||
}
|
|
||||||
|
|
||||||
if (response.message.statusCode !== HttpCodes.NotFound) {
|
|
||||||
throw new Error(
|
|
||||||
`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(`Could not find Oracle JDK for SemVer ${range}`);
|
if (response.message.statusCode !== HttpCodes.OK) {
|
||||||
|
throw new Error(
|
||||||
|
`Http request for Oracle JDK failed with status code: ${response.message.statusCode}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { url: fileUrl, version: range };
|
||||||
}
|
}
|
||||||
|
|
||||||
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
||||||
|
|||||||
@@ -1,201 +0,0 @@
|
|||||||
import {JavaBase} from '../base-installer';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import semver from 'semver';
|
|
||||||
import {
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
isVersionSatisfies
|
|
||||||
} from '../../util';
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
import * as tc from '@actions/tool-cache';
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
|
||||||
import {ISemeruAvailableVersions} from './models';
|
|
||||||
|
|
||||||
const supportedArchitectures = [
|
|
||||||
'x64',
|
|
||||||
'x86',
|
|
||||||
'ppc64le',
|
|
||||||
'ppc64',
|
|
||||||
's390x',
|
|
||||||
'aarch64'
|
|
||||||
];
|
|
||||||
|
|
||||||
export class SemeruDistribution extends JavaBase {
|
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
|
||||||
super('IBM_Semeru', installerOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
if (!supportedArchitectures.includes(this.architecture)) {
|
|
||||||
throw new Error(
|
|
||||||
`Unsupported architecture for IBM Semeru: ${
|
|
||||||
this.architecture
|
|
||||||
}, the following are supported: ${supportedArchitectures.join(', ')}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this.stable) {
|
|
||||||
throw new Error(
|
|
||||||
'IBM Semeru does not provide builds for early access versions'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.packageType !== 'jdk' && this.packageType !== 'jre') {
|
|
||||||
throw new Error('IBM Semeru only provide `jdk` and `jre` package types');
|
|
||||||
}
|
|
||||||
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
|
||||||
const availableVersionsWithBinaries = availableVersionsRaw
|
|
||||||
.filter(item => item.binaries.length > 0)
|
|
||||||
.map(item => {
|
|
||||||
// normalize 17.0.0-beta+33.0.202107301459 to 17.0.0+33.0.202107301459 for earlier access versions
|
|
||||||
const formattedVersion = this.stable
|
|
||||||
? item.version_data.semver
|
|
||||||
: item.version_data.semver.replace('-beta+', '+');
|
|
||||||
return {
|
|
||||||
version: formattedVersion,
|
|
||||||
url: item.binaries[0].package.link
|
|
||||||
} as JavaDownloadRelease;
|
|
||||||
});
|
|
||||||
|
|
||||||
const satisfiedVersions = availableVersionsWithBinaries
|
|
||||||
.filter(item => isVersionSatisfies(version, item.version))
|
|
||||||
.sort((a, b) => {
|
|
||||||
return -semver.compareBuild(a.version, b.version);
|
|
||||||
});
|
|
||||||
|
|
||||||
const resolvedFullVersion =
|
|
||||||
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
|
||||||
if (!resolvedFullVersion) {
|
|
||||||
const availableOptions = availableVersionsWithBinaries
|
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
|
||||||
: '';
|
|
||||||
throw new Error(
|
|
||||||
`Could not find satisfied version for SemVer '${version}'. ${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 extension = getDownloadArchiveExtension();
|
|
||||||
|
|
||||||
const extractedJavaPath: string = await extractJdkFile(
|
|
||||||
javaArchivePath,
|
|
||||||
extension
|
|
||||||
);
|
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
|
||||||
|
|
||||||
const javaPath: string = await tc.cacheDir(
|
|
||||||
archivePath,
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
version,
|
|
||||||
this.architecture
|
|
||||||
);
|
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
|
||||||
}
|
|
||||||
|
|
||||||
protected get toolcacheFolderName(): string {
|
|
||||||
return super.toolcacheFolderName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public async getAvailableVersions(): Promise<ISemeruAvailableVersions[]> {
|
|
||||||
const platform = this.getPlatformOption();
|
|
||||||
const arch = this.architecture;
|
|
||||||
const imageType = this.packageType;
|
|
||||||
const versionRange = encodeURI('[1.0,100.0]'); // retrieve all available versions
|
|
||||||
const releaseType = this.stable ? 'ga' : 'ea';
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
console.time('Retrieving available versions for Semeru took'); // eslint-disable-line no-console
|
|
||||||
}
|
|
||||||
|
|
||||||
const baseRequestArguments = [
|
|
||||||
`project=jdk`,
|
|
||||||
'vendor=ibm',
|
|
||||||
`heap_size=normal`,
|
|
||||||
'sort_method=DEFAULT',
|
|
||||||
'sort_order=DESC',
|
|
||||||
`os=${platform}`,
|
|
||||||
`architecture=${arch}`,
|
|
||||||
`image_type=${imageType}`,
|
|
||||||
`release_type=${releaseType}`,
|
|
||||||
`jvm_impl=openj9`
|
|
||||||
].join('&');
|
|
||||||
|
|
||||||
// need to iterate through all pages to retrieve the list of all versions
|
|
||||||
// Adoptium API doesn't provide way to retrieve the count of pages to iterate so infinity loop
|
|
||||||
let page_index = 0;
|
|
||||||
const availableVersions: ISemeruAvailableVersions[] = [];
|
|
||||||
while (true) {
|
|
||||||
const requestArguments = `${baseRequestArguments}&page_size=20&page=${page_index}`;
|
|
||||||
const availableVersionsUrl = `https://api.adoptopenjdk.net/v3/assets/version/${versionRange}?${requestArguments}`;
|
|
||||||
if (core.isDebug() && page_index === 0) {
|
|
||||||
// url is identical except page_index so print it once for debug
|
|
||||||
core.debug(
|
|
||||||
`Gathering available versions from '${availableVersionsUrl}'`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const paginationPage = (
|
|
||||||
await this.http.getJson<ISemeruAvailableVersions[]>(
|
|
||||||
availableVersionsUrl
|
|
||||||
)
|
|
||||||
).result;
|
|
||||||
if (paginationPage === null || paginationPage.length === 0) {
|
|
||||||
// break infinity loop because we have reached end of pagination
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
availableVersions.push(...paginationPage);
|
|
||||||
page_index++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
core.startGroup('Print information about available versions');
|
|
||||||
console.timeEnd('Retrieving available versions for Semeru took'); // eslint-disable-line no-console
|
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
|
||||||
core.debug(
|
|
||||||
availableVersions.map(item => item.version_data.semver).join(', ')
|
|
||||||
);
|
|
||||||
core.endGroup();
|
|
||||||
}
|
|
||||||
|
|
||||||
return availableVersions;
|
|
||||||
}
|
|
||||||
|
|
||||||
private getPlatformOption(): string {
|
|
||||||
// Adopt has own platform names so need to map them
|
|
||||||
switch (process.platform) {
|
|
||||||
case 'darwin':
|
|
||||||
return 'mac';
|
|
||||||
case 'win32':
|
|
||||||
return 'windows';
|
|
||||||
default:
|
|
||||||
return process.platform;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
export interface ISemeruAvailableVersions {
|
|
||||||
binaries: [
|
|
||||||
{
|
|
||||||
architecture: string;
|
|
||||||
heap_size: string;
|
|
||||||
image_type: string;
|
|
||||||
jvm_impl: string;
|
|
||||||
os: string;
|
|
||||||
package: {
|
|
||||||
checksum: string;
|
|
||||||
checksum_link: string;
|
|
||||||
download_count: number;
|
|
||||||
link: string;
|
|
||||||
metadata_link: string;
|
|
||||||
name: string;
|
|
||||||
size: string;
|
|
||||||
};
|
|
||||||
project: string;
|
|
||||||
scm_ref: string;
|
|
||||||
updated_at: string;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
id: string;
|
|
||||||
release_link: string;
|
|
||||||
release_name: string;
|
|
||||||
release_type: string;
|
|
||||||
vendor: string;
|
|
||||||
version_data: {
|
|
||||||
build: number;
|
|
||||||
major: number;
|
|
||||||
minor: number;
|
|
||||||
openjdk_version: string;
|
|
||||||
security: string;
|
|
||||||
semver: string;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -5,18 +5,10 @@ import fs from 'fs';
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {ITemurinAvailableVersions} from './models';
|
import { ITemurinAvailableVersions } from './models';
|
||||||
import {
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
JavaDownloadRelease,
|
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
import {
|
|
||||||
extractJdkFile,
|
|
||||||
getDownloadArchiveExtension,
|
|
||||||
isVersionSatisfies
|
|
||||||
} from '../../util';
|
|
||||||
|
|
||||||
export enum TemurinImplementation {
|
export enum TemurinImplementation {
|
||||||
Hotspot = 'Hotspot'
|
Hotspot = 'Hotspot'
|
||||||
@@ -30,9 +22,7 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
super(`Temurin-${jvmImpl}`, installerOptions);
|
super(`Temurin-${jvmImpl}`, installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
const availableVersionsWithBinaries = availableVersionsRaw
|
const availableVersionsWithBinaries = availableVersionsRaw
|
||||||
.filter(item => item.binaries.length > 0)
|
.filter(item => item.binaries.length > 0)
|
||||||
@@ -53,12 +43,9 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
return -semver.compareBuild(a.version, b.version);
|
return -semver.compareBuild(a.version, b.version);
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolvedFullVersion =
|
const resolvedFullVersion = satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
||||||
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
|
||||||
if (!resolvedFullVersion) {
|
if (!resolvedFullVersion) {
|
||||||
const availableOptions = availableVersionsWithBinaries
|
const availableOptions = availableVersionsWithBinaries.map(item => item.version).join(', ');
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
const availableOptionsMessage = availableOptions
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
@@ -70,31 +57,27 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
return resolvedFullVersion;
|
return resolvedFullVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
let javaPath: string;
|
||||||
): Promise<JavaInstallerResults> {
|
let extractedJavaPath: string;
|
||||||
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
let extension = getDownloadArchiveExtension();
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
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);
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
javaPath = await tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||||
archivePath,
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
version,
|
|
||||||
this.architecture
|
|
||||||
);
|
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
protected get toolcacheFolderName(): string {
|
protected get toolcacheFolderName(): string {
|
||||||
@@ -109,7 +92,7 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
const releaseType = this.stable ? 'ga' : 'ea';
|
const releaseType = this.stable ? 'ga' : 'ea';
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
console.time('Retrieving available versions for Temurin took'); // eslint-disable-line no-console
|
console.time('temurin-retrieve-available-versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
const baseRequestArguments = [
|
const baseRequestArguments = [
|
||||||
@@ -134,15 +117,11 @@ export class TemurinDistribution extends JavaBase {
|
|||||||
const availableVersionsUrl = `https://api.adoptium.net/v3/assets/version/${versionRange}?${requestArguments}`;
|
const availableVersionsUrl = `https://api.adoptium.net/v3/assets/version/${versionRange}?${requestArguments}`;
|
||||||
if (core.isDebug() && page_index === 0) {
|
if (core.isDebug() && page_index === 0) {
|
||||||
// url is identical except page_index so print it once for debug
|
// url is identical except page_index so print it once for debug
|
||||||
core.debug(
|
core.debug(`Gathering available versions from '${availableVersionsUrl}'`);
|
||||||
`Gathering available versions from '${availableVersionsUrl}'`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const paginationPage = (
|
const paginationPage = (
|
||||||
await this.http.getJson<ITemurinAvailableVersions[]>(
|
await this.http.getJson<ITemurinAvailableVersions[]>(availableVersionsUrl)
|
||||||
availableVersionsUrl
|
|
||||||
)
|
|
||||||
).result;
|
).result;
|
||||||
if (paginationPage === null || paginationPage.length === 0) {
|
if (paginationPage === null || paginationPage.length === 0) {
|
||||||
// break infinity loop because we have reached end of pagination
|
// break infinity loop because we have reached end of pagination
|
||||||
@@ -155,11 +134,9 @@ export class TemurinDistribution 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 Temurin took'); // eslint-disable-line no-console
|
console.timeEnd('temurin-retrieve-available-versions');
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
console.log(`Available versions: [${availableVersions.length}]`);
|
||||||
core.debug(
|
console.log(availableVersions.map(item => item.version_data.semver).join(', '));
|
||||||
availableVersions.map(item => item.version_data.semver).join(', ')
|
|
||||||
);
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,34 +5,23 @@ import path from 'path';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import semver from 'semver';
|
import semver from 'semver';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import { JavaBase } from '../base-installer';
|
||||||
import {IZuluVersions} from './models';
|
import { IZuluVersions } from './models';
|
||||||
import {
|
import { extractJdkFile, getDownloadArchiveExtension, isVersionSatisfies } from '../../util';
|
||||||
extractJdkFile,
|
import { JavaDownloadRelease, JavaInstallerOptions, JavaInstallerResults } from '../base-models';
|
||||||
getDownloadArchiveExtension,
|
|
||||||
convertVersionToSemver,
|
|
||||||
isVersionSatisfies
|
|
||||||
} from '../../util';
|
|
||||||
import {
|
|
||||||
JavaDownloadRelease,
|
|
||||||
JavaInstallerOptions,
|
|
||||||
JavaInstallerResults
|
|
||||||
} from '../base-models';
|
|
||||||
|
|
||||||
export class ZuluDistribution extends JavaBase {
|
export class ZuluDistribution extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
super('Zulu', installerOptions);
|
super('Zulu', installerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(version: string): Promise<JavaDownloadRelease> {
|
||||||
version: string
|
|
||||||
): Promise<JavaDownloadRelease> {
|
|
||||||
const availableVersionsRaw = await this.getAvailableVersions();
|
const availableVersionsRaw = await this.getAvailableVersions();
|
||||||
const availableVersions = availableVersionsRaw.map(item => {
|
const availableVersions = availableVersionsRaw.map(item => {
|
||||||
return {
|
return {
|
||||||
version: convertVersionToSemver(item.jdk_version),
|
version: this.convertVersionToSemver(item.jdk_version),
|
||||||
url: item.url,
|
url: item.url,
|
||||||
zuluVersion: convertVersionToSemver(item.zulu_version)
|
zuluVersion: this.convertVersionToSemver(item.zulu_version)
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -53,12 +42,9 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
} as JavaDownloadRelease;
|
} as JavaDownloadRelease;
|
||||||
});
|
});
|
||||||
|
|
||||||
const resolvedFullVersion =
|
const resolvedFullVersion = satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
||||||
satisfiedVersions.length > 0 ? satisfiedVersions[0] : null;
|
|
||||||
if (!resolvedFullVersion) {
|
if (!resolvedFullVersion) {
|
||||||
const availableOptions = availableVersions
|
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||||
.map(item => item.version)
|
|
||||||
.join(', ');
|
|
||||||
const availableOptionsMessage = availableOptions
|
const availableOptionsMessage = availableOptions
|
||||||
? `\nAvailable versions: ${availableOptions}`
|
? `\nAvailable versions: ${availableOptions}`
|
||||||
: '';
|
: '';
|
||||||
@@ -70,18 +56,18 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
return resolvedFullVersion;
|
return resolvedFullVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async downloadTool(
|
protected async downloadTool(javaRelease: JavaDownloadRelease): Promise<JavaInstallerResults> {
|
||||||
javaRelease: JavaDownloadRelease
|
let extractedJavaPath: string;
|
||||||
): Promise<JavaInstallerResults> {
|
|
||||||
core.info(
|
core.info(
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
);
|
);
|
||||||
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
const javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
let extension = getDownloadArchiveExtension();
|
||||||
|
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
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);
|
||||||
@@ -93,11 +79,11 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
this.architecture
|
this.architecture
|
||||||
);
|
);
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
return { version: javaRelease.version, path: javaPath };
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getAvailableVersions(): Promise<IZuluVersions[]> {
|
private async getAvailableVersions(): Promise<IZuluVersions[]> {
|
||||||
const {arch, hw_bitness, abi} = this.getArchitectureOptions();
|
const { arch, hw_bitness, abi } = this.getArchitectureOptions();
|
||||||
const [bundleType, features] = this.packageType.split('+');
|
const [bundleType, features] = this.packageType.split('+');
|
||||||
const platform = this.getPlatformOption();
|
const platform = this.getPlatformOption();
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
@@ -105,9 +91,8 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
const releaseStatus = this.stable ? 'ga' : 'ea';
|
const releaseStatus = this.stable ? 'ga' : 'ea';
|
||||||
|
|
||||||
if (core.isDebug()) {
|
if (core.isDebug()) {
|
||||||
console.time('Retrieving available versions for Zulu took'); // eslint-disable-line no-console
|
console.time('azul-retrieve-available-versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
const requestArguments = [
|
const requestArguments = [
|
||||||
`os=${platform}`,
|
`os=${platform}`,
|
||||||
`ext=${extension}`,
|
`ext=${extension}`,
|
||||||
@@ -123,20 +108,18 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
.join('&');
|
.join('&');
|
||||||
|
|
||||||
const availableVersionsUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?${requestArguments}`;
|
const availableVersionsUrl = `https://api.azul.com/zulu/download/community/v1.0/bundles/?${requestArguments}`;
|
||||||
|
if (core.isDebug()) {
|
||||||
core.debug(`Gathering available versions from '${availableVersionsUrl}'`);
|
core.debug(`Gathering available versions from '${availableVersionsUrl}'`);
|
||||||
|
}
|
||||||
|
|
||||||
const availableVersions =
|
const availableVersions =
|
||||||
(await this.http.getJson<Array<IZuluVersions>>(availableVersionsUrl))
|
(await this.http.getJson<Array<IZuluVersions>>(availableVersionsUrl)).result ?? [];
|
||||||
.result ?? [];
|
|
||||||
|
|
||||||
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 Zulu took'); // eslint-disable-line no-console
|
console.timeEnd('azul-retrieve-available-versions');
|
||||||
core.debug(`Available versions: [${availableVersions.length}]`);
|
console.log(`Available versions: [${availableVersions.length}]`);
|
||||||
core.debug(
|
console.log(availableVersions.map(item => item.jdk_version.join('.')).join(', '));
|
||||||
availableVersions.map(item => item.jdk_version.join('.')).join(', ')
|
|
||||||
);
|
|
||||||
core.endGroup();
|
core.endGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,14 +134,14 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
switch (arch) {
|
switch (arch) {
|
||||||
case 'x64':
|
case 'x64':
|
||||||
return {arch: 'x86', hw_bitness: '64', abi: ''};
|
return { arch: 'x86', hw_bitness: '64', abi: '' };
|
||||||
case 'x86':
|
case 'x86':
|
||||||
return {arch: 'x86', hw_bitness: '32', abi: ''};
|
return { arch: 'x86', hw_bitness: '32', abi: '' };
|
||||||
case 'aarch64':
|
case 'aarch64':
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
return {arch: 'arm', hw_bitness: '64', abi: ''};
|
return { arch: 'arm', hw_bitness: '64', abi: '' };
|
||||||
default:
|
default:
|
||||||
return {arch: arch, hw_bitness: '', abi: ''};
|
return { arch: arch, hw_bitness: '', abi: '' };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,4 +156,15 @@ export class ZuluDistribution extends JavaBase {
|
|||||||
return process.platform;
|
return process.platform;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Azul API returns jdk_version as array of digits like [11, 0, 2, 1]
|
||||||
|
private convertVersionToSemver(version_array: number[]) {
|
||||||
|
const mainVersion = version_array.slice(0, 3).join('.');
|
||||||
|
if (version_array.length > 3) {
|
||||||
|
// intentionally ignore more than 4 numbers because it is invalid semver
|
||||||
|
return `${mainVersion}+${version_array[3]}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return mainVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
20
src/gpg.ts
20
src/gpg.ts
@@ -3,7 +3,7 @@ import * as path from 'path';
|
|||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import * as exec from '@actions/exec';
|
import * as exec from '@actions/exec';
|
||||||
import * as util from './util';
|
import * as util from './util';
|
||||||
import {ExecOptions} from '@actions/exec/lib/interfaces';
|
import { ExecOptions } from '@actions/exec/lib/interfaces';
|
||||||
|
|
||||||
export const PRIVATE_KEY_FILE = path.join(util.getTempDir(), 'private-key.asc');
|
export const PRIVATE_KEY_FILE = path.join(util.getTempDir(), 'private-key.asc');
|
||||||
|
|
||||||
@@ -28,13 +28,7 @@ export async function importKey(privateKey: string) {
|
|||||||
|
|
||||||
await exec.exec(
|
await exec.exec(
|
||||||
'gpg',
|
'gpg',
|
||||||
[
|
['--batch', '--import-options', 'import-show', '--import', PRIVATE_KEY_FILE],
|
||||||
'--batch',
|
|
||||||
'--import-options',
|
|
||||||
'import-show',
|
|
||||||
'--import',
|
|
||||||
PRIVATE_KEY_FILE
|
|
||||||
],
|
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -45,11 +39,7 @@ export async function importKey(privateKey: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function deleteKey(keyFingerprint: string) {
|
export async function deleteKey(keyFingerprint: string) {
|
||||||
await exec.exec(
|
await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], {
|
||||||
'gpg',
|
silent: true
|
||||||
['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint],
|
});
|
||||||
{
|
|
||||||
silent: true
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,18 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as auth from './auth';
|
import * as auth from './auth';
|
||||||
import {
|
import { getBooleanInput, isCacheFeatureAvailable, getVersionFromFileContent } from './util';
|
||||||
getBooleanInput,
|
|
||||||
isCacheFeatureAvailable,
|
|
||||||
getVersionFromFileContent
|
|
||||||
} from './util';
|
|
||||||
import * as toolchains from './toolchains';
|
import * as toolchains from './toolchains';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
import {restore} from './cache';
|
import { restore } from './cache';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import {getJavaDistribution} from './distributions/distribution-factory';
|
import { getJavaDistribution } from './distributions/distribution-factory';
|
||||||
import {JavaInstallerOptions} from './distributions/base-models';
|
import { JavaInstallerOptions } from './distributions/base-models';
|
||||||
|
|
||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
const versions = core.getMultilineInput(constants.INPUT_JAVA_VERSION);
|
const versions = core.getMultilineInput(constants.INPUT_JAVA_VERSION);
|
||||||
const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, {
|
const distributionName = core.getInput(constants.INPUT_DISTRIBUTION, { required: true });
|
||||||
required: true
|
|
||||||
});
|
|
||||||
const versionFile = core.getInput(constants.INPUT_JAVA_VERSION_FILE);
|
const versionFile = core.getInput(constants.INPUT_JAVA_VERSION_FILE);
|
||||||
const architecture = core.getInput(constants.INPUT_ARCHITECTURE);
|
const architecture = core.getInput(constants.INPUT_ARCHITECTURE);
|
||||||
const packageType = core.getInput(constants.INPUT_JAVA_PACKAGE);
|
const packageType = core.getInput(constants.INPUT_JAVA_PACKAGE);
|
||||||
@@ -47,18 +41,17 @@ async function run() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (!versions.length) {
|
if (!versions.length) {
|
||||||
core.debug(
|
core.debug('java-version input is empty, looking for java-version-file input');
|
||||||
'java-version input is empty, looking for java-version-file input'
|
const content = fs
|
||||||
);
|
.readFileSync(versionFile)
|
||||||
const content = fs.readFileSync(versionFile).toString().trim();
|
.toString()
|
||||||
|
.trim();
|
||||||
|
|
||||||
const version = getVersionFromFileContent(content, distributionName);
|
const version = getVersionFromFileContent(content, distributionName);
|
||||||
core.debug(`Parsed version from file '${version}'`);
|
core.debug(`Parsed version from file '${version}'`);
|
||||||
|
|
||||||
if (!version) {
|
if (!version) {
|
||||||
throw new Error(
|
throw new Error(`No supported version was found in file ${versionFile}`);
|
||||||
`No supported version was found in file ${versionFile}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await installVersion(version, installerInputsOptions);
|
await installVersion(version, installerInputsOptions);
|
||||||
@@ -82,11 +75,7 @@ async function run() {
|
|||||||
|
|
||||||
run();
|
run();
|
||||||
|
|
||||||
async function installVersion(
|
async function installVersion(version: string, options: installerInputsOptions, toolchainId = 0) {
|
||||||
version: string,
|
|
||||||
options: installerInputsOptions,
|
|
||||||
toolchainId = 0
|
|
||||||
) {
|
|
||||||
const {
|
const {
|
||||||
distributionName,
|
distributionName,
|
||||||
jdkFile,
|
jdkFile,
|
||||||
@@ -103,15 +92,9 @@ async function installVersion(
|
|||||||
version
|
version
|
||||||
};
|
};
|
||||||
|
|
||||||
const distribution = getJavaDistribution(
|
const distribution = getJavaDistribution(distributionName, installerOptions, jdkFile);
|
||||||
distributionName,
|
|
||||||
installerOptions,
|
|
||||||
jdkFile
|
|
||||||
);
|
|
||||||
if (!distribution) {
|
if (!distribution) {
|
||||||
throw new Error(
|
throw new Error(`No supported distribution was found for input ${distributionName}`);
|
||||||
`No supported distribution was found for input ${distributionName}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = await distribution.setupJava();
|
const result = await distribution.setupJava();
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import * as core from '@actions/core';
|
|||||||
import * as io from '@actions/io';
|
import * as io from '@actions/io';
|
||||||
import * as constants from './constants';
|
import * as constants from './constants';
|
||||||
|
|
||||||
import {getBooleanInput} from './util';
|
import { getBooleanInput } from './util';
|
||||||
import {create as xmlCreate} from 'xmlbuilder2';
|
import { create as xmlCreate } from 'xmlbuilder2';
|
||||||
|
|
||||||
interface JdkInfo {
|
interface JdkInfo {
|
||||||
version: string;
|
version: string;
|
||||||
@@ -21,16 +21,11 @@ export async function configureToolchains(
|
|||||||
jdkHome: string,
|
jdkHome: string,
|
||||||
toolchainId?: string
|
toolchainId?: string
|
||||||
) {
|
) {
|
||||||
const vendor =
|
const vendor = core.getInput(constants.INPUT_MVN_TOOLCHAIN_VENDOR) || distributionName;
|
||||||
core.getInput(constants.INPUT_MVN_TOOLCHAIN_VENDOR) || distributionName;
|
|
||||||
const id = toolchainId || `${vendor}_${version}`;
|
const id = toolchainId || `${vendor}_${version}`;
|
||||||
const settingsDirectory =
|
const settingsDirectory =
|
||||||
core.getInput(constants.INPUT_SETTINGS_PATH) ||
|
core.getInput(constants.INPUT_SETTINGS_PATH) || path.join(os.homedir(), constants.M2_DIR);
|
||||||
path.join(os.homedir(), constants.M2_DIR);
|
const overwriteSettings = getBooleanInput(constants.INPUT_OVERWRITE_SETTINGS, true);
|
||||||
const overwriteSettings = getBooleanInput(
|
|
||||||
constants.INPUT_OVERWRITE_SETTINGS,
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
await createToolchainsSettings({
|
await createToolchainsSettings({
|
||||||
jdkInfo: {
|
jdkInfo: {
|
||||||
@@ -59,9 +54,7 @@ export async function createToolchainsSettings({
|
|||||||
// when an alternate m2 location is specified use only that location (no .m2 directory)
|
// when an alternate m2 location is specified use only that location (no .m2 directory)
|
||||||
// otherwise use the home/.m2/ path
|
// otherwise use the home/.m2/ path
|
||||||
await io.mkdirP(settingsDirectory);
|
await io.mkdirP(settingsDirectory);
|
||||||
const originalToolchains = await readExistingToolchainsFile(
|
const originalToolchains = await readExistingToolchainsFile(settingsDirectory);
|
||||||
settingsDirectory
|
|
||||||
);
|
|
||||||
const updatedToolchains = generateToolchainDefinition(
|
const updatedToolchains = generateToolchainDefinition(
|
||||||
originalToolchains,
|
originalToolchains,
|
||||||
jdkInfo.version,
|
jdkInfo.version,
|
||||||
@@ -69,11 +62,7 @@ export async function createToolchainsSettings({
|
|||||||
jdkInfo.id,
|
jdkInfo.id,
|
||||||
jdkInfo.jdkHome
|
jdkInfo.jdkHome
|
||||||
);
|
);
|
||||||
await writeToolchainsFileToDisk(
|
await writeToolchainsFileToDisk(settingsDirectory, updatedToolchains, overwriteSettings);
|
||||||
settingsDirectory,
|
|
||||||
updatedToolchains,
|
|
||||||
overwriteSettings
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// only exported for testing purposes
|
// only exported for testing purposes
|
||||||
@@ -104,10 +93,10 @@ export function generateToolchainDefinition(
|
|||||||
} else
|
} else
|
||||||
xmlObj = xmlCreate({
|
xmlObj = xmlCreate({
|
||||||
toolchains: {
|
toolchains: {
|
||||||
'@xmlns': 'http://maven.apache.org/TOOLCHAINS/1.1.0',
|
'@xmlns': 'https://maven.apache.org/TOOLCHAINS/1.1.0',
|
||||||
'@xmlns:xsi': 'http://www.w3.org/2001/XMLSchema-instance',
|
'@xmlns:xsi': 'https://www.w3.org/2001/XMLSchema-instance',
|
||||||
'@xsi:schemaLocation':
|
'@xsi:schemaLocation':
|
||||||
'http://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd',
|
'https://maven.apache.org/TOOLCHAINS/1.1.0 https://maven.apache.org/xsd/toolchains-1.1.0.xsd',
|
||||||
toolchain: [
|
toolchain: [
|
||||||
{
|
{
|
||||||
type: 'jdk',
|
type: 'jdk',
|
||||||
|
|||||||
55
src/util.ts
55
src/util.ts
@@ -6,19 +6,16 @@ import * as cache from '@actions/cache';
|
|||||||
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';
|
||||||
import {INPUT_JOB_STATUS, DISTRIBUTIONS_ONLY_MAJOR_VERSION} from './constants';
|
import { INPUT_JOB_STATUS, DISTRIBUTIONS_ONLY_MAJOR_VERSION } from './constants';
|
||||||
import {OutgoingHttpHeaders} from 'http';
|
|
||||||
|
|
||||||
export function getTempDir() {
|
export function getTempDir() {
|
||||||
const tempDirectory = process.env['RUNNER_TEMP'] || os.tmpdir();
|
let tempDirectory = process.env['RUNNER_TEMP'] || os.tmpdir();
|
||||||
|
|
||||||
return tempDirectory;
|
return tempDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getBooleanInput(inputName: string, defaultValue = false) {
|
export function getBooleanInput(inputName: string, defaultValue: boolean = false) {
|
||||||
return (
|
return (core.getInput(inputName) || String(defaultValue)).toUpperCase() === 'TRUE';
|
||||||
(core.getInput(inputName) || String(defaultValue)).toUpperCase() === 'TRUE'
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getVersionFromToolcachePath(toolPath: string) {
|
export function getVersionFromToolcachePath(toolPath: string) {
|
||||||
@@ -31,9 +28,7 @@ export function getVersionFromToolcachePath(toolPath: string) {
|
|||||||
|
|
||||||
export async function extractJdkFile(toolPath: string, extension?: string) {
|
export async function extractJdkFile(toolPath: string, extension?: string) {
|
||||||
if (!extension) {
|
if (!extension) {
|
||||||
extension = toolPath.endsWith('.tar.gz')
|
extension = toolPath.endsWith('.tar.gz') ? 'tar.gz' : path.extname(toolPath);
|
||||||
? 'tar.gz'
|
|
||||||
: path.extname(toolPath);
|
|
||||||
if (extension.startsWith('.')) {
|
if (extension.startsWith('.')) {
|
||||||
extension = extension.substring(1);
|
extension = extension.substring(1);
|
||||||
}
|
}
|
||||||
@@ -68,11 +63,7 @@ export function isVersionSatisfies(range: string, version: string): boolean {
|
|||||||
return semver.satisfies(version, range);
|
return semver.satisfies(version, range);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getToolcachePath(
|
export function getToolcachePath(toolName: string, version: string, architecture: string) {
|
||||||
toolName: string,
|
|
||||||
version: string,
|
|
||||||
architecture: string
|
|
||||||
) {
|
|
||||||
const toolcacheRoot = process.env['RUNNER_TOOL_CACHE'] ?? '';
|
const toolcacheRoot = process.env['RUNNER_TOOL_CACHE'] ?? '';
|
||||||
const fullPath = path.join(toolcacheRoot, toolName, version, architecture);
|
const fullPath = path.join(toolcacheRoot, toolName, version, architecture);
|
||||||
if (fs.existsSync(fullPath)) {
|
if (fs.existsSync(fullPath)) {
|
||||||
@@ -89,9 +80,7 @@ export function isJobStatusSuccess() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function isGhes(): boolean {
|
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';
|
return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,9 +96,7 @@ export function isCacheFeatureAvailable(): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.warning(
|
core.warning('The runner was not able to contact the cache service. Caching will be skipped');
|
||||||
'The runner was not able to contact the cache service. Caching will be skipped'
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +104,7 @@ export function getVersionFromFileContent(
|
|||||||
content: string,
|
content: string,
|
||||||
distributionName: string
|
distributionName: string
|
||||||
): string | null {
|
): string | null {
|
||||||
const javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
const javaVersionRegExp = /(?<version>(?<=(^|\s|\-))(\d+\S*))(\s|$)/;
|
||||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
||||||
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
||||||
: '';
|
: '';
|
||||||
@@ -130,9 +117,7 @@ export function getVersionFromFileContent(
|
|||||||
const tentativeVersion = avoidOldNotation(fileContent);
|
const tentativeVersion = avoidOldNotation(fileContent);
|
||||||
const rawVersion = tentativeVersion.split('-')[0];
|
const rawVersion = tentativeVersion.split('-')[0];
|
||||||
|
|
||||||
let version = semver.validRange(rawVersion)
|
let version = semver.validRange(rawVersion) ? tentativeVersion : semver.coerce(tentativeVersion);
|
||||||
? tentativeVersion
|
|
||||||
: semver.coerce(tentativeVersion);
|
|
||||||
|
|
||||||
core.debug(`Range version from file is '${version}'`);
|
core.debug(`Range version from file is '${version}'`);
|
||||||
|
|
||||||
@@ -152,23 +137,3 @@ export function getVersionFromFileContent(
|
|||||||
function avoidOldNotation(content: string): string {
|
function avoidOldNotation(content: string): string {
|
||||||
return content.startsWith('1.') ? content.substring(2) : content;
|
return content.startsWith('1.') ? content.substring(2) : content;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function convertVersionToSemver(version: number[] | string) {
|
|
||||||
// Some distributions may use semver-like notation (12.10.2.1, 12.10.2.1.1)
|
|
||||||
const versionArray = Array.isArray(version) ? version : version.split('.');
|
|
||||||
const mainVersion = versionArray.slice(0, 3).join('.');
|
|
||||||
if (versionArray.length > 3) {
|
|
||||||
return `${mainVersion}+${versionArray.slice(3).join('.')}`;
|
|
||||||
}
|
|
||||||
return mainVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
|
|
||||||
const token = core.getInput('token');
|
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
|
||||||
const headers: OutgoingHttpHeaders = {
|
|
||||||
authorization: auth,
|
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
|
||||||
};
|
|
||||||
return headers;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
||||||
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
||||||
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
||||||
"newLine": "lf", /* Specify the end of line sequence to be used when emitting files: ‘CRLF’ (dos) or ‘LF’ (unix). */
|
|
||||||
|
|
||||||
/* Strict Type-Checking Options */
|
/* Strict Type-Checking Options */
|
||||||
"strict": true, /* Enable all strict type-checking options. */
|
"strict": true, /* Enable all strict type-checking options. */
|
||||||
|
|||||||
7
yaml-lint-config.yml
Normal file
7
yaml-lint-config.yml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
extends: default
|
||||||
|
|
||||||
|
rules:
|
||||||
|
# 100 chars should be enough, but don't fail if a line is longer
|
||||||
|
line-length:
|
||||||
|
max: 100
|
||||||
|
level: warning
|
||||||
Reference in New Issue
Block a user