mirror of
https://github.com/actions/setup-java.git
synced 2025-03-13 09:37:03 +00:00
Merge remote-tracking branch 'origin/main' into update-ncc-2nd
This commit is contained in:
commit
4a628562bd
40 changed files with 26288 additions and 35790 deletions
6
.github/workflows/build.yml
vendored
Executable file → Normal file
6
.github/workflows/build.yml
vendored
Executable file → Normal file
|
@ -24,10 +24,8 @@ jobs:
|
|||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 12.x
|
||||
cache: npm
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm run format-check
|
||||
- run: npm test
|
||||
- name: Verify no unstaged changes
|
||||
if: runner.os != 'windows'
|
||||
run: bash __tests__/verify-no-unstaged-changes.sh
|
||||
- run: npm test
|
51
.github/workflows/check-dist.yml
vendored
Normal file
51
.github/workflows/check-dist.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
# `dist/index.js` is a special file in Actions.
|
||||
# When you reference an action with `uses:` in a workflow,
|
||||
# `index.js` is the code that will run.
|
||||
# For our project, we generate this file through a build process from other source files.
|
||||
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
|
||||
name: Check dist/
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
check-dist:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Set Node.js 12.x
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Rebuild the dist/ directory
|
||||
run: npm run build
|
||||
|
||||
- name: Compare the expected and actual dist/ directories
|
||||
run: |
|
||||
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||
echo "Detected uncommitted changes after build. See status below:"
|
||||
git diff
|
||||
exit 1
|
||||
fi
|
||||
id: diff
|
||||
|
||||
# If index.js was different than expected, upload the expected version as an artifact
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
32
.github/workflows/e2e-versions.yml
vendored
32
.github/workflows/e2e-versions.yml
vendored
|
@ -20,8 +20,11 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu'] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||
distribution: ['temurin', 'adopt', 'adopt-openj9', 'zulu', 'liberica', 'microsoft' ] # internally 'adopt-hotspot' is the same as 'adopt'
|
||||
version: ['8', '11', '16']
|
||||
exclude:
|
||||
- distribution: microsoft
|
||||
version: 8
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
@ -43,7 +46,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'zulu']
|
||||
distribution: ['temurin', 'zulu', 'liberica']
|
||||
version:
|
||||
- '11.0'
|
||||
- '8.0.302'
|
||||
|
@ -69,7 +72,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'zulu']
|
||||
distribution: ['temurin', 'zulu', 'liberica']
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
@ -136,7 +139,7 @@ jobs:
|
|||
fail-fast: false
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
distribution: ['temurin', 'zulu']
|
||||
distribution: ['temurin', 'zulu', 'liberica']
|
||||
java-package: ['jre']
|
||||
version: ['16.0']
|
||||
include:
|
||||
|
@ -148,6 +151,14 @@ jobs:
|
|||
java-package: jdk+fx
|
||||
version: '8.0.242'
|
||||
os: ubuntu-latest
|
||||
- distribution: 'liberica'
|
||||
java-package: jdk+fx
|
||||
version: '8'
|
||||
os: ubuntu-latest
|
||||
- distribution: 'liberica'
|
||||
java-package: jre+fx
|
||||
version: '11'
|
||||
os: ubuntu-latest
|
||||
exclude:
|
||||
# Eclipse Temurin currently doesn't publish JREs, only JDKs
|
||||
- distribution: 'temurin'
|
||||
|
@ -166,16 +177,17 @@ jobs:
|
|||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||
shell: bash
|
||||
|
||||
setup-java-custom-architecture:
|
||||
name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-x86) - ${{ matrix.os }}
|
||||
# Only Liberica and Zulu provide x86
|
||||
setup-java-x86:
|
||||
name: ${{ matrix.distribution }} ${{ matrix.version }} (jdk-${{ matrix.architecture }}) - ${{ matrix.os }}
|
||||
needs: setup-java-major-minor-versions
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
# Only Zulu provides x86 arch for now and only for windows / ubuntu
|
||||
# x86 is not supported on macOS
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
distribution: ['zulu']
|
||||
distribution: ['liberica', 'zulu']
|
||||
version: ['11']
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -186,7 +198,9 @@ jobs:
|
|||
with:
|
||||
distribution: ${{ matrix.distribution }}
|
||||
java-version: ${{ matrix.version }}
|
||||
architecture: x86
|
||||
architecture: 'x86'
|
||||
- name: Verify Java
|
||||
run: bash __tests__/verify-java.sh "${{ matrix.version }}" "${{ steps.setup-java.outputs.path }}"
|
||||
shell: bash
|
||||
|
||||
# Only Microsoft provides AArch64. However, GitHub-hosted runners do not support this architecture.
|
13
.github/workflows/licensed.yml
vendored
13
.github/workflows/licensed.yml
vendored
|
@ -1,8 +1,13 @@
|
|||
name: Licensed
|
||||
|
||||
on:
|
||||
push: {branches: main}
|
||||
pull_request: {branches: main}
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
|
@ -14,7 +19,7 @@ jobs:
|
|||
- name: Install licensed
|
||||
run: |
|
||||
cd $RUNNER_TEMP
|
||||
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
|
||||
curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz
|
||||
sudo tar -xzf licensed.tar.gz
|
||||
sudo mv licensed /usr/local/bin/licensed
|
||||
- run: licensed status
|
||||
- run: licensed status
|
||||
|
|
2
.licenses/npm/@actions/cache.dep.yml
generated
2
.licenses/npm/@actions/cache.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/cache"
|
||||
version: 1.0.7
|
||||
version: 1.0.8
|
||||
type: npm
|
||||
summary: Actions cache lib
|
||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
|
||||
|
|
2
.licenses/npm/@actions/http-client.dep.yml
generated
2
.licenses/npm/@actions/http-client.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@actions/http-client"
|
||||
version: 1.0.9
|
||||
version: 1.0.11
|
||||
type: npm
|
||||
summary: Actions Http Client
|
||||
homepage: https://github.com/actions/http-client#readme
|
||||
|
|
4
.licenses/npm/@azure/core-http.dep.yml
generated
4
.licenses/npm/@azure/core-http.dep.yml
generated
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
name: "@azure/core-http"
|
||||
version: 1.2.6
|
||||
version: 2.2.2
|
||||
type: npm
|
||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||
libraries generated using AutoRest
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-http/README.md
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-http/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
7
.licenses/npm/@azure/core-lro.dep.yml
generated
7
.licenses/npm/@azure/core-lro.dep.yml
generated
|
@ -1,9 +1,10 @@
|
|||
---
|
||||
name: "@azure/core-lro"
|
||||
version: 1.0.5
|
||||
version: 2.2.1
|
||||
type: npm
|
||||
summary: LRO Polling strtegy for the Azure SDK in TypeScript
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-lro/README.md
|
||||
summary: Isomorphic client library for supporting long-running operations in node.js
|
||||
and browser.
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
4
.licenses/npm/@azure/core-paging.dep.yml
generated
4
.licenses/npm/@azure/core-paging.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: "@azure/core-paging"
|
||||
version: 1.1.3
|
||||
version: 1.2.0
|
||||
type: npm
|
||||
summary: Core types for paging async iterable iterators
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-paging/README.md
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
4
.licenses/npm/@azure/core-tracing.dep.yml
generated
4
.licenses/npm/@azure/core-tracing.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: "@azure/core-tracing"
|
||||
version: 1.0.0-preview.11
|
||||
version: 1.0.0-preview.13
|
||||
type: npm
|
||||
summary: Provides low-level interfaces and helper methods for tracing in Azure SDK
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/core/core-tracing/README.md
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-tracing/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
4
.licenses/npm/@azure/logger.dep.yml
generated
4
.licenses/npm/@azure/logger.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: "@azure/logger"
|
||||
version: 1.0.2
|
||||
version: 1.0.3
|
||||
type: npm
|
||||
summary: Microsoft Azure SDK for JavaScript - Logger
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/logger/README.md
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger/README.md
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
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"
|
||||
version: 2.5.2
|
||||
version: 2.6.0
|
||||
type: npm
|
||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
|
||||
libraries generated using AutoRest
|
||||
|
|
4
.licenses/npm/@azure/storage-blob.dep.yml
generated
4
.licenses/npm/@azure/storage-blob.dep.yml
generated
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
name: "@azure/storage-blob"
|
||||
version: 12.6.0
|
||||
version: 12.8.0
|
||||
type: npm
|
||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/master/sdk/storage/storage-blob/
|
||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
|
|
226
.licenses/npm/@opencensus/web-types.dep.yml
generated
226
.licenses/npm/@opencensus/web-types.dep.yml
generated
|
@ -1,226 +0,0 @@
|
|||
---
|
||||
name: "@opencensus/web-types"
|
||||
version: 0.0.7
|
||||
type: npm
|
||||
summary: OpenCensus Web types is a slightly-patched copy of the `types.ts` files from
|
||||
`@opencensus/core` so that they can be easily imported in web-specific packages.
|
||||
homepage: https://github.com/census-instrumentation/opencensus-web#readme
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
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.
|
||||
- sources: README.md
|
||||
text: |-
|
||||
Apache 2.0 - See [LICENSE][license-url] for more information.
|
||||
|
||||
[gitter-image]: https://badges.gitter.im/census-instrumentation/lobby.svg
|
||||
[gitter-url]: https://gitter.im/census-instrumentation/lobby
|
||||
[opencensus-core-url]: https://github.com/census-instrumentation/opencensus-node/tree/master/packages/opencensus-core
|
||||
[oc-web-readme-url]: https://github.com/census-instrumentation/opencensus-web/blob/master/README.md
|
||||
[license-url]: https://github.com/census-instrumentation/opencensus-web/blob/master/packages/opencensus-web-instrumentation-perf/LICENSE
|
||||
[rules-typescript-url]: https://github.com/bazelbuild/rules_typescript
|
||||
[tsickle-url]: https://github.com/angular/tsickle
|
||||
[closure-url]: https://github.com/google/closure-compiler
|
||||
notices: []
|
7
.licenses/npm/@opentelemetry/api.dep.yml
generated
7
.licenses/npm/@opentelemetry/api.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: "@opentelemetry/api"
|
||||
version: 1.0.0-rc.0
|
||||
version: 1.0.3
|
||||
type: npm
|
||||
summary: Public API for OpenTelemetry
|
||||
homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
|
||||
|
@ -218,13 +218,12 @@ licenses:
|
|||
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
|
||||
[license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
|
||||
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
|
||||
[dependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-api/status.svg
|
||||
[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg
|
||||
[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api
|
||||
[devDependencies-image]: https://david-dm.org/open-telemetry/opentelemetry-js-api/dev-status.svg
|
||||
[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg?type=dev
|
||||
[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev
|
||||
[npm-url]: https://www.npmjs.com/package/@opentelemetry/api
|
||||
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
|
||||
|
||||
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md
|
||||
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/sdk-registration.md
|
||||
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"
|
||||
version: 2.5.11
|
||||
version: 2.5.12
|
||||
type: npm
|
||||
summary: TypeScript definitions for node-fetch
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
|
||||
|
|
6
.licenses/npm/@types/tunnel.dep.yml
generated
6
.licenses/npm/@types/tunnel.dep.yml
generated
|
@ -1,16 +1,16 @@
|
|||
---
|
||||
name: "@types/tunnel"
|
||||
version: 0.0.1
|
||||
version: 0.0.3
|
||||
type: npm
|
||||
summary: TypeScript definitions for tunnel
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped#readme
|
||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/tunnel
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE
|
||||
text: |2
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
33
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
33
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
|
@ -0,0 +1,33 @@
|
|||
---
|
||||
name: form-data
|
||||
version: 4.0.0
|
||||
type: npm
|
||||
summary: A library to create readable "multipart/form-data" streams. Can be used to
|
||||
submit forms and file uploads to other web applications.
|
||||
homepage: https://github.com/form-data/form-data#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: License
|
||||
text: |
|
||||
Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and 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: Form-Data is released under the [MIT](License) license.
|
||||
notices: []
|
2
.licenses/npm/node-fetch.dep.yml
generated
2
.licenses/npm/node-fetch.dep.yml
generated
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: node-fetch
|
||||
version: 2.6.1
|
||||
version: 2.6.6
|
||||
type: npm
|
||||
summary: A light-weight module that brings window.fetch to node.js
|
||||
homepage: https://github.com/bitinn/node-fetch
|
||||
|
|
30
.licenses/npm/tr46.dep.yml
generated
Normal file
30
.licenses/npm/tr46.dep.yml
generated
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
name: tr46
|
||||
version: 0.0.3
|
||||
type: npm
|
||||
summary: An implementation of the Unicode TR46 spec
|
||||
homepage: https://github.com/Sebmaster/tr46.js#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: Auto-generated MIT license text
|
||||
text: |
|
||||
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: []
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
name: tslib
|
||||
version: 2.3.0
|
||||
version: 2.3.1
|
||||
type: npm
|
||||
summary: Runtime library for TypeScript helper functions
|
||||
homepage: https://www.typescriptlang.org/
|
23
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
23
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
name: webidl-conversions
|
||||
version: 3.0.1
|
||||
type: npm
|
||||
summary: Implements the WebIDL algorithms for converting to and from JavaScript values
|
||||
homepage: https://github.com/jsdom/webidl-conversions#readme
|
||||
license: bsd-2-clause
|
||||
licenses:
|
||||
- sources: LICENSE.md
|
||||
text: |
|
||||
# The BSD 2-Clause License
|
||||
|
||||
Copyright (c) 2014, Domenic Denicola
|
||||
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.
|
||||
|
||||
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: []
|
32
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
32
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
|
@ -0,0 +1,32 @@
|
|||
---
|
||||
name: whatwg-url
|
||||
version: 5.0.0
|
||||
type: npm
|
||||
summary: An implementation of the WHATWG URL Standard's URL API and parsing machinery
|
||||
homepage: https://github.com/jsdom/whatwg-url#readme
|
||||
license: mit
|
||||
licenses:
|
||||
- sources: LICENSE.txt
|
||||
text: |
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015–2016 Sebastian Mayr
|
||||
|
||||
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: []
|
19
README.md
19
README.md
|
@ -29,7 +29,7 @@ steps:
|
|||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'temurin' # See 'Supported distributions' for available options
|
||||
java-version: '11'
|
||||
java-version: '17'
|
||||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
|
@ -46,8 +46,8 @@ steps:
|
|||
|
||||
#### Supported version syntax
|
||||
The `java-version` input supports an exact version or a version range using [SemVer](https://semver.org/) notation:
|
||||
- major versions: `8`, `11`, `16`
|
||||
- more specific versions: `11.0`, `11.0.4`, `8.0.232`, `8.0.282+8`
|
||||
- major versions: `8`, `11`, `16`, `17`
|
||||
- more specific versions: `17.0`, `11.0`, `11.0.4`, `8.0.232`, `8.0.282+8`
|
||||
- early access (EA) versions: `15-ea`, `15.0.0-ea`, `15.0.0-ea.2`, `15.0.0+2-ea`
|
||||
|
||||
#### Supported distributions
|
||||
|
@ -57,14 +57,20 @@ Currently, the following distributions are supported:
|
|||
| `temurin` | Eclipse Temurin | [Link](https://adoptium.net/) | [Link](https://adoptium.net/about.html)
|
||||
| `zulu` | Zulu OpenJDK | [Link](https://www.azul.com/downloads/zulu-community/?package=jdk) | [Link](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/) |
|
||||
| `adopt` or `adopt-hotspot` | Adopt OpenJDK Hotspot | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
|
||||
| `adopt-openj9` | Adopt OpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html)
|
||||
| `adopt-openj9` | Adopt OpenJDK OpenJ9 | [Link](https://adoptopenjdk.net/) | [Link](https://adoptopenjdk.net/about.html) |
|
||||
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) | [Link](https://bell-sw.com/liberica_eula/) |
|
||||
| `microsoft` | Microsoft Build of OpenJDK | [Link](https://www.microsoft.com/openjdk) | [Link](https://docs.microsoft.com/java/openjdk/faq)
|
||||
|
||||
**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:** Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from `adopt` to `temurin` to keep receiving software and security updates. See more details in the [Good-bye AdoptOpenJDK post](https://blog.adoptopenjdk.net/2021/08/goodbye-adoptopenjdk-hello-adoptium/).
|
||||
|
||||
### Caching packages dependencies
|
||||
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 and maven. The cache input is optional, and caching is turned off by default.
|
||||
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 and maven. 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`
|
||||
- maven: `**/pom.xml`
|
||||
|
||||
The cache input is optional, and caching is turned off by default.
|
||||
|
||||
#### Caching gradle dependencies
|
||||
```yaml
|
||||
|
@ -75,7 +81,7 @@ steps:
|
|||
distribution: 'temurin'
|
||||
java-version: '11'
|
||||
cache: 'gradle'
|
||||
- run: ./gradlew build
|
||||
- run: ./gradlew build --no-daemon
|
||||
```
|
||||
|
||||
#### Caching maven dependencies
|
||||
|
@ -134,6 +140,7 @@ jobs:
|
|||
- [Eclipse Temurin](docs/advanced-usage.md#Eclipse-Temurin)
|
||||
- [Adopt](docs/advanced-usage.md#Adopt)
|
||||
- [Zulu](docs/advanced-usage.md#Zulu)
|
||||
- [Liberica](docs/advanced-usage.md#Liberica)
|
||||
- [Installing custom Java package type](docs/advanced-usage.md#Installing-custom-Java-package-type)
|
||||
- [Installing custom Java architecture](docs/advanced-usage.md#Installing-custom-Java-architecture)
|
||||
- [Installing custom Java distribution from local file](docs/advanced-usage.md#Installing-Java-from-local-file)
|
||||
|
|
434
__tests__/data/liberica.json
Normal file
434
__tests__/data/liberica.json
Normal file
|
@ -0,0 +1,434 @@
|
|||
[
|
||||
{
|
||||
"buildVersion": 36,
|
||||
"updateVersion": 0,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14+36/bellsoft-jdk14+36-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "14+36",
|
||||
"featureVersion": 14
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 11,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.11+9/bellsoft-jdk11.0.11+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.11+9",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 8,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.1+8/bellsoft-jdk14.0.1+8-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "14.0.1+8",
|
||||
"featureVersion": 14
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 262,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u262+10/bellsoft-jdk8u262+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u262+10",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 1,
|
||||
"updateVersion": 275,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u275+1/bellsoft-jdk8u275+1-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u275+1",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 1,
|
||||
"updateVersion": 9,
|
||||
"patchVersion": 1,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9.1+1/bellsoft-jdk11.0.9.1+1-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.9.1+1",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 8,
|
||||
"updateVersion": 202,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u202/bellsoft-jdk8u202-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u202+8",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 33,
|
||||
"updateVersion": 0,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12/bellsoft-jdk12-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "12+33",
|
||||
"featureVersion": 12
|
||||
},
|
||||
{
|
||||
"buildVersion": 8,
|
||||
"updateVersion": 282,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u282+8/bellsoft-jdk8u282+8-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u282+8",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 11,
|
||||
"updateVersion": 9,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+11/bellsoft-jdk11.0.9+11-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.9+11",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 33,
|
||||
"updateVersion": 0,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13/bellsoft-jdk13-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "13+33",
|
||||
"featureVersion": 13
|
||||
},
|
||||
{
|
||||
"buildVersion": 12,
|
||||
"updateVersion": 9,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.9+12/bellsoft-jdk11.0.9+12-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.9+12",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 7,
|
||||
"updateVersion": 242,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u242+7/bellsoft-jdk8u242+7-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u242+7",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.2+9/bellsoft-jdk13.0.2+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "13.0.2+9",
|
||||
"featureVersion": 13
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1/bellsoft-jdk13.0.1-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "13.0.1+9",
|
||||
"featureVersion": 13
|
||||
},
|
||||
{
|
||||
"buildVersion": 1,
|
||||
"updateVersion": 265,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u265+1/bellsoft-jdk8u265+1-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u265+1",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.1+9/bellsoft-jdk15.0.1+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "15.0.1+9",
|
||||
"featureVersion": 15
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 272,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u272+10/bellsoft-jdk8u272+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u272+10",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 7,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.2+7/bellsoft-jdk16.0.2+7-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "16.0.2+7",
|
||||
"featureVersion": 16
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 6,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.6+10/bellsoft-jdk11.0.6+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.6+10",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 252,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u252+9/bellsoft-jdk8u252+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u252+9",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 12,
|
||||
"updateVersion": 212,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u212/bellsoft-jdk8u212-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u212+12",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+10/bellsoft-jdk15.0.2+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "15.0.2+10",
|
||||
"featureVersion": 15
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 10,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.10+9/bellsoft-jdk11.0.10+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.10+9",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 0,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.1/bellsoft-jdk11.0.1-macos-amd64.tar.gz",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.1+0",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 7,
|
||||
"updateVersion": 12,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.12+7/bellsoft-jdk11.0.12+7-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.12+7",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 36,
|
||||
"updateVersion": 0,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16+36/bellsoft-jdk16+36-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "16+36",
|
||||
"featureVersion": 16
|
||||
},
|
||||
{
|
||||
"buildVersion": 12,
|
||||
"updateVersion": 3,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.3/bellsoft-jdk11.0.3-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.3+12",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 8,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.8+10/bellsoft-jdk11.0.8+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.8+10",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 7,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.2/bellsoft-jdk11.0.2-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.2+7",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 5,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5/bellsoft-jdk11.0.5-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.5+10",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 4,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.4/bellsoft-jdk11.0.4-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.4+10",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.2/bellsoft-jdk12.0.2-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "12.0.2+10",
|
||||
"featureVersion": 12
|
||||
},
|
||||
{
|
||||
"buildVersion": 12,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/12.0.1/bellsoft-jdk12.0.1-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "12.0.1+12",
|
||||
"featureVersion": 12
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/13.0.1+10/bellsoft-jdk13.0.1+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "13.0.1+10",
|
||||
"featureVersion": 13
|
||||
},
|
||||
{
|
||||
"buildVersion": 11,
|
||||
"updateVersion": 5,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-macos-amd64.tar.gz",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.5+11",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 11,
|
||||
"updateVersion": 5,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.5+11/bellsoft-jdk11.0.5+11-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.5+11",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 292,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u292+10/bellsoft-jdk8u292+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u292+10",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 11,
|
||||
"updateVersion": 222,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u222/bellsoft-jdk8u222-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u222+11",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 36,
|
||||
"updateVersion": 0,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15+36/bellsoft-jdk15+36-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "15+36",
|
||||
"featureVersion": 15
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 7,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/11.0.7+10/bellsoft-jdk11.0.7+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "11.0.7+10",
|
||||
"featureVersion": 11
|
||||
},
|
||||
{
|
||||
"buildVersion": 10,
|
||||
"updateVersion": 232,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232+10/bellsoft-jdk8u232+10-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u232+10",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 8,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/15.0.2+8/bellsoft-jdk15.0.2+8-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "15.0.2+8",
|
||||
"featureVersion": 15
|
||||
},
|
||||
{
|
||||
"buildVersion": 8,
|
||||
"updateVersion": 302,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u302+8/bellsoft-jdk8u302+8-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u302+8",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 12,
|
||||
"updateVersion": 192,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u192.all/bellsoft-jdk1.8.0-macos-amd64.tar.gz",
|
||||
"interimVersion": 0,
|
||||
"version": "8u192+12",
|
||||
"featureVersion": 8
|
||||
},
|
||||
{
|
||||
"buildVersion": 13,
|
||||
"updateVersion": 2,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/14.0.2+13/bellsoft-jdk14.0.2+13-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "14.0.2+13",
|
||||
"featureVersion": 14
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 1,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/16.0.1+9/bellsoft-jdk16.0.1+9-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "16.0.1+9",
|
||||
"featureVersion": 16
|
||||
},
|
||||
{
|
||||
"buildVersion": 9,
|
||||
"updateVersion": 232,
|
||||
"patchVersion": 0,
|
||||
"downloadUrl": "https://github.com/bell-sw/Liberica/releases/download/8u232/bellsoft-jdk8u232-macos-amd64.zip",
|
||||
"interimVersion": 0,
|
||||
"version": "8u232+9",
|
||||
"featureVersion": 8
|
||||
}
|
||||
]
|
196
__tests__/distributors/liberica-installer.test.ts
Normal file
196
__tests__/distributors/liberica-installer.test.ts
Normal file
|
@ -0,0 +1,196 @@
|
|||
import { LibericaDistributions } from '../../src/distributions/liberica/installer';
|
||||
import { ArchitectureOptions, LibericaVersion } from '../../src/distributions/liberica/models';
|
||||
import { HttpClient } from '@actions/http-client';
|
||||
|
||||
const manifestData = require('../data/liberica.json') as LibericaVersion[];
|
||||
|
||||
describe('getAvailableVersions', () => {
|
||||
let spyHttpClient: jest.SpyInstance;
|
||||
|
||||
beforeEach(() => {
|
||||
spyHttpClient = jest.spyOn(HttpClient.prototype, 'getJson');
|
||||
spyHttpClient.mockReturnValue({
|
||||
statusCode: 200,
|
||||
headers: {},
|
||||
result: manifestData
|
||||
});
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
jest.resetAllMocks();
|
||||
jest.clearAllMocks();
|
||||
jest.restoreAllMocks();
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
{ version: '11.x', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=all'
|
||||
],
|
||||
[
|
||||
{ version: '11-ea', architecture: 'x86', packageType: 'jdk', checkLatest: false },
|
||||
'bundle-type=jdk&bitness=32&arch=x86&build-type=ea'
|
||||
],
|
||||
[
|
||||
{ version: '16.0.2', architecture: 'x64', packageType: 'jdk', checkLatest: false },
|
||||
'bundle-type=jdk&bitness=64&arch=x86&build-type=all'
|
||||
],
|
||||
[
|
||||
{ version: '16.0.2', architecture: 'x64', packageType: 'jre', checkLatest: false },
|
||||
'bundle-type=jre&bitness=64&arch=x86&build-type=all'
|
||||
],
|
||||
[
|
||||
{ version: '8', architecture: 'armv7', packageType: 'jdk+fx', checkLatest: false },
|
||||
'bundle-type=jdk-full&bitness=32&arch=arm&build-type=all'
|
||||
],
|
||||
[
|
||||
{ version: '8', architecture: 'aarch64', packageType: 'jre+fx', checkLatest: false },
|
||||
'bundle-type=jre-full&bitness=64&arch=arm&build-type=all'
|
||||
]
|
||||
])('build correct url for %s -> %s', async (input, urlParams) => {
|
||||
const additionalParams =
|
||||
'&installation-type=archive&fields=downloadUrl%2Cversion%2CfeatureVersion%2CinterimVersion%2C' +
|
||||
'updateVersion%2CbuildVersion';
|
||||
const distribution = new LibericaDistributions(input);
|
||||
distribution['getPlatformOption'] = () => 'macos';
|
||||
const buildUrl = `https://api.bell-sw.com/v1/liberica/releases?os=macos&${urlParams}${additionalParams}`;
|
||||
|
||||
await distribution['getAvailableVersions']();
|
||||
|
||||
expect(spyHttpClient.mock.calls).toHaveLength(1);
|
||||
expect(spyHttpClient.mock.calls[0][0]).toBe(buildUrl);
|
||||
});
|
||||
|
||||
it('load available versions', async () => {
|
||||
const distribution = new LibericaDistributions({
|
||||
version: '11',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
const availableVersions = await distribution['getAvailableVersions']();
|
||||
expect(availableVersions).toEqual(manifestData);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getArchitectureOptions', () => {
|
||||
it.each([
|
||||
['x86', { bitness: '32', arch: 'x86' }],
|
||||
['x64', { bitness: '64', arch: 'x86' }],
|
||||
['armv7', { bitness: '32', arch: 'arm' }],
|
||||
['aarch64', { bitness: '64', arch: 'arm' }],
|
||||
['ppc64le', { bitness: '64', arch: 'ppc' }]
|
||||
] as [string, ArchitectureOptions][])('parse architecture %s -> %s', (input, expected) => {
|
||||
const distributions = new LibericaDistributions({
|
||||
architecture: input,
|
||||
checkLatest: false,
|
||||
packageType: '',
|
||||
version: ''
|
||||
});
|
||||
|
||||
expect(distributions['getArchitectureOptions']()).toEqual(expected);
|
||||
});
|
||||
|
||||
it.each(['armv6', 's390x'])('not support architecture %s', input => {
|
||||
const distributions = new LibericaDistributions({
|
||||
architecture: input,
|
||||
checkLatest: false,
|
||||
packageType: '',
|
||||
version: ''
|
||||
});
|
||||
|
||||
expect(() => distributions['getArchitectureOptions']()).toThrow(
|
||||
/Architecture '\w+' is not supported\. Supported architectures: .*/
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: LibericaDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new LibericaDistributions({
|
||||
version: '',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
distribution['getAvailableVersions'] = async () => manifestData;
|
||||
});
|
||||
|
||||
it.each([
|
||||
['8', '8.0.302+8'],
|
||||
['11.x', '11.0.12+7'],
|
||||
['8.0', '8.0.302+8'],
|
||||
['11.0.x', '11.0.12+7'],
|
||||
['15', '15.0.2+10'],
|
||||
['15.0', '15.0.2+10'],
|
||||
['15.0.0', '15.0.0+36'],
|
||||
['8.0.232', '8.0.232+10'],
|
||||
['8.0.232+9', '8.0.232+9'],
|
||||
['15.0.2+8', '15.0.2+8'],
|
||||
['15.0.2+10', '15.0.2+10']
|
||||
])('version is %s -> %s', async (input, expected) => {
|
||||
const result = await distribution['findPackageForDownload'](input);
|
||||
expect(result.version).toBe(expected);
|
||||
});
|
||||
|
||||
it('should throw an error', async () => {
|
||||
await expect(distribution['findPackageForDownload']('17')).rejects.toThrow(
|
||||
/Could not find satisfied version for semver */
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPlatformOption', () => {
|
||||
const distributions = new LibericaDistributions({
|
||||
architecture: 'x64',
|
||||
version: '11',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
it.each([
|
||||
['linux', 'linux'],
|
||||
['darwin', 'macos'],
|
||||
['win32', 'windows'],
|
||||
['cygwin', 'windows'],
|
||||
['sunos', 'solaris']
|
||||
])('os version %s -> %s', (input, expected) => {
|
||||
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
||||
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
|
||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd'])(
|
||||
'not support os version %s',
|
||||
input => {
|
||||
expect(() => distributions['getPlatformOption'](input as NodeJS.Platform)).toThrow(
|
||||
/Platform '\w+' is not supported\. Supported platforms: .+/
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
describe('convertVersionToSemver', () => {
|
||||
const distributions = new LibericaDistributions({
|
||||
architecture: 'x64',
|
||||
version: '11',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
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, interimVersion: 0, updateVersion: 0, buildVersion: 13 }, '11.0.0+13']
|
||||
])('%s -> %s', (input, expected) => {
|
||||
const actual = distributions['convertVersionToSemver']({
|
||||
downloadUrl: '',
|
||||
version: '',
|
||||
...input
|
||||
});
|
||||
|
||||
expect(actual).toEqual(expected);
|
||||
});
|
||||
});
|
88
__tests__/distributors/microsoft-installer.test.ts
Normal file
88
__tests__/distributors/microsoft-installer.test.ts
Normal file
|
@ -0,0 +1,88 @@
|
|||
import { MicrosoftDistributions } from '../../src/distributions/microsoft/installer';
|
||||
|
||||
describe('findPackageForDownload', () => {
|
||||
let distribution: MicrosoftDistributions;
|
||||
|
||||
beforeEach(() => {
|
||||
distribution = new MicrosoftDistributions({
|
||||
version: '',
|
||||
architecture: 'x64',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
});
|
||||
|
||||
it.each([
|
||||
[
|
||||
'17.x',
|
||||
'17.0.1',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-17.0.1.12.1-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'16.0.x',
|
||||
'16.0.2',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-16.0.2.7.1-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
],
|
||||
[
|
||||
'11.0.13',
|
||||
'11.0.13',
|
||||
'https://aka.ms/download-jdk/microsoft-jdk-11.0.13.8.1-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||
]
|
||||
])('version is %s -> %s', async (input, expectedVersion, expectedUrl) => {
|
||||
const result = await distribution['findPackageForDownload'](input);
|
||||
expect(result.version).toBe(expectedVersion);
|
||||
let os: string;
|
||||
let archive: string;
|
||||
switch (process.platform) {
|
||||
case 'darwin':
|
||||
os = 'macos';
|
||||
archive = 'tar.gz';
|
||||
break;
|
||||
case 'win32':
|
||||
os = 'windows';
|
||||
archive = 'zip';
|
||||
break;
|
||||
default:
|
||||
os = process.platform.toString();
|
||||
archive = 'tar.gz';
|
||||
break;
|
||||
}
|
||||
const url = expectedUrl.replace('{{OS_TYPE}}', os).replace('{{ARCHIVE_TYPE}}', archive);
|
||||
expect(result.url).toBe(url);
|
||||
});
|
||||
|
||||
it('should throw an error', async () => {
|
||||
await expect(distribution['findPackageForDownload']('8')).rejects.toThrow(
|
||||
/Could not find satisfied version for SemVer */
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getPlatformOption', () => {
|
||||
const distributions = new MicrosoftDistributions({
|
||||
architecture: 'x64',
|
||||
version: '11',
|
||||
packageType: 'jdk',
|
||||
checkLatest: false
|
||||
});
|
||||
|
||||
it.each([
|
||||
['linux', 'tar.gz', 'linux'],
|
||||
['darwin', 'tar.gz', 'macos'],
|
||||
['win32', 'zip', 'windows']
|
||||
])('os version %s -> %s', (input, expectedArchive, expectedOs) => {
|
||||
const actual = distributions['getPlatformOption'](input as NodeJS.Platform);
|
||||
|
||||
expect(actual.archive).toEqual(expectedArchive);
|
||||
expect(actual.os).toEqual(expectedOs);
|
||||
});
|
||||
|
||||
it.each(['aix', 'android', 'freebsd', 'openbsd', 'netbsd', 'solaris', 'cygwin'])(
|
||||
'not support os version %s',
|
||||
input => {
|
||||
expect(() => distributions['getPlatformOption'](input as NodeJS.Platform)).toThrow(
|
||||
/Platform '\w+' is not supported\. Supported platforms: .+/
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
|
@ -1,17 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [[ "$(git status --porcelain)" != "" ]]; then
|
||||
echo ----------------------------------------
|
||||
echo git status
|
||||
echo ----------------------------------------
|
||||
git status
|
||||
echo ----------------------------------------
|
||||
echo git diff
|
||||
echo ----------------------------------------
|
||||
git diff
|
||||
echo ----------------------------------------
|
||||
echo Troubleshooting
|
||||
echo ----------------------------------------
|
||||
echo "::error::Unstaged changes detected. Locally try running: git clean -ffdx && npm ci && npm run pre-checkin"
|
||||
exit 1
|
||||
fi
|
24820
dist/cleanup/index.js
vendored
24820
dist/cleanup/index.js
vendored
File diff suppressed because one or more lines are too long
25123
dist/setup/index.js
vendored
25123
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
|
@ -53,6 +53,29 @@ steps:
|
|||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
### Liberica
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'liberica'
|
||||
java-version: '11'
|
||||
java-package: jdk # optional (jdk, jre, jdk+fx or jre+fx) - defaults to jdk
|
||||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
### Microsoft
|
||||
```yaml
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-java@v2
|
||||
with:
|
||||
distribution: 'microsoft'
|
||||
java-version: '11'
|
||||
- run: java -cp java HelloWorldApp
|
||||
```
|
||||
|
||||
## Installing custom Java package type
|
||||
```yaml
|
||||
steps:
|
||||
|
|
10514
package-lock.json
generated
10514
package-lock.json
generated
File diff suppressed because it is too large
Load diff
18
package.json
18
package.json
|
@ -24,31 +24,25 @@
|
|||
"author": "GitHub",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^1.0.7",
|
||||
"@actions/cache": "^1.0.8",
|
||||
"@actions/core": "^1.2.6",
|
||||
"@actions/exec": "^1.0.4",
|
||||
"@actions/glob": "^0.2.0",
|
||||
"@actions/http-client": "^1.0.9",
|
||||
"@actions/http-client": "^1.0.11",
|
||||
"@actions/io": "^1.0.2",
|
||||
"@actions/tool-cache": "^1.6.1",
|
||||
"semver": "^7.3.4",
|
||||
"xmlbuilder2": "^2.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "^26.0.20",
|
||||
"@types/jest": "^27.0.2",
|
||||
"@types/node": "^12.19.13",
|
||||
"@types/semver": "^7.3.4",
|
||||
"@vercel/ncc": "^0.31.0",
|
||||
"jest": "^26.6.3",
|
||||
"jest-circus": "^26.6.3",
|
||||
"jest": "^27.2.5",
|
||||
"jest-circus": "^27.2.5",
|
||||
"prettier": "^1.19.1",
|
||||
"ts-jest": "^26.5.3",
|
||||
"ts-jest": "^27.0.5",
|
||||
"typescript": "^4.2.3"
|
||||
},
|
||||
"husky": {
|
||||
"skipCI": true,
|
||||
"hooks": {
|
||||
"pre-commit": "npm run build && npm run format"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ async function removePrivateKeyFromKeychain() {
|
|||
const keyFingerprint = core.getState(constants.STATE_GPG_PRIVATE_KEY_FINGERPRINT);
|
||||
await gpg.deleteKey(keyFingerprint);
|
||||
} catch (error) {
|
||||
core.setFailed('Failed to remove private key');
|
||||
core.setFailed(`Failed to remove private key due to: ${error.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ import { LocalDistribution } from './local/installer';
|
|||
import { ZuluDistribution } from './zulu/installer';
|
||||
import { AdoptDistribution, AdoptImplementation } from './adopt/installer';
|
||||
import { TemurinDistribution, TemurinImplementation } from './temurin/installer';
|
||||
import { LibericaDistributions } from './liberica/installer';
|
||||
import { MicrosoftDistributions } from './microsoft/installer';
|
||||
|
||||
enum JavaDistribution {
|
||||
Adopt = 'adopt',
|
||||
|
@ -11,7 +13,9 @@ enum JavaDistribution {
|
|||
AdoptOpenJ9 = 'adopt-openj9',
|
||||
Temurin = 'temurin',
|
||||
Zulu = 'zulu',
|
||||
JdkFile = 'jdkfile'
|
||||
Liberica = 'liberica',
|
||||
JdkFile = 'jdkfile',
|
||||
Microsoft = 'microsoft'
|
||||
}
|
||||
|
||||
export function getJavaDistribution(
|
||||
|
@ -31,6 +35,10 @@ export function getJavaDistribution(
|
|||
return new TemurinDistribution(installerOptions, TemurinImplementation.Hotspot);
|
||||
case JavaDistribution.Zulu:
|
||||
return new ZuluDistribution(installerOptions);
|
||||
case JavaDistribution.Liberica:
|
||||
return new LibericaDistributions(installerOptions);
|
||||
case JavaDistribution.Microsoft:
|
||||
return new MicrosoftDistributions(installerOptions);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
157
src/distributions/liberica/installer.ts
Normal file
157
src/distributions/liberica/installer.ts
Normal file
|
@ -0,0 +1,157 @@
|
|||
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 { ArchitectureOptions, LibericaVersion, OsVersions } from './models';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
const supportedPlatform = `'linux', 'linux-musl', 'macos', 'solaris', 'windows'`;
|
||||
|
||||
const supportedArchitecture = `'x86', 'x64', 'armv7', 'aarch64', 'ppc64le'`;
|
||||
|
||||
export class LibericaDistributions extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Liberica', installerOptions);
|
||||
}
|
||||
|
||||
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 = await extractJdkFile(javaArchivePath, extension);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||
|
||||
const javaPath = await tc.cacheDir(
|
||||
archivePath,
|
||||
this.toolcacheFolderName,
|
||||
this.getToolcacheVersionName(javaRelease.version),
|
||||
this.architecture
|
||||
);
|
||||
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
}
|
||||
|
||||
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||
const availableVersionsRaw = await this.getAvailableVersions();
|
||||
|
||||
const availableVersions = availableVersionsRaw.map(item => ({
|
||||
url: item.downloadUrl,
|
||||
version: this.convertVersionToSemver(item)
|
||||
}));
|
||||
|
||||
const satisfiedVersion = availableVersions
|
||||
.filter(item => isVersionSatisfies(range, item.version))
|
||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
||||
|
||||
if (!satisfiedVersion) {
|
||||
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||
const availableOptionsMessage = availableOptions
|
||||
? `\nAvailable versions: ${availableOptions}`
|
||||
: '';
|
||||
throw new Error(
|
||||
`Could not find satisfied version for semver ${range}. ${availableOptionsMessage}`
|
||||
);
|
||||
}
|
||||
|
||||
return satisfiedVersion;
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<LibericaVersion[]> {
|
||||
console.time('liberica-retrieve-available-versions');
|
||||
const url = this.prepareAvailableVersionsUrl();
|
||||
|
||||
if (core.isDebug()) {
|
||||
core.debug(`Gathering available versions from '${url}'`);
|
||||
}
|
||||
|
||||
const availableVersions = (await this.http.getJson<LibericaVersion[]>(url)).result ?? [];
|
||||
|
||||
if (core.isDebug()) {
|
||||
core.startGroup('Print information about available versions');
|
||||
console.timeEnd('liberica-retrieve-available-versions');
|
||||
console.log(`Available versions: [${availableVersions.length}]`);
|
||||
console.log(availableVersions.map(item => item.version));
|
||||
core.endGroup();
|
||||
}
|
||||
|
||||
return availableVersions;
|
||||
}
|
||||
|
||||
private prepareAvailableVersionsUrl() {
|
||||
const urlOptions = {
|
||||
os: this.getPlatformOption(),
|
||||
'bundle-type': this.getBundleType(),
|
||||
...this.getArchitectureOptions(),
|
||||
'build-type': this.stable ? 'all' : 'ea',
|
||||
'installation-type': 'archive',
|
||||
fields: 'downloadUrl,version,featureVersion,interimVersion,updateVersion,buildVersion'
|
||||
};
|
||||
|
||||
const searchParams = new URLSearchParams(urlOptions).toString();
|
||||
|
||||
return `https://api.bell-sw.com/v1/liberica/releases?${searchParams}`;
|
||||
}
|
||||
|
||||
private getBundleType(): string {
|
||||
const [bundleType, feature] = this.packageType.split('+');
|
||||
if (feature?.includes('fx')) {
|
||||
return bundleType + '-full';
|
||||
}
|
||||
return bundleType;
|
||||
}
|
||||
|
||||
private getArchitectureOptions(): ArchitectureOptions {
|
||||
switch (this.architecture) {
|
||||
case 'x86':
|
||||
return { bitness: '32', arch: 'x86' };
|
||||
case 'x64':
|
||||
return { bitness: '64', arch: 'x86' };
|
||||
case 'armv7':
|
||||
return { bitness: '32', arch: 'arm' };
|
||||
case 'aarch64':
|
||||
return { bitness: '64', arch: 'arm' };
|
||||
case 'ppc64le':
|
||||
return { bitness: '64', arch: 'ppc' };
|
||||
default:
|
||||
throw new Error(
|
||||
`Architecture '${this.architecture}' is not supported. Supported architectures: ${supportedArchitecture}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private getPlatformOption(platform: NodeJS.Platform = process.platform): OsVersions {
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
return 'macos';
|
||||
case 'win32':
|
||||
case 'cygwin':
|
||||
return 'windows';
|
||||
case 'linux':
|
||||
return 'linux';
|
||||
case 'sunos':
|
||||
return 'solaris';
|
||||
default:
|
||||
throw new Error(
|
||||
`Platform '${platform}' is not supported. Supported platforms: ${supportedPlatform}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private convertVersionToSemver(version: LibericaVersion): string {
|
||||
let { buildVersion, featureVersion, interimVersion, updateVersion } = version;
|
||||
const mainVersion = [featureVersion, interimVersion, updateVersion].join('.');
|
||||
if (buildVersion != 0) {
|
||||
return `${mainVersion}+${buildVersion}`;
|
||||
}
|
||||
return mainVersion;
|
||||
}
|
||||
}
|
20
src/distributions/liberica/models.ts
Normal file
20
src/distributions/liberica/models.ts
Normal file
|
@ -0,0 +1,20 @@
|
|||
// Models from https://api.bell-sw.com/api.html
|
||||
|
||||
export type Bitness = '32' | '64';
|
||||
export type ArchType = 'arm' | 'ppc' | 'sparc' | 'x86';
|
||||
|
||||
export type OsVersions = 'linux' | 'linux-musl' | 'macos' | 'solaris' | 'windows';
|
||||
|
||||
export interface ArchitectureOptions {
|
||||
bitness: Bitness;
|
||||
arch: ArchType;
|
||||
}
|
||||
|
||||
export interface LibericaVersion {
|
||||
downloadUrl: string;
|
||||
version: string;
|
||||
featureVersion: number;
|
||||
interimVersion: number;
|
||||
updateVersion: number;
|
||||
buildVersion: number;
|
||||
}
|
124
src/distributions/microsoft/installer.ts
Normal file
124
src/distributions/microsoft/installer.ts
Normal file
|
@ -0,0 +1,124 @@
|
|||
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 { MicrosoftVersion, PlatformOptions } from './models';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
export class MicrosoftDistributions extends JavaBase {
|
||||
constructor(installerOptions: JavaInstallerOptions) {
|
||||
super('Microsoft', installerOptions);
|
||||
}
|
||||
|
||||
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 = await extractJdkFile(javaArchivePath, extension);
|
||||
|
||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
||||
|
||||
const javaPath = await tc.cacheDir(
|
||||
archivePath,
|
||||
this.toolcacheFolderName,
|
||||
this.getToolcacheVersionName(javaRelease.version),
|
||||
this.architecture
|
||||
);
|
||||
|
||||
return { version: javaRelease.version, path: javaPath };
|
||||
}
|
||||
|
||||
protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
|
||||
if (this.architecture !== 'x64' && this.architecture !== 'aarch64') {
|
||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
||||
}
|
||||
|
||||
if (!this.stable) {
|
||||
throw new Error('Early access versions are not supported');
|
||||
}
|
||||
|
||||
if (this.packageType !== 'jdk') {
|
||||
throw new Error('Microsoft Build of OpenJDK provides only the `jdk` package type');
|
||||
}
|
||||
|
||||
const availableVersionsRaw = await this.getAvailableVersions();
|
||||
|
||||
const opts = this.getPlatformOption();
|
||||
const availableVersions = availableVersionsRaw.map(item => ({
|
||||
url: `https://aka.ms/download-jdk/microsoft-jdk-${item.version.join('.')}-${opts.os}-${
|
||||
this.architecture
|
||||
}.${opts.archive}`,
|
||||
version: this.convertVersionToSemver(item)
|
||||
}));
|
||||
|
||||
const satisfiedVersion = availableVersions
|
||||
.filter(item => isVersionSatisfies(range, item.version))
|
||||
.sort((a, b) => -semver.compareBuild(a.version, b.version))[0];
|
||||
|
||||
if (!satisfiedVersion) {
|
||||
const availableOptions = availableVersions.map(item => item.version).join(', ');
|
||||
const availableOptionsMessage = availableOptions
|
||||
? `\nAvailable versions: ${availableOptions}`
|
||||
: '';
|
||||
throw new Error(
|
||||
`Could not find satisfied version for SemVer ${range}. ${availableOptionsMessage}`
|
||||
);
|
||||
}
|
||||
|
||||
return satisfiedVersion;
|
||||
}
|
||||
|
||||
private async getAvailableVersions(): Promise<MicrosoftVersion[]> {
|
||||
// TODO get these dynamically!
|
||||
// We will need Microsoft to add an endpoint where we can query for versions.
|
||||
const jdkVersions = [
|
||||
{
|
||||
version: [17, 0, 1, 12, 1]
|
||||
},
|
||||
{
|
||||
version: [16, 0, 2, 7, 1]
|
||||
}
|
||||
];
|
||||
|
||||
// M1 is only supported for Java 16 & 17
|
||||
if (process.platform !== 'darwin' || this.architecture !== 'aarch64') {
|
||||
jdkVersions.push({
|
||||
version: [11, 0, 13, 8, 1]
|
||||
});
|
||||
}
|
||||
|
||||
return jdkVersions;
|
||||
}
|
||||
|
||||
private getPlatformOption(
|
||||
platform: NodeJS.Platform = process.platform /* for testing */
|
||||
): PlatformOptions {
|
||||
switch (platform) {
|
||||
case 'darwin':
|
||||
return { archive: 'tar.gz', os: 'macos' };
|
||||
case 'win32':
|
||||
return { archive: 'zip', os: 'windows' };
|
||||
case 'linux':
|
||||
return { archive: 'tar.gz', os: 'linux' };
|
||||
default:
|
||||
throw new Error(
|
||||
`Platform '${platform}' is not supported. Supported platforms: 'darwin', 'linux', 'win32'`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private convertVersionToSemver(version: MicrosoftVersion): string {
|
||||
const major = version.version[0];
|
||||
const minor = version.version[1];
|
||||
const patch = version.version[2];
|
||||
return `${major}.${minor}.${patch}`;
|
||||
}
|
||||
}
|
12
src/distributions/microsoft/models.ts
Normal file
12
src/distributions/microsoft/models.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
type OsVersions = 'linux' | 'macos' | 'windows';
|
||||
type ArchiveType = 'tar.gz' | 'zip';
|
||||
|
||||
export interface PlatformOptions {
|
||||
archive: ArchiveType;
|
||||
os: OsVersions;
|
||||
}
|
||||
|
||||
export interface MicrosoftVersion {
|
||||
downloadUrl?: string;
|
||||
version: Array<number>;
|
||||
}
|
|
@ -39,8 +39,7 @@ export async function importKey(privateKey: string) {
|
|||
}
|
||||
|
||||
export async function deleteKey(keyFingerprint: string) {
|
||||
await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-keys', keyFingerprint], {
|
||||
await exec.exec('gpg', ['--batch', '--yes', '--delete-secret-and-public-key', keyFingerprint], {
|
||||
silent: true
|
||||
});
|
||||
await exec.exec('gpg', ['--batch', '--yes', '--delete-keys', keyFingerprint], { silent: true });
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue