Compare commits
25 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b8dc5fccfb | ||
|
|
1c219f5b27 | ||
|
|
2a93b69fdf | ||
|
|
0b782b6b90 | ||
|
|
d5b07dd118 | ||
|
|
40dc6ae006 | ||
|
|
cde0daed27 | ||
|
|
22b65d7de0 | ||
|
|
c2fd2d6d8e | ||
|
|
2b3d0bde8f | ||
|
|
6c7d417a1e | ||
|
|
8dd4f51a5e | ||
|
|
2fb264a6b0 | ||
|
|
0a27862568 | ||
|
|
70003e7f9f | ||
|
|
814434c7a9 | ||
|
|
3282b5e43f | ||
|
|
26eec53160 | ||
|
|
0e29e36dce | ||
|
|
ac032b0e7e | ||
|
|
8cd3284efc | ||
|
|
8f1dbd2ce5 | ||
|
|
d3b90f817c | ||
|
|
570f6b20e6 | ||
|
|
265e01895c |
2
.github/workflows/check-dist.yml
vendored
2
.github/workflows/check-dist.yml
vendored
@@ -24,7 +24,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set Node.js 16.x
|
||||
uses: actions/setup-node@v3
|
||||
|
||||
79
.github/workflows/test.yml
vendored
79
.github/workflows/test.yml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
build: # make sure build/ci work properly
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- run: |
|
||||
npm install
|
||||
- run: |
|
||||
@@ -25,24 +25,33 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: ['17', '20', 'dev']
|
||||
java-version: ['21', '17', '20', 'dev']
|
||||
distribution: ['graalvm', 'graalvm-community']
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
components: ['']
|
||||
include:
|
||||
- java-version: '17.0.7'
|
||||
- java-version: '21'
|
||||
distribution: ''
|
||||
os: ubuntu-latest
|
||||
- java-version: 'dev'
|
||||
distribution: ''
|
||||
os: windows-latest
|
||||
- java-version: '21'
|
||||
distribution: 'graalvm-community'
|
||||
os: ubuntu-latest
|
||||
components: 'native-image' # should print a warning but not fail
|
||||
- java-version: '21.0.0' # test for GA version (see #63)
|
||||
distribution: 'graalvm'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
java-version: ${{ matrix.java-version }}
|
||||
distribution: ${{ matrix.distribution }}
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
components: ${{ matrix.components }}
|
||||
- name: Check environment
|
||||
run: |
|
||||
echo "GRAALVM_HOME: $GRAALVM_HOME"
|
||||
@@ -95,7 +104,7 @@ jobs:
|
||||
components: 'native-image'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -106,7 +115,7 @@ jobs:
|
||||
- name: Check environment
|
||||
run: |
|
||||
echo "GRAALVM_HOME: $GRAALVM_HOME"
|
||||
if [[ "${{ matrix.version }}" == "dev" ]]; then
|
||||
if [[ "${{ matrix.version }}" == "dev" ]] && [[ "${{ matrix.java-version }}" == "dev" ]]; then
|
||||
[[ "$GRAALVM_HOME" == *"$RUNNER_TEMP"* ]] || exit 12
|
||||
else
|
||||
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 23
|
||||
@@ -115,7 +124,9 @@ jobs:
|
||||
java --version
|
||||
java --version | grep "GraalVM" || exit 34
|
||||
native-image --version
|
||||
gu list
|
||||
if [[ "${{ matrix.java-version }}" != "dev" ]]; then
|
||||
gu list
|
||||
fi
|
||||
if: runner.os != 'Windows'
|
||||
- name: Check Windows environment
|
||||
run: |
|
||||
@@ -133,20 +144,20 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
version: ['latest']
|
||||
java-version: ['19']
|
||||
java-version: ['17']
|
||||
components: ['native-image']
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
include:
|
||||
- version: '22.3.0'
|
||||
- version: '22.3.3'
|
||||
java-version: '11'
|
||||
components: 'native-image'
|
||||
os: ubuntu-latest
|
||||
- version: '22.3.0'
|
||||
- version: '22.3.3'
|
||||
java-version: '17'
|
||||
components: 'native-image'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -161,7 +172,7 @@ jobs:
|
||||
[[ "$GRAALVM_HOME" == *"$RUNNER_TOOL_CACHE"* ]] || exit 12
|
||||
echo "JAVA_HOME: $JAVA_HOME"
|
||||
java --version
|
||||
java --version | grep "GraalVM EE" || exit 23
|
||||
java --version | grep -e "GraalVM EE" -e "Oracle GraalVM" || exit 23
|
||||
native-image --version
|
||||
gu list
|
||||
if: runner.os != 'Windows'
|
||||
@@ -179,7 +190,7 @@ jobs:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
version: ['mandrel-22.2.0.0-Final', 'mandrel-latest']
|
||||
version: ['mandrel-22.2.0.0-Final', '23.0.1.2-Final', 'mandrel-latest']
|
||||
java-version: ['17']
|
||||
distribution: ['mandrel']
|
||||
os: [windows-latest, ubuntu-latest]
|
||||
@@ -188,12 +199,12 @@ jobs:
|
||||
java-version: '17'
|
||||
distribution: '' # test empty distribution for backward compatibility
|
||||
os: ubuntu-latest
|
||||
exclude: # temporarily disable Mandrel latest builds on Windows due to unavailability
|
||||
- version: 'mandrel-latest'
|
||||
java-version: '17'
|
||||
os: windows-latest
|
||||
- version: '' # test with no version
|
||||
java-version: '21'
|
||||
distribution: 'mandrel'
|
||||
os: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -224,7 +235,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -246,7 +257,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -268,7 +279,7 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
@@ -291,11 +302,11 @@ jobs:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
java-version: '17'
|
||||
java-version: '17.0.8'
|
||||
distribution: 'graalvm'
|
||||
components: 'espresso,llvm-toolchain,native-image,nodejs,python,ruby,wasm'
|
||||
set-java-home: 'false'
|
||||
@@ -326,16 +337,16 @@ jobs:
|
||||
javac HelloWorld.java
|
||||
native-image -g HelloWorld
|
||||
./helloworld
|
||||
- name: Build Ruby-FFI with TruffleRuby
|
||||
run: |
|
||||
[[ $(which bundle) == *"graalvm"* ]] || exit 57
|
||||
git clone --depth 1 https://github.com/ffi/ffi.git
|
||||
pushd ffi > /dev/null
|
||||
# https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
|
||||
bundle install
|
||||
bundle exec rake libffi
|
||||
bundle exec rake compile
|
||||
bundle exec rake test
|
||||
popd > /dev/null
|
||||
# - name: Build Ruby-FFI with TruffleRuby
|
||||
# run: |
|
||||
# [[ $(which bundle) == *"graalvm"* ]] || exit 57
|
||||
# git clone --depth 1 https://github.com/ffi/ffi.git
|
||||
# pushd ffi > /dev/null
|
||||
# # https://github.com/ffi/ffi/blob/447845cb3030194c79700c86fb388a12e6f81386/.github/workflows/ci.yml#L58-L62
|
||||
# bundle install
|
||||
# bundle exec rake libffi
|
||||
# bundle exec rake compile
|
||||
# bundle exec rake test
|
||||
# popd > /dev/null
|
||||
- name: Remove components
|
||||
run: gu remove espresso llvm-toolchain nodejs python ruby wasm
|
||||
|
||||
18
README.md
18
README.md
@@ -17,7 +17,7 @@ This action:
|
||||
|
||||
## Migrating from GraalVM 22.3 or Earlier to the New GraalVM for JDK 17 and Later
|
||||
|
||||
The new [GraalVM for JDK 17 and JDK 20 release](https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5) aligns the GraalVM version scheme with OpenJDK.
|
||||
The [GraalVM for JDK 17 and JDK 20 release](https://medium.com/graalvm/a-new-graalvm-release-and-new-free-license-4aab483692f5) aligns the GraalVM version scheme with OpenJDK.
|
||||
As a result, this action no longer requires the `version` option to select a specific GraalVM version.
|
||||
At the same time, it introduces a new `distribution` option to select a specific GraalVM distribution (`graalvm`, `graalvm-community`, or `mandrel`).
|
||||
Therefore, to migrate your workflow to use the latest GraalVM release, replace the `version` with the `distribution` option in the workflow `yml` config, for example:
|
||||
@@ -54,10 +54,10 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '17.0.7'
|
||||
java-version: '21'
|
||||
distribution: 'graalvm' # See 'Options' for all available distributions
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Example step
|
||||
@@ -85,11 +85,11 @@ jobs:
|
||||
matrix:
|
||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
java-version: '17.0.7'
|
||||
java-version: '21'
|
||||
distribution: 'graalvm'
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
native-image-job-reports: 'true'
|
||||
@@ -118,7 +118,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.2' # GraalVM version
|
||||
@@ -146,7 +146,7 @@ jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v4
|
||||
- uses: graalvm/setup-graalvm@v1
|
||||
with:
|
||||
version: '22.3.0'
|
||||
@@ -166,7 +166,7 @@ jobs:
|
||||
|
||||
| Name | Default | Description |
|
||||
|-----------------|:--------:|-------------|
|
||||
| `java-version`<br>*(required)* | n/a | `'17.0.7'` or `'20.0.1'` for a specific Java version, `'dev'` for a dev build with the latest Java version available.<br>(`'8'`, `'11'`, `'16'`, `'19'` are supported for older GraalVM releases.) |
|
||||
| `java-version`<br>*(required)* | n/a | `'21'` or `'17.0.7'` for a specific Java version, `'dev'` for a dev build with the latest Java version available.<br>(`'8'`, `'11'`, `'16'`, `'19'` are supported for older GraalVM releases.) |
|
||||
| `distribution` | `''` | GraalVM distribution (`graalvm` for Oracle GraalVM, `graalvm-community` for GraalVM Community Edition, `mandrel` for Mandrel). |
|
||||
| `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. |
|
||||
| `set-java-home` | `'true'` | If set to `'true'`, instructs the action to set `$JAVA_HOME` to the path of the GraalVM installation. Overrides any previous action or command that sets `$JAVA_HOME`. |
|
||||
@@ -176,7 +176,7 @@ jobs:
|
||||
| `native-image-job-reports` *) | `'false'` | If set to `'true'`, post a job summary containing a Native Image build report. |
|
||||
| `native-image-pr-reports` *) | `'false'` | If set to `'true'`, post a comment containing a Native Image build report on pull requests. Requires `write` permissions for the [`pull-requests` scope][gha-permissions]. |
|
||||
| `components` | `''` | Comma-separated list of GraalVM components (e.g., `native-image` or `ruby,nodejs`) that will be installed by the [GraalVM Updater][gu]. |
|
||||
| `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z` (e.g., `mandrel-21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` for [latest Mandrel stable release][mandrel-stable]. |
|
||||
| `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z.W` or `X.Y.Z.W-Final` (e.g., `mandrel-21.3.0.0-Final` or `21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` or `latest` for the latest Mandrel stable release. |
|
||||
| `gds-token` | `''` | Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)). |
|
||||
|
||||
**) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.*
|
||||
|
||||
75
__tests__/mandrel.test.ts
Normal file
75
__tests__/mandrel.test.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
import * as path from 'path'
|
||||
import * as mandrel from '../src/mandrel'
|
||||
import {expect, test} from '@jest/globals'
|
||||
import {getLatestRelease} from '../src/utils'
|
||||
|
||||
process.env['RUNNER_TOOL_CACHE'] = path.join(__dirname, 'TOOL_CACHE')
|
||||
process.env['RUNNER_TEMP'] = path.join(__dirname, 'TEMP')
|
||||
|
||||
test('request invalid version/javaVersion combination', async () => {
|
||||
for (var combination of [
|
||||
['mandrel-23.1.1.0-Final', '17'],
|
||||
['mandrel-23.0.2.1-Final', '21']
|
||||
]) {
|
||||
let error = new Error('unexpected')
|
||||
try {
|
||||
await mandrel.setUpMandrel(combination[0], combination[1])
|
||||
} catch (err) {
|
||||
if (!(err instanceof Error)) {
|
||||
fail(`Unexpected non-Error: ${err}`)
|
||||
}
|
||||
error = err
|
||||
}
|
||||
|
||||
expect(error).not.toBeUndefined()
|
||||
expect(error.message).toContain('Failed to download')
|
||||
expect(error.message).toContain('Are you sure version')
|
||||
}
|
||||
})
|
||||
test('request invalid version', async () => {
|
||||
for (var combination of [
|
||||
['mandrel-23.1.1.0', '21'],
|
||||
['mandrel-23.0.2.1', '17']
|
||||
]) {
|
||||
let error = new Error('unexpected')
|
||||
try {
|
||||
await mandrel.setUpMandrel(combination[0], combination[1])
|
||||
} catch (err) {
|
||||
if (!(err instanceof Error)) {
|
||||
fail(`Unexpected non-Error: ${err}`)
|
||||
}
|
||||
error = err
|
||||
}
|
||||
|
||||
expect(error).not.toBeUndefined()
|
||||
expect(error.message).toContain('Failed to download')
|
||||
expect(error.message).toContain('Are you sure version')
|
||||
}
|
||||
})
|
||||
|
||||
test('find latest', async () => {
|
||||
// Make sure the action can find the latest Mandrel release
|
||||
const latestRelease = await getLatestRelease(mandrel.MANDREL_REPO)
|
||||
const tag_name = latestRelease.tag_name
|
||||
expect(tag_name).toContain(mandrel.MANDREL_TAG_PREFIX)
|
||||
})
|
||||
|
||||
test('get known latest Mandrel for specific JDK', async () => {
|
||||
// Test deprecated versions that won't get updates anymore
|
||||
for (var combination of [
|
||||
['11', '22.2.0.0-Final'],
|
||||
['20', '23.0.1.2-Final']
|
||||
]) {
|
||||
const latest = await mandrel.getLatestMandrelReleaseUrl(combination[0])
|
||||
expect(latest).toContain(`mandrel-java${combination[0]}`)
|
||||
expect(latest).toContain(combination[1])
|
||||
}
|
||||
})
|
||||
|
||||
test('get latest Mandrel for specific JDK', async () => {
|
||||
// Test supported versions
|
||||
for (var javaVersion of ['17', '21']) {
|
||||
const latest = await mandrel.getLatestMandrelReleaseUrl(javaVersion)
|
||||
expect(latest).toContain(`mandrel-java${javaVersion}`)
|
||||
}
|
||||
})
|
||||
55
dist/cleanup/index.js
generated
vendored
55
dist/cleanup/index.js
generated
vendored
@@ -58304,7 +58304,7 @@ class Range {
|
||||
this.set = this.raw
|
||||
.split('||')
|
||||
// map the range to a 2d array of comparators
|
||||
.map(r => this.parseRange(r))
|
||||
.map(r => this.parseRange(r.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
@@ -58364,15 +58364,18 @@ class Range {
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
debug('hyphen replace', range)
|
||||
|
||||
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
||||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||
debug('comparator trim', range)
|
||||
|
||||
// `~ 1.2.3` => `~1.2.3`
|
||||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||
debug('tilde trim', range)
|
||||
|
||||
// `^ 1.2.3` => `^1.2.3`
|
||||
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||
debug('caret trim', range)
|
||||
|
||||
// At this point, the range is completely trimmed and
|
||||
// ready to be split into comparators.
|
||||
@@ -59674,6 +59677,10 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
// Max safe length for a build identifier. The max length minus 6 characters for
|
||||
// the shortest version with a build 0.0.0+BUILD.
|
||||
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
||||
|
||||
const RELEASE_TYPES = [
|
||||
'major',
|
||||
'premajor',
|
||||
@@ -59687,6 +59694,7 @@ const RELEASE_TYPES = [
|
||||
module.exports = {
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
RELEASE_TYPES,
|
||||
SEMVER_SPEC_VERSION,
|
||||
@@ -59768,7 +59776,11 @@ module.exports = parseOptions
|
||||
/***/ 9523:
|
||||
/***/ ((module, exports, __nccwpck_require__) => {
|
||||
|
||||
const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(2293)
|
||||
const {
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_LENGTH,
|
||||
} = __nccwpck_require__(2293)
|
||||
const debug = __nccwpck_require__(427)
|
||||
exports = module.exports = {}
|
||||
|
||||
@@ -59779,16 +59791,31 @@ const src = exports.src = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
||||
|
||||
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safeRegexReplacements = [
|
||||
['\\s', 1],
|
||||
['\\d', MAX_LENGTH],
|
||||
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
||||
]
|
||||
|
||||
const makeSafeRegex = (value) => {
|
||||
for (const [token, max] of safeRegexReplacements) {
|
||||
value = value
|
||||
.split(`${token}*`).join(`${token}{0,${max}}`)
|
||||
.split(`${token}+`).join(`${token}{1,${max}}`)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
// Replace all greedy whitespace to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safe = value
|
||||
.split('\\s*').join('\\s{0,1}')
|
||||
.split('\\s+').join('\\s')
|
||||
const safe = makeSafeRegex(value)
|
||||
const index = R++
|
||||
debug(name, index, value)
|
||||
t[name] = index
|
||||
@@ -59804,13 +59831,13 @@ const createToken = (name, value, isGlobal) => {
|
||||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
|
||||
|
||||
// ## Non-numeric Identifier
|
||||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||||
// more letters, digits, or hyphens.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*')
|
||||
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
@@ -59845,7 +59872,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')
|
||||
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
|
||||
342
dist/main/index.js
generated
vendored
342
dist/main/index.js
generated
vendored
@@ -8029,7 +8029,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;
|
||||
const http = __importStar(__nccwpck_require__(3685));
|
||||
const https = __importStar(__nccwpck_require__(5687));
|
||||
const pm = __importStar(__nccwpck_require__(3466));
|
||||
const pm = __importStar(__nccwpck_require__(3186));
|
||||
const tunnel = __importStar(__nccwpck_require__(4294));
|
||||
var HttpCodes;
|
||||
(function (HttpCodes) {
|
||||
@@ -8603,7 +8603,7 @@ const lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCa
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 3466:
|
||||
/***/ 3186:
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
|
||||
"use strict";
|
||||
@@ -58304,7 +58304,7 @@ class Range {
|
||||
this.set = this.raw
|
||||
.split('||')
|
||||
// map the range to a 2d array of comparators
|
||||
.map(r => this.parseRange(r))
|
||||
.map(r => this.parseRange(r.trim()))
|
||||
// throw out any comparator lists that are empty
|
||||
// this generally means that it was not a valid range, which is allowed
|
||||
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||
@@ -58364,15 +58364,18 @@ class Range {
|
||||
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
|
||||
range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
|
||||
debug('hyphen replace', range)
|
||||
|
||||
// `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
|
||||
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||
debug('comparator trim', range)
|
||||
|
||||
// `~ 1.2.3` => `~1.2.3`
|
||||
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||
debug('tilde trim', range)
|
||||
|
||||
// `^ 1.2.3` => `^1.2.3`
|
||||
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||
debug('caret trim', range)
|
||||
|
||||
// At this point, the range is completely trimmed and
|
||||
// ready to be split into comparators.
|
||||
@@ -59185,7 +59188,7 @@ module.exports = cmp
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ 5280:
|
||||
/***/ 3466:
|
||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||
|
||||
const SemVer = __nccwpck_require__(8088)
|
||||
@@ -59594,7 +59597,7 @@ const neq = __nccwpck_require__(6017)
|
||||
const gte = __nccwpck_require__(5522)
|
||||
const lte = __nccwpck_require__(7520)
|
||||
const cmp = __nccwpck_require__(5098)
|
||||
const coerce = __nccwpck_require__(5280)
|
||||
const coerce = __nccwpck_require__(3466)
|
||||
const Comparator = __nccwpck_require__(1532)
|
||||
const Range = __nccwpck_require__(9828)
|
||||
const satisfies = __nccwpck_require__(6055)
|
||||
@@ -59674,6 +59677,10 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||
// Max safe segment length for coercion.
|
||||
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||
|
||||
// Max safe length for a build identifier. The max length minus 6 characters for
|
||||
// the shortest version with a build 0.0.0+BUILD.
|
||||
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
|
||||
|
||||
const RELEASE_TYPES = [
|
||||
'major',
|
||||
'premajor',
|
||||
@@ -59687,6 +59694,7 @@ const RELEASE_TYPES = [
|
||||
module.exports = {
|
||||
MAX_LENGTH,
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_SAFE_INTEGER,
|
||||
RELEASE_TYPES,
|
||||
SEMVER_SPEC_VERSION,
|
||||
@@ -59768,7 +59776,11 @@ module.exports = parseOptions
|
||||
/***/ 9523:
|
||||
/***/ ((module, exports, __nccwpck_require__) => {
|
||||
|
||||
const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(2293)
|
||||
const {
|
||||
MAX_SAFE_COMPONENT_LENGTH,
|
||||
MAX_SAFE_BUILD_LENGTH,
|
||||
MAX_LENGTH,
|
||||
} = __nccwpck_require__(2293)
|
||||
const debug = __nccwpck_require__(427)
|
||||
exports = module.exports = {}
|
||||
|
||||
@@ -59779,16 +59791,31 @@ const src = exports.src = []
|
||||
const t = exports.t = {}
|
||||
let R = 0
|
||||
|
||||
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
|
||||
|
||||
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safeRegexReplacements = [
|
||||
['\\s', 1],
|
||||
['\\d', MAX_LENGTH],
|
||||
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
|
||||
]
|
||||
|
||||
const makeSafeRegex = (value) => {
|
||||
for (const [token, max] of safeRegexReplacements) {
|
||||
value = value
|
||||
.split(`${token}*`).join(`${token}{0,${max}}`)
|
||||
.split(`${token}+`).join(`${token}{1,${max}}`)
|
||||
}
|
||||
return value
|
||||
}
|
||||
|
||||
const createToken = (name, value, isGlobal) => {
|
||||
// Replace all greedy whitespace to prevent regex dos issues. These regex are
|
||||
// used internally via the safeRe object since all inputs in this library get
|
||||
// normalized first to trim and collapse all extra whitespace. The original
|
||||
// regexes are exported for userland consumption and lower level usage. A
|
||||
// future breaking change could export the safer regex only with a note that
|
||||
// all input should have extra whitespace removed.
|
||||
const safe = value
|
||||
.split('\\s*').join('\\s{0,1}')
|
||||
.split('\\s+').join('\\s')
|
||||
const safe = makeSafeRegex(value)
|
||||
const index = R++
|
||||
debug(name, index, value)
|
||||
t[name] = index
|
||||
@@ -59804,13 +59831,13 @@ const createToken = (name, value, isGlobal) => {
|
||||
// A single `0`, or a non-zero digit followed by zero or more digits.
|
||||
|
||||
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+')
|
||||
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
|
||||
|
||||
// ## Non-numeric Identifier
|
||||
// Zero or more digits, followed by a letter or hyphen, and then zero or
|
||||
// more letters, digits, or hyphens.
|
||||
|
||||
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*')
|
||||
createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
|
||||
|
||||
// ## Main Version
|
||||
// Three dot-separated numeric identifiers.
|
||||
@@ -59845,7 +59872,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
|
||||
// ## Build Metadata Identifier
|
||||
// Any combination of digits, letters, or hyphens.
|
||||
|
||||
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+')
|
||||
createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
|
||||
|
||||
// ## Build Metadata
|
||||
// Plus sign, followed by one or more period-separated build metadata
|
||||
@@ -70308,32 +70335,25 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.checkForUpdates = void 0;
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
function checkForUpdates(graalVMVersion, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '20';
|
||||
core.notice(`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`);
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.startsWith('22.3.') && javaVersion === '11') {
|
||||
core.notice('Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063');
|
||||
return;
|
||||
}
|
||||
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
|
||||
});
|
||||
if (javaVersion === '20') {
|
||||
core.notice('A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d');
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '21';
|
||||
core.notice(`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`);
|
||||
return;
|
||||
}
|
||||
if (graalVMVersion.startsWith('22.3.') && javaVersion === '11') {
|
||||
core.notice('Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063');
|
||||
return;
|
||||
}
|
||||
// TODO: add support for JDK-specific update checks (e.g., 17.0.X)
|
||||
}
|
||||
exports.checkForUpdates = checkForUpdates;
|
||||
|
||||
@@ -70824,7 +70844,7 @@ const assert_1 = __nccwpck_require__(9491);
|
||||
const uuid_1 = __nccwpck_require__(5840);
|
||||
function downloadGraalVMEELegacy(gdsToken, version, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const userAgent = `GraalVMGitHubAction/1.1.2 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`;
|
||||
const userAgent = `GraalVMGitHubAction/1.1.5 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`;
|
||||
const baseArtifact = yield fetchArtifact(userAgent, 'isBase:True', version, javaVersion);
|
||||
return downloadArtifact(gdsToken, userAgent, baseArtifact);
|
||||
});
|
||||
@@ -71008,11 +71028,11 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.setUpGraalVMRelease = exports.findGraalVMVersion = exports.setUpGraalVMLatest_22_X = exports.findHighestJavaVersion = exports.setUpGraalVMJDKDevBuild = exports.findLatestGraalVMJDKCEJavaVersion = exports.setUpGraalVMJDKCE = exports.setUpGraalVMJDK = void 0;
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const semver = __importStar(__nccwpck_require__(1383));
|
||||
const utils_1 = __nccwpck_require__(1314);
|
||||
const gds_1 = __nccwpck_require__(9543);
|
||||
const tool_cache_1 = __nccwpck_require__(7784);
|
||||
const path_1 = __nccwpck_require__(1017);
|
||||
const semver_1 = __nccwpck_require__(1383);
|
||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
||||
const GRAALVM_CE_DL_BASE = `https://github.com/graalvm/${c.GRAALVM_RELEASES_REPO}/releases/download`;
|
||||
const GRAALVM_REPO_DEV_BUILDS = 'graalvm-ce-dev-builds';
|
||||
@@ -71025,11 +71045,24 @@ function setUpGraalVMJDK(javaVersionOrDev) {
|
||||
return setUpGraalVMJDKDevBuild();
|
||||
}
|
||||
const javaVersion = javaVersionOrDev;
|
||||
const toolName = determineToolName(javaVersion, false);
|
||||
let toolName = determineToolName(javaVersion, false);
|
||||
let downloadUrl;
|
||||
if (javaVersion.includes('.')) {
|
||||
const majorJavaVersion = javaVersion.split('.')[0];
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${toolName}${c.GRAALVM_FILE_EXTENSION}`;
|
||||
if (semver.valid(javaVersion)) {
|
||||
const majorJavaVersion = semver.major(javaVersion);
|
||||
const minorJavaVersion = semver.minor(javaVersion);
|
||||
const patchJavaVersion = semver.patch(javaVersion);
|
||||
const isGARelease = minorJavaVersion === 0 && patchJavaVersion === 0;
|
||||
let downloadName = toolName;
|
||||
if (isGARelease) {
|
||||
// For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/)
|
||||
downloadName = determineToolName(majorJavaVersion.toString(), false);
|
||||
}
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${downloadName}${c.GRAALVM_FILE_EXTENSION}`;
|
||||
}
|
||||
else {
|
||||
throw new Error(`java-version set to '${javaVersion}'. Please make sure the java-version is set correctly. ${c.ERROR_HINT}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${toolName}${c.GRAALVM_FILE_EXTENSION}`;
|
||||
@@ -71066,8 +71099,8 @@ function findLatestGraalVMJDKCEJavaVersion(majorJavaVersion) {
|
||||
const versionNumberStartIndex = `refs/tags/${GRAALVM_JDK_TAG_PREFIX}`.length;
|
||||
for (const matchingRef of matchingRefs) {
|
||||
const currentVersion = matchingRef.ref.substring(versionNumberStartIndex);
|
||||
if ((0, semver_1.valid)(currentVersion) &&
|
||||
(0, semver_1.gt)(currentVersion, highestVersion)) {
|
||||
if (semver.valid(currentVersion) &&
|
||||
semver.gt(currentVersion, highestVersion)) {
|
||||
highestVersion = currentVersion;
|
||||
}
|
||||
}
|
||||
@@ -71129,7 +71162,7 @@ exports.findHighestJavaVersion = findHighestJavaVersion;
|
||||
// Support for GraalVM 22.X releases and earlier
|
||||
function setUpGraalVMLatest_22_X(gdsToken, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const lockedVersion = javaVersion === '19' ? '22.3.1' : '22.3.2';
|
||||
const lockedVersion = javaVersion === '19' ? '22.3.1' : '22.3.3';
|
||||
if (gdsToken.length > 0) {
|
||||
return setUpGraalVMRelease(gdsToken, lockedVersion, javaVersion);
|
||||
}
|
||||
@@ -71204,6 +71237,29 @@ function downloadGraalVMCELegacy(version, javaVersion) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
@@ -71215,6 +71271,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.setUpGUComponents = void 0;
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const semver = __importStar(__nccwpck_require__(1383));
|
||||
const constants_1 = __nccwpck_require__(9042);
|
||||
const utils_1 = __nccwpck_require__(1314);
|
||||
const path_1 = __nccwpck_require__(1017);
|
||||
@@ -71236,7 +71295,32 @@ const COMPONENT_TO_POST_INSTALL_HOOK = new Map([
|
||||
]
|
||||
// No post install hooks for Windows (yet)
|
||||
]);
|
||||
function setUpGUComponents(gdsToken, graalVMHome, components) {
|
||||
function setUpGUComponents(javaVersion, graalVMVersion, graalVMHome, components, gdsToken) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
if (components.length == 0) {
|
||||
return; // nothing to do
|
||||
}
|
||||
const coercedJavaVersion = semver.coerce(javaVersion);
|
||||
if (graalVMVersion === c.VERSION_DEV ||
|
||||
javaVersion === c.VERSION_DEV ||
|
||||
(coercedJavaVersion != null && semver.gte(coercedJavaVersion, '21.0.0'))) {
|
||||
if (components.length == 1 && components[0] === 'native-image') {
|
||||
core.warning(`Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995`);
|
||||
}
|
||||
else {
|
||||
core.warning(`Unable to install component(s): '${components.join(',')}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855`);
|
||||
}
|
||||
}
|
||||
else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
core.warning(`Mandrel does not support GraalVM component(s): '${components.join(',')}'`);
|
||||
}
|
||||
else {
|
||||
yield installGUComponents(gdsToken, graalVMHome, components);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.setUpGUComponents = setUpGUComponents;
|
||||
function installGUComponents(gdsToken, graalVMHome, components) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
yield (0, utils_1.exec)('gu', BASE_FLAGS.concat(components), {
|
||||
env: Object.assign(Object.assign({}, process.env), { GRAAL_EE_DOWNLOAD_TOKEN: gdsToken })
|
||||
@@ -71252,7 +71336,6 @@ function setUpGUComponents(gdsToken, graalVMHome, components) {
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.setUpGUComponents = setUpGUComponents;
|
||||
|
||||
|
||||
/***/ }),
|
||||
@@ -71298,7 +71381,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const graalvm = __importStar(__nccwpck_require__(5254));
|
||||
const semver_1 = __nccwpck_require__(1383);
|
||||
const semver = __importStar(__nccwpck_require__(1383));
|
||||
const cache_1 = __nccwpck_require__(7799);
|
||||
const path_1 = __nccwpck_require__(1017);
|
||||
const cache_2 = __nccwpck_require__(9179);
|
||||
@@ -71314,7 +71397,7 @@ function run() {
|
||||
try {
|
||||
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, { required: true });
|
||||
const distribution = core.getInput(c.INPUT_DISTRIBUTION);
|
||||
const graalvmVersion = core.getInput(c.INPUT_VERSION);
|
||||
const graalVMVersion = core.getInput(c.INPUT_VERSION);
|
||||
const gdsToken = core.getInput(c.INPUT_GDS_TOKEN);
|
||||
const componentsString = core.getInput(c.INPUT_COMPONENTS);
|
||||
const components = componentsString.length > 0
|
||||
@@ -71325,16 +71408,21 @@ function run() {
|
||||
const enableCheckForUpdates = core.getInput(c.INPUT_CHECK_FOR_UPDATES) === 'true';
|
||||
const enableNativeImageMusl = core.getInput(c.INPUT_NI_MUSL) === 'true';
|
||||
if (c.IS_WINDOWS) {
|
||||
(0, msvc_1.setUpWindowsEnvironment)(graalvmVersion);
|
||||
(0, msvc_1.setUpWindowsEnvironment)(graalVMVersion);
|
||||
}
|
||||
yield (0, dependencies_1.setUpDependencies)(components);
|
||||
if (enableNativeImageMusl) {
|
||||
yield (0, musl_1.setUpNativeImageMusl)();
|
||||
}
|
||||
// Download GraalVM JDK
|
||||
const isGraalVMforJDK17OrLater = distribution.length > 0 || graalvmVersion.length == 0;
|
||||
const isGraalVMforJDK17OrLater = distribution.length > 0 || graalVMVersion.length == 0;
|
||||
let graalVMHome;
|
||||
if (isGraalVMforJDK17OrLater) {
|
||||
if (enableCheckForUpdates &&
|
||||
(distribution === c.DISTRIBUTION_GRAALVM ||
|
||||
distribution === c.DISTRIBUTION_GRAALVM_COMMUNITY)) {
|
||||
(0, check_for_updates_1.checkForUpdates)(graalVMVersion, javaVersion);
|
||||
}
|
||||
switch (distribution) {
|
||||
case c.DISTRIBUTION_GRAALVM:
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDK(javaVersion);
|
||||
@@ -71343,12 +71431,7 @@ function run() {
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDKCE(javaVersion);
|
||||
break;
|
||||
case c.DISTRIBUTION_MANDREL:
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = yield (0, mandrel_1.setUpMandrel)(graalvmVersion, javaVersion);
|
||||
}
|
||||
else {
|
||||
throw new Error(`Mandrel requires the 'version' option (see https://github.com/graalvm/setup-graalvm/tree/main#options).`);
|
||||
}
|
||||
graalVMHome = yield (0, mandrel_1.setUpMandrel)(graalVMVersion, javaVersion);
|
||||
break;
|
||||
case '':
|
||||
if (javaVersion === c.VERSION_DEV) {
|
||||
@@ -71365,10 +71448,12 @@ function run() {
|
||||
}
|
||||
}
|
||||
else {
|
||||
switch (graalvmVersion) {
|
||||
const coercedJavaVersion = semver.coerce(javaVersion);
|
||||
switch (graalVMVersion) {
|
||||
case c.VERSION_LATEST:
|
||||
if (javaVersion.startsWith('17') ||
|
||||
((0, semver_1.valid)(javaVersion) && (0, semver_1.gte)(javaVersion, '20'))) {
|
||||
(coercedJavaVersion !== null &&
|
||||
semver.gte(coercedJavaVersion, '20.0.0'))) {
|
||||
core.info(`This build is using the new Oracle GraalVM. To select a specific distribution, use the 'distribution' option (see https://github.com/graalvm/setup-graalvm/tree/main#options).`);
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDK(javaVersion);
|
||||
}
|
||||
@@ -71380,17 +71465,24 @@ function run() {
|
||||
if (gdsToken.length > 0) {
|
||||
throw new Error('Downloading GraalVM EE dev builds is not supported');
|
||||
}
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDKDevBuild();
|
||||
if (coercedJavaVersion !== null &&
|
||||
!semver.gte(coercedJavaVersion, '21.0.0')) {
|
||||
core.warning(`GraalVM dev builds are only available for JDK 21. This build is now using a stable release of GraalVM for JDK ${javaVersion}.`);
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDK(javaVersion);
|
||||
}
|
||||
else {
|
||||
graalVMHome = yield graalvm.setUpGraalVMJDKDevBuild();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = yield (0, mandrel_1.setUpMandrel)(graalvmVersion, javaVersion);
|
||||
if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = yield (0, mandrel_1.setUpMandrel)(graalVMVersion, javaVersion);
|
||||
}
|
||||
else {
|
||||
if (enableCheckForUpdates) {
|
||||
yield (0, check_for_updates_1.checkForUpdates)(graalvmVersion, javaVersion);
|
||||
(0, check_for_updates_1.checkForUpdates)(graalVMVersion, javaVersion);
|
||||
}
|
||||
graalVMHome = yield graalvm.setUpGraalVMRelease(gdsToken, graalvmVersion, javaVersion);
|
||||
graalVMHome = yield graalvm.setUpGraalVMRelease(gdsToken, graalVMVersion, javaVersion);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -71402,19 +71494,11 @@ function run() {
|
||||
if (setJavaHome) {
|
||||
core.exportVariable('JAVA_HOME', graalVMHome);
|
||||
}
|
||||
// Set up GraalVM components (if any)
|
||||
if (components.length > 0) {
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
core.warning(`Mandrel does not support GraalVM components: ${componentsString}`);
|
||||
}
|
||||
else {
|
||||
yield (0, gu_1.setUpGUComponents)(gdsToken, graalVMHome, components);
|
||||
}
|
||||
}
|
||||
yield (0, gu_1.setUpGUComponents)(javaVersion, graalVMVersion, graalVMHome, components, gdsToken);
|
||||
if (cache && (0, cache_1.isFeatureAvailable)()) {
|
||||
yield (0, cache_2.restore)(cache);
|
||||
}
|
||||
(0, reports_1.setUpNativeImageBuildReports)(isGraalVMforJDK17OrLater, graalvmVersion);
|
||||
(0, reports_1.setUpNativeImageBuildReports)(isGraalVMforJDK17OrLater, graalVMVersion);
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error)
|
||||
@@ -71465,23 +71549,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.setUpMandrel = void 0;
|
||||
exports.stripMandrelNamespace = exports.getLatestMandrelReleaseUrl = exports.setUpMandrel = exports.MANDREL_TAG_PREFIX = exports.MANDREL_REPO = void 0;
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const httpClient = __importStar(__nccwpck_require__(9925));
|
||||
const utils_1 = __nccwpck_require__(1314);
|
||||
const tool_cache_1 = __nccwpck_require__(7784);
|
||||
const MANDREL_REPO = 'mandrel';
|
||||
const MANDREL_TAG_PREFIX = c.MANDREL_NAMESPACE;
|
||||
const path_1 = __nccwpck_require__(1017);
|
||||
exports.MANDREL_REPO = 'mandrel';
|
||||
exports.MANDREL_TAG_PREFIX = c.MANDREL_NAMESPACE;
|
||||
const MANDREL_DL_BASE = 'https://github.com/graalvm/mandrel/releases/download';
|
||||
function setUpMandrel(graalvmVersion, javaVersion) {
|
||||
const DISCO_API_BASE = 'https://api.foojay.io/disco/v3.0/packages/jdks';
|
||||
function setUpMandrel(mandrelVersion, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const mandrelVersion = graalvmVersion.substring(c.MANDREL_NAMESPACE.length, graalvmVersion.length);
|
||||
const version = stripMandrelNamespace(mandrelVersion);
|
||||
let mandrelHome;
|
||||
switch (mandrelVersion) {
|
||||
switch (version) {
|
||||
case '':
|
||||
// fetch latest if no version is specified
|
||||
case 'latest':
|
||||
mandrelHome = yield setUpMandrelLatest(javaVersion);
|
||||
break;
|
||||
default:
|
||||
mandrelHome = yield setUpMandrelRelease(mandrelVersion, javaVersion);
|
||||
mandrelHome = yield setUpMandrelRelease(version, javaVersion);
|
||||
break;
|
||||
}
|
||||
return mandrelHome;
|
||||
@@ -71490,21 +71579,79 @@ function setUpMandrel(graalvmVersion, javaVersion) {
|
||||
exports.setUpMandrel = setUpMandrel;
|
||||
function setUpMandrelLatest(javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const latestRelease = yield (0, utils_1.getLatestRelease)(MANDREL_REPO);
|
||||
const tag_name = latestRelease.tag_name;
|
||||
if (tag_name.startsWith(MANDREL_TAG_PREFIX)) {
|
||||
const latestVersion = tag_name.substring(MANDREL_TAG_PREFIX.length, tag_name.length);
|
||||
return setUpMandrelRelease(latestVersion, javaVersion);
|
||||
const latest_release_url = yield getLatestMandrelReleaseUrl(javaVersion);
|
||||
const version_tag = getTagFromURI(latest_release_url);
|
||||
const version = stripMandrelNamespace(version_tag);
|
||||
const toolName = determineToolName(javaVersion);
|
||||
return (0, utils_1.downloadExtractAndCacheJDK)(() => __awaiter(this, void 0, void 0, function* () { return (0, tool_cache_1.downloadTool)(latest_release_url); }), toolName, version);
|
||||
});
|
||||
}
|
||||
// Download URIs are of the form https://github.com/graalvm/mandrel/releases/download/<tag>/<archive-name>
|
||||
function getTagFromURI(uri) {
|
||||
const parts = uri.split('/');
|
||||
try {
|
||||
return parts[parts.length - 2];
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Failed to extract tag from URI ${uri}: ${error}`);
|
||||
}
|
||||
}
|
||||
function getLatestMandrelReleaseUrl(javaVersion) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const url = `${DISCO_API_BASE}?jdk_version=${javaVersion}&distribution=${c.DISTRIBUTION_MANDREL}&architecture=${c.JDK_ARCH}&operating_system=${c.JDK_PLATFORM}&latest=per_distro`;
|
||||
const _http = new httpClient.HttpClient();
|
||||
const response = yield _http.getJson(url);
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(`Failed to fetch latest Mandrel release for Java ${javaVersion} from DISCO API: ${response.result}`);
|
||||
}
|
||||
const result = (_a = response.result) === null || _a === void 0 ? void 0 : _a.result[0];
|
||||
try {
|
||||
const pkg_info_uri = result.links.pkg_info_uri;
|
||||
return yield getLatestMandrelReleaseUrlHelper(_http, javaVersion, pkg_info_uri);
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Failed to get latest Mandrel release for Java ${javaVersion} from DISCO API: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
exports.getLatestMandrelReleaseUrl = getLatestMandrelReleaseUrl;
|
||||
function getLatestMandrelReleaseUrlHelper(_http, java_version, pkg_info_uri) {
|
||||
var _a;
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const response = yield _http.getJson(pkg_info_uri);
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(`Failed to fetch package info of latest Mandrel release for Java ${java_version} from DISCO API: ${response.result}`);
|
||||
}
|
||||
const result = (_a = response.result) === null || _a === void 0 ? void 0 : _a.result[0];
|
||||
try {
|
||||
return result.direct_download_uri;
|
||||
}
|
||||
catch (error) {
|
||||
throw new Error(`Failed to get download URI of latest Mandrel release for Java ${java_version} from DISCO API: ${error}`);
|
||||
}
|
||||
throw new Error(`Could not find latest Mandrel release: ${tag_name}`);
|
||||
});
|
||||
}
|
||||
function setUpMandrelRelease(version, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const identifier = determineMandrelIdentifier(version, javaVersion);
|
||||
const downloadUrl = `${MANDREL_DL_BASE}/${MANDREL_TAG_PREFIX}${version}/${identifier}${c.GRAALVM_FILE_EXTENSION}`;
|
||||
const toolName = determineToolName(javaVersion);
|
||||
return (0, utils_1.downloadExtractAndCacheJDK)(() => __awaiter(this, void 0, void 0, function* () { return (0, tool_cache_1.downloadTool)(downloadUrl); }), toolName, version);
|
||||
return (0, utils_1.downloadExtractAndCacheJDK)(() => __awaiter(this, void 0, void 0, function* () { return downloadMandrelJDK(version, javaVersion); }), toolName, version);
|
||||
});
|
||||
}
|
||||
function downloadMandrelJDK(version, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const identifier = determineMandrelIdentifier(version, javaVersion);
|
||||
const downloadUrl = `${MANDREL_DL_BASE}/${exports.MANDREL_TAG_PREFIX}${version}/${identifier}${c.GRAALVM_FILE_EXTENSION}`;
|
||||
try {
|
||||
return yield (0, tool_cache_1.downloadTool)(downloadUrl);
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error && error.message.includes('404')) {
|
||||
// Not Found
|
||||
throw new Error(`Failed to download ${(0, path_1.basename)(downloadUrl)}. Are you sure version: '${version}' and java-version: '${javaVersion}' are correct?`);
|
||||
}
|
||||
throw new Error(`Failed to download ${(0, path_1.basename)(downloadUrl)} (error: ${error}).`);
|
||||
}
|
||||
});
|
||||
}
|
||||
function determineMandrelIdentifier(version, javaVersion) {
|
||||
@@ -71513,6 +71660,15 @@ function determineMandrelIdentifier(version, javaVersion) {
|
||||
function determineToolName(javaVersion) {
|
||||
return `mandrel-java${javaVersion}-${c.GRAALVM_PLATFORM}`;
|
||||
}
|
||||
function stripMandrelNamespace(graalVMVersion) {
|
||||
if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
return graalVMVersion.substring(c.MANDREL_NAMESPACE.length, graalVMVersion.length);
|
||||
}
|
||||
else {
|
||||
return graalVMVersion;
|
||||
}
|
||||
}
|
||||
exports.stripMandrelNamespace = stripMandrelNamespace;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
375
package-lock.json
generated
375
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.5",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.5",
|
||||
"license": "UPL",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.0.4",
|
||||
@@ -358,17 +358,89 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
|
||||
"integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
|
||||
"version": "7.22.13",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
|
||||
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/highlight": "^7.18.6"
|
||||
"@babel/highlight": "^7.22.13",
|
||||
"chalk": "^2.4.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-convert": "^1.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/code-frame/node_modules/supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"has-flag": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/compat-data": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.4.tgz",
|
||||
@@ -424,12 +496,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/generator": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz",
|
||||
"integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
|
||||
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.21.4",
|
||||
"@babel/types": "^7.23.0",
|
||||
"@jridgewell/gen-mapping": "^0.3.2",
|
||||
"@jridgewell/trace-mapping": "^0.3.17",
|
||||
"jsesc": "^2.5.1"
|
||||
@@ -467,34 +539,34 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-environment-visitor": {
|
||||
"version": "7.18.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
|
||||
"integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
|
||||
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-function-name": {
|
||||
"version": "7.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
|
||||
"integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
|
||||
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/template": "^7.20.7",
|
||||
"@babel/types": "^7.21.0"
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/types": "^7.23.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-hoist-variables": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
|
||||
"integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
|
||||
"integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.18.6"
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -553,30 +625,30 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-split-export-declaration": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
|
||||
"integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
|
||||
"version": "7.22.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
|
||||
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.18.6"
|
||||
"@babel/types": "^7.22.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.19.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
|
||||
"integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
|
||||
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
|
||||
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
|
||||
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
@@ -606,13 +678,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/highlight": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
|
||||
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
|
||||
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-validator-identifier": "^7.18.6",
|
||||
"chalk": "^2.0.0",
|
||||
"@babel/helper-validator-identifier": "^7.22.20",
|
||||
"chalk": "^2.4.2",
|
||||
"js-tokens": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -691,9 +763,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
|
||||
"integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
|
||||
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
@@ -892,33 +964,33 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/template": {
|
||||
"version": "7.20.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
|
||||
"integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
|
||||
"version": "7.22.15",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
|
||||
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.18.6",
|
||||
"@babel/parser": "^7.20.7",
|
||||
"@babel/types": "^7.20.7"
|
||||
"@babel/code-frame": "^7.22.13",
|
||||
"@babel/parser": "^7.22.15",
|
||||
"@babel/types": "^7.22.15"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/traverse": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
|
||||
"integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
|
||||
"version": "7.23.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
|
||||
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.21.4",
|
||||
"@babel/generator": "^7.21.4",
|
||||
"@babel/helper-environment-visitor": "^7.18.9",
|
||||
"@babel/helper-function-name": "^7.21.0",
|
||||
"@babel/helper-hoist-variables": "^7.18.6",
|
||||
"@babel/helper-split-export-declaration": "^7.18.6",
|
||||
"@babel/parser": "^7.21.4",
|
||||
"@babel/types": "^7.21.4",
|
||||
"@babel/code-frame": "^7.22.13",
|
||||
"@babel/generator": "^7.23.0",
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
"@babel/helper-function-name": "^7.23.0",
|
||||
"@babel/helper-hoist-variables": "^7.22.5",
|
||||
"@babel/helper-split-export-declaration": "^7.22.6",
|
||||
"@babel/parser": "^7.23.0",
|
||||
"@babel/types": "^7.23.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
@@ -936,13 +1008,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
|
||||
"integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
|
||||
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.19.4",
|
||||
"@babel/helper-validator-identifier": "^7.19.1",
|
||||
"@babel/helper-string-parser": "^7.22.5",
|
||||
"@babel/helper-validator-identifier": "^7.22.20",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
@@ -7572,12 +7644,71 @@
|
||||
}
|
||||
},
|
||||
"@babel/code-frame": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
|
||||
"integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
|
||||
"version": "7.22.13",
|
||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
|
||||
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/highlight": "^7.18.6"
|
||||
"@babel/highlight": "^7.22.13",
|
||||
"chalk": "^2.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-convert": "^1.9.0"
|
||||
}
|
||||
},
|
||||
"chalk": {
|
||||
"version": "2.4.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"ansi-styles": "^3.2.1",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"supports-color": "^5.3.0"
|
||||
}
|
||||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"color-name": "1.1.3"
|
||||
}
|
||||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
|
||||
"dev": true
|
||||
},
|
||||
"escape-string-regexp": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
||||
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
||||
"dev": true
|
||||
},
|
||||
"has-flag": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
||||
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
||||
"dev": true
|
||||
},
|
||||
"supports-color": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
||||
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"has-flag": "^3.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"@babel/compat-data": {
|
||||
@@ -7624,12 +7755,12 @@
|
||||
}
|
||||
},
|
||||
"@babel/generator": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz",
|
||||
"integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
|
||||
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.21.4",
|
||||
"@babel/types": "^7.23.0",
|
||||
"@jridgewell/gen-mapping": "^0.3.2",
|
||||
"@jridgewell/trace-mapping": "^0.3.17",
|
||||
"jsesc": "^2.5.1"
|
||||
@@ -7657,28 +7788,28 @@
|
||||
}
|
||||
},
|
||||
"@babel/helper-environment-visitor": {
|
||||
"version": "7.18.9",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz",
|
||||
"integrity": "sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
|
||||
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/helper-function-name": {
|
||||
"version": "7.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
|
||||
"integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
|
||||
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/template": "^7.20.7",
|
||||
"@babel/types": "^7.21.0"
|
||||
"@babel/template": "^7.22.15",
|
||||
"@babel/types": "^7.23.0"
|
||||
}
|
||||
},
|
||||
"@babel/helper-hoist-variables": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
|
||||
"integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
|
||||
"integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.18.6"
|
||||
"@babel/types": "^7.22.5"
|
||||
}
|
||||
},
|
||||
"@babel/helper-module-imports": {
|
||||
@@ -7722,24 +7853,24 @@
|
||||
}
|
||||
},
|
||||
"@babel/helper-split-export-declaration": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
|
||||
"integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
|
||||
"version": "7.22.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
|
||||
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/types": "^7.18.6"
|
||||
"@babel/types": "^7.22.5"
|
||||
}
|
||||
},
|
||||
"@babel/helper-string-parser": {
|
||||
"version": "7.19.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz",
|
||||
"integrity": "sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==",
|
||||
"version": "7.22.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
|
||||
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/helper-validator-identifier": {
|
||||
"version": "7.19.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
|
||||
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
|
||||
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/helper-validator-option": {
|
||||
@@ -7760,13 +7891,13 @@
|
||||
}
|
||||
},
|
||||
"@babel/highlight": {
|
||||
"version": "7.18.6",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
|
||||
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
|
||||
"version": "7.22.20",
|
||||
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
|
||||
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-validator-identifier": "^7.18.6",
|
||||
"chalk": "^2.0.0",
|
||||
"@babel/helper-validator-identifier": "^7.22.20",
|
||||
"chalk": "^2.4.2",
|
||||
"js-tokens": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
@@ -7829,9 +7960,9 @@
|
||||
}
|
||||
},
|
||||
"@babel/parser": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
|
||||
"integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
|
||||
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
|
||||
"dev": true
|
||||
},
|
||||
"@babel/plugin-syntax-async-generators": {
|
||||
@@ -7970,30 +8101,30 @@
|
||||
}
|
||||
},
|
||||
"@babel/template": {
|
||||
"version": "7.20.7",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
|
||||
"integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
|
||||
"version": "7.22.15",
|
||||
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
|
||||
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.18.6",
|
||||
"@babel/parser": "^7.20.7",
|
||||
"@babel/types": "^7.20.7"
|
||||
"@babel/code-frame": "^7.22.13",
|
||||
"@babel/parser": "^7.22.15",
|
||||
"@babel/types": "^7.22.15"
|
||||
}
|
||||
},
|
||||
"@babel/traverse": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
|
||||
"integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
|
||||
"version": "7.23.2",
|
||||
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
|
||||
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.21.4",
|
||||
"@babel/generator": "^7.21.4",
|
||||
"@babel/helper-environment-visitor": "^7.18.9",
|
||||
"@babel/helper-function-name": "^7.21.0",
|
||||
"@babel/helper-hoist-variables": "^7.18.6",
|
||||
"@babel/helper-split-export-declaration": "^7.18.6",
|
||||
"@babel/parser": "^7.21.4",
|
||||
"@babel/types": "^7.21.4",
|
||||
"@babel/code-frame": "^7.22.13",
|
||||
"@babel/generator": "^7.23.0",
|
||||
"@babel/helper-environment-visitor": "^7.22.20",
|
||||
"@babel/helper-function-name": "^7.23.0",
|
||||
"@babel/helper-hoist-variables": "^7.22.5",
|
||||
"@babel/helper-split-export-declaration": "^7.22.6",
|
||||
"@babel/parser": "^7.23.0",
|
||||
"@babel/types": "^7.23.0",
|
||||
"debug": "^4.1.0",
|
||||
"globals": "^11.1.0"
|
||||
},
|
||||
@@ -8007,13 +8138,13 @@
|
||||
}
|
||||
},
|
||||
"@babel/types": {
|
||||
"version": "7.21.4",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
|
||||
"integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
|
||||
"version": "7.23.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
|
||||
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/helper-string-parser": "^7.19.4",
|
||||
"@babel/helper-validator-identifier": "^7.19.1",
|
||||
"@babel/helper-string-parser": "^7.22.5",
|
||||
"@babel/helper-validator-identifier": "^7.22.20",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "setup-graalvm",
|
||||
"version": "1.1.2",
|
||||
"version": "1.1.5",
|
||||
"private": true,
|
||||
"description": "GitHub Action for GraalVM",
|
||||
"main": "lib/main.js",
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import * as core from '@actions/core'
|
||||
|
||||
export async function checkForUpdates(
|
||||
export function checkForUpdates(
|
||||
graalVMVersion: string,
|
||||
javaVersion: string
|
||||
): Promise<void> {
|
||||
): void {
|
||||
if (javaVersion === '20') {
|
||||
core.notice(
|
||||
'A new GraalVM release is available! Please consider upgrading to GraalVM for JDK 21: https://medium.com/graalvm/graalvm-for-jdk-21-is-here-ee01177dd12d'
|
||||
)
|
||||
return
|
||||
}
|
||||
if (
|
||||
graalVMVersion.length > 0 &&
|
||||
(javaVersion === '17' || javaVersion === '19')
|
||||
) {
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '20'
|
||||
const recommendedJDK = javaVersion === '17' ? '17' : '21'
|
||||
core.notice(
|
||||
`A new GraalVM release is available! Please consider upgrading to GraalVM for JDK ${recommendedJDK}. Instructions: https://github.com/graalvm/setup-graalvm#migrating-from-graalvm-223-or-earlier-to-the-new-graalvm-for-jdk-17-and-later`
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ export async function downloadGraalVMEELegacy(
|
||||
version: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const userAgent = `GraalVMGitHubAction/1.1.2 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`
|
||||
const userAgent = `GraalVMGitHubAction/1.1.5 (arch:${c.GRAALVM_ARCH}; os:${c.GRAALVM_PLATFORM}; java:${javaVersion})`
|
||||
const baseArtifact = await fetchArtifact(
|
||||
userAgent,
|
||||
'isBase:True',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import * as c from './constants'
|
||||
import * as semver from 'semver'
|
||||
import {
|
||||
downloadAndExtractJDK,
|
||||
downloadExtractAndCacheJDK,
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
import {downloadGraalVMEELegacy} from './gds'
|
||||
import {downloadTool} from '@actions/tool-cache'
|
||||
import {basename} from 'path'
|
||||
import {gt as semverGt, valid as semverValid} from 'semver'
|
||||
|
||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm'
|
||||
const GRAALVM_CE_DL_BASE = `https://github.com/graalvm/${c.GRAALVM_RELEASES_REPO}/releases/download`
|
||||
@@ -26,11 +26,25 @@ export async function setUpGraalVMJDK(
|
||||
return setUpGraalVMJDKDevBuild()
|
||||
}
|
||||
const javaVersion = javaVersionOrDev
|
||||
const toolName = determineToolName(javaVersion, false)
|
||||
let toolName = determineToolName(javaVersion, false)
|
||||
let downloadUrl: string
|
||||
if (javaVersion.includes('.')) {
|
||||
const majorJavaVersion = javaVersion.split('.')[0]
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${toolName}${c.GRAALVM_FILE_EXTENSION}`
|
||||
if (semver.valid(javaVersion)) {
|
||||
const majorJavaVersion = semver.major(javaVersion)
|
||||
const minorJavaVersion = semver.minor(javaVersion)
|
||||
const patchJavaVersion = semver.patch(javaVersion)
|
||||
const isGARelease = minorJavaVersion === 0 && patchJavaVersion === 0
|
||||
let downloadName = toolName
|
||||
if (isGARelease) {
|
||||
// For GA versions of JDKs, /archive/ does not use minor and patch version (see https://www.oracle.com/java/technologies/jdk-script-friendly-urls/)
|
||||
downloadName = determineToolName(majorJavaVersion.toString(), false)
|
||||
}
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${majorJavaVersion}/archive/${downloadName}${c.GRAALVM_FILE_EXTENSION}`
|
||||
} else {
|
||||
throw new Error(
|
||||
`java-version set to '${javaVersion}'. Please make sure the java-version is set correctly. ${c.ERROR_HINT}`
|
||||
)
|
||||
}
|
||||
} else {
|
||||
downloadUrl = `${GRAALVM_DL_BASE}/${javaVersion}/latest/${toolName}${c.GRAALVM_FILE_EXTENSION}`
|
||||
}
|
||||
@@ -71,8 +85,8 @@ export async function findLatestGraalVMJDKCEJavaVersion(
|
||||
for (const matchingRef of matchingRefs) {
|
||||
const currentVersion = matchingRef.ref.substring(versionNumberStartIndex)
|
||||
if (
|
||||
semverValid(currentVersion) &&
|
||||
semverGt(currentVersion, highestVersion)
|
||||
semver.valid(currentVersion) &&
|
||||
semver.gt(currentVersion, highestVersion)
|
||||
) {
|
||||
highestVersion = currentVersion
|
||||
}
|
||||
@@ -164,7 +178,7 @@ export async function setUpGraalVMLatest_22_X(
|
||||
gdsToken: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const lockedVersion = javaVersion === '19' ? '22.3.1' : '22.3.2'
|
||||
const lockedVersion = javaVersion === '19' ? '22.3.1' : '22.3.3'
|
||||
if (gdsToken.length > 0) {
|
||||
return setUpGraalVMRelease(gdsToken, lockedVersion, javaVersion)
|
||||
}
|
||||
|
||||
39
src/gu.ts
39
src/gu.ts
@@ -1,3 +1,6 @@
|
||||
import * as c from './constants'
|
||||
import * as core from '@actions/core'
|
||||
import * as semver from 'semver'
|
||||
import {GRAALVM_PLATFORM} from './constants'
|
||||
import {exec} from './utils'
|
||||
import {join} from 'path'
|
||||
@@ -22,6 +25,42 @@ const COMPONENT_TO_POST_INSTALL_HOOK = new Map<string, Map<string, string>>([
|
||||
])
|
||||
|
||||
export async function setUpGUComponents(
|
||||
javaVersion: string,
|
||||
graalVMVersion: string,
|
||||
graalVMHome: string,
|
||||
components: string[],
|
||||
gdsToken: string
|
||||
): Promise<void> {
|
||||
if (components.length == 0) {
|
||||
return // nothing to do
|
||||
}
|
||||
const coercedJavaVersion = semver.coerce(javaVersion)
|
||||
if (
|
||||
graalVMVersion === c.VERSION_DEV ||
|
||||
javaVersion === c.VERSION_DEV ||
|
||||
(coercedJavaVersion != null && semver.gte(coercedJavaVersion, '21.0.0'))
|
||||
) {
|
||||
if (components.length == 1 && components[0] === 'native-image') {
|
||||
core.warning(
|
||||
`Please remove "components: 'native-image'" from your workflow file. It is automatically included since GraalVM for JDK 17: https://github.com/oracle/graal/pull/5995`
|
||||
)
|
||||
} else {
|
||||
core.warning(
|
||||
`Unable to install component(s): '${components.join(
|
||||
','
|
||||
)}'. The latest GraalVM dev builds and the upcoming GraalVM for JDK 21 no longer include the GraalVM Updater: https://github.com/oracle/graal/issues/6855`
|
||||
)
|
||||
}
|
||||
} else if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
core.warning(
|
||||
`Mandrel does not support GraalVM component(s): '${components.join(',')}'`
|
||||
)
|
||||
} else {
|
||||
await installGUComponents(gdsToken, graalVMHome, components)
|
||||
}
|
||||
}
|
||||
|
||||
async function installGUComponents(
|
||||
gdsToken: string,
|
||||
graalVMHome: string,
|
||||
components: string[]
|
||||
|
||||
68
src/main.ts
68
src/main.ts
@@ -1,7 +1,7 @@
|
||||
import * as c from './constants'
|
||||
import * as core from '@actions/core'
|
||||
import * as graalvm from './graalvm'
|
||||
import {gte as semverGte, valid as semverValid} from 'semver'
|
||||
import * as semver from 'semver'
|
||||
import {isFeatureAvailable as isCacheAvailable} from '@actions/cache'
|
||||
import {join} from 'path'
|
||||
import {restore} from './features/cache'
|
||||
@@ -17,7 +17,7 @@ async function run(): Promise<void> {
|
||||
try {
|
||||
const javaVersion = core.getInput(c.INPUT_JAVA_VERSION, {required: true})
|
||||
const distribution = core.getInput(c.INPUT_DISTRIBUTION)
|
||||
const graalvmVersion = core.getInput(c.INPUT_VERSION)
|
||||
const graalVMVersion = core.getInput(c.INPUT_VERSION)
|
||||
const gdsToken = core.getInput(c.INPUT_GDS_TOKEN)
|
||||
const componentsString: string = core.getInput(c.INPUT_COMPONENTS)
|
||||
const components: string[] =
|
||||
@@ -31,7 +31,7 @@ async function run(): Promise<void> {
|
||||
const enableNativeImageMusl = core.getInput(c.INPUT_NI_MUSL) === 'true'
|
||||
|
||||
if (c.IS_WINDOWS) {
|
||||
setUpWindowsEnvironment(graalvmVersion)
|
||||
setUpWindowsEnvironment(graalVMVersion)
|
||||
}
|
||||
await setUpDependencies(components)
|
||||
if (enableNativeImageMusl) {
|
||||
@@ -40,9 +40,16 @@ async function run(): Promise<void> {
|
||||
|
||||
// Download GraalVM JDK
|
||||
const isGraalVMforJDK17OrLater =
|
||||
distribution.length > 0 || graalvmVersion.length == 0
|
||||
distribution.length > 0 || graalVMVersion.length == 0
|
||||
let graalVMHome
|
||||
if (isGraalVMforJDK17OrLater) {
|
||||
if (
|
||||
enableCheckForUpdates &&
|
||||
(distribution === c.DISTRIBUTION_GRAALVM ||
|
||||
distribution === c.DISTRIBUTION_GRAALVM_COMMUNITY)
|
||||
) {
|
||||
checkForUpdates(graalVMVersion, javaVersion)
|
||||
}
|
||||
switch (distribution) {
|
||||
case c.DISTRIBUTION_GRAALVM:
|
||||
graalVMHome = await graalvm.setUpGraalVMJDK(javaVersion)
|
||||
@@ -51,13 +58,7 @@ async function run(): Promise<void> {
|
||||
graalVMHome = await graalvm.setUpGraalVMJDKCE(javaVersion)
|
||||
break
|
||||
case c.DISTRIBUTION_MANDREL:
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = await setUpMandrel(graalvmVersion, javaVersion)
|
||||
} else {
|
||||
throw new Error(
|
||||
`Mandrel requires the 'version' option (see https://github.com/graalvm/setup-graalvm/tree/main#options).`
|
||||
)
|
||||
}
|
||||
graalVMHome = await setUpMandrel(graalVMVersion, javaVersion)
|
||||
break
|
||||
case '':
|
||||
if (javaVersion === c.VERSION_DEV) {
|
||||
@@ -76,11 +77,13 @@ async function run(): Promise<void> {
|
||||
throw new Error(`Unsupported distribution: ${distribution}`)
|
||||
}
|
||||
} else {
|
||||
switch (graalvmVersion) {
|
||||
const coercedJavaVersion = semver.coerce(javaVersion)
|
||||
switch (graalVMVersion) {
|
||||
case c.VERSION_LATEST:
|
||||
if (
|
||||
javaVersion.startsWith('17') ||
|
||||
(semverValid(javaVersion) && semverGte(javaVersion, '20'))
|
||||
(coercedJavaVersion !== null &&
|
||||
semver.gte(coercedJavaVersion, '20.0.0'))
|
||||
) {
|
||||
core.info(
|
||||
`This build is using the new Oracle GraalVM. To select a specific distribution, use the 'distribution' option (see https://github.com/graalvm/setup-graalvm/tree/main#options).`
|
||||
@@ -99,18 +102,28 @@ async function run(): Promise<void> {
|
||||
'Downloading GraalVM EE dev builds is not supported'
|
||||
)
|
||||
}
|
||||
graalVMHome = await graalvm.setUpGraalVMJDKDevBuild()
|
||||
if (
|
||||
coercedJavaVersion !== null &&
|
||||
!semver.gte(coercedJavaVersion, '21.0.0')
|
||||
) {
|
||||
core.warning(
|
||||
`GraalVM dev builds are only available for JDK 21. This build is now using a stable release of GraalVM for JDK ${javaVersion}.`
|
||||
)
|
||||
graalVMHome = await graalvm.setUpGraalVMJDK(javaVersion)
|
||||
} else {
|
||||
graalVMHome = await graalvm.setUpGraalVMJDKDevBuild()
|
||||
}
|
||||
break
|
||||
default:
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = await setUpMandrel(graalvmVersion, javaVersion)
|
||||
if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
graalVMHome = await setUpMandrel(graalVMVersion, javaVersion)
|
||||
} else {
|
||||
if (enableCheckForUpdates) {
|
||||
await checkForUpdates(graalvmVersion, javaVersion)
|
||||
checkForUpdates(graalVMVersion, javaVersion)
|
||||
}
|
||||
graalVMHome = await graalvm.setUpGraalVMRelease(
|
||||
gdsToken,
|
||||
graalvmVersion,
|
||||
graalVMVersion,
|
||||
javaVersion
|
||||
)
|
||||
}
|
||||
@@ -126,21 +139,18 @@ async function run(): Promise<void> {
|
||||
core.exportVariable('JAVA_HOME', graalVMHome)
|
||||
}
|
||||
|
||||
// Set up GraalVM components (if any)
|
||||
if (components.length > 0) {
|
||||
if (graalvmVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
core.warning(
|
||||
`Mandrel does not support GraalVM components: ${componentsString}`
|
||||
)
|
||||
} else {
|
||||
await setUpGUComponents(gdsToken, graalVMHome, components)
|
||||
}
|
||||
}
|
||||
await setUpGUComponents(
|
||||
javaVersion,
|
||||
graalVMVersion,
|
||||
graalVMHome,
|
||||
components,
|
||||
gdsToken
|
||||
)
|
||||
|
||||
if (cache && isCacheAvailable()) {
|
||||
await restore(cache)
|
||||
}
|
||||
setUpNativeImageBuildReports(isGraalVMforJDK17OrLater, graalvmVersion)
|
||||
setUpNativeImageBuildReports(isGraalVMforJDK17OrLater, graalVMVersion)
|
||||
} catch (error) {
|
||||
if (error instanceof Error) core.setFailed(error.message)
|
||||
}
|
||||
|
||||
139
src/mandrel.ts
139
src/mandrel.ts
@@ -1,27 +1,33 @@
|
||||
import * as c from './constants'
|
||||
import * as httpClient from '@actions/http-client'
|
||||
import {downloadExtractAndCacheJDK, getLatestRelease} from './utils'
|
||||
import {downloadTool} from '@actions/tool-cache'
|
||||
import {basename} from 'path'
|
||||
|
||||
const MANDREL_REPO = 'mandrel'
|
||||
const MANDREL_TAG_PREFIX = c.MANDREL_NAMESPACE
|
||||
export const MANDREL_REPO = 'mandrel'
|
||||
export const MANDREL_TAG_PREFIX = c.MANDREL_NAMESPACE
|
||||
const MANDREL_DL_BASE = 'https://github.com/graalvm/mandrel/releases/download'
|
||||
const DISCO_API_BASE = 'https://api.foojay.io/disco/v3.0/packages/jdks'
|
||||
|
||||
interface JdkData {
|
||||
message: string
|
||||
result: any
|
||||
}
|
||||
|
||||
export async function setUpMandrel(
|
||||
graalvmVersion: string,
|
||||
mandrelVersion: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const mandrelVersion = graalvmVersion.substring(
|
||||
c.MANDREL_NAMESPACE.length,
|
||||
graalvmVersion.length
|
||||
)
|
||||
|
||||
const version = stripMandrelNamespace(mandrelVersion)
|
||||
let mandrelHome
|
||||
switch (mandrelVersion) {
|
||||
switch (version) {
|
||||
case '':
|
||||
// fetch latest if no version is specified
|
||||
case 'latest':
|
||||
mandrelHome = await setUpMandrelLatest(javaVersion)
|
||||
break
|
||||
default:
|
||||
mandrelHome = await setUpMandrelRelease(mandrelVersion, javaVersion)
|
||||
mandrelHome = await setUpMandrelRelease(version, javaVersion)
|
||||
break
|
||||
}
|
||||
|
||||
@@ -29,32 +35,110 @@ export async function setUpMandrel(
|
||||
}
|
||||
|
||||
async function setUpMandrelLatest(javaVersion: string): Promise<string> {
|
||||
const latestRelease = await getLatestRelease(MANDREL_REPO)
|
||||
const tag_name = latestRelease.tag_name
|
||||
if (tag_name.startsWith(MANDREL_TAG_PREFIX)) {
|
||||
const latestVersion = tag_name.substring(
|
||||
MANDREL_TAG_PREFIX.length,
|
||||
tag_name.length
|
||||
)
|
||||
return setUpMandrelRelease(latestVersion, javaVersion)
|
||||
const latest_release_url = await getLatestMandrelReleaseUrl(javaVersion)
|
||||
const version_tag = getTagFromURI(latest_release_url)
|
||||
const version = stripMandrelNamespace(version_tag)
|
||||
|
||||
const toolName = determineToolName(javaVersion)
|
||||
return downloadExtractAndCacheJDK(
|
||||
async () => downloadTool(latest_release_url),
|
||||
toolName,
|
||||
version
|
||||
)
|
||||
}
|
||||
|
||||
// Download URIs are of the form https://github.com/graalvm/mandrel/releases/download/<tag>/<archive-name>
|
||||
function getTagFromURI(uri: string): string {
|
||||
const parts = uri.split('/')
|
||||
try {
|
||||
return parts[parts.length - 2]
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to extract tag from URI ${uri}: ${error}`)
|
||||
}
|
||||
}
|
||||
|
||||
export async function getLatestMandrelReleaseUrl(
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const url = `${DISCO_API_BASE}?jdk_version=${javaVersion}&distribution=${c.DISTRIBUTION_MANDREL}&architecture=${c.JDK_ARCH}&operating_system=${c.JDK_PLATFORM}&latest=per_distro`
|
||||
const _http = new httpClient.HttpClient()
|
||||
const response = await _http.getJson<JdkData>(url)
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(
|
||||
`Failed to fetch latest Mandrel release for Java ${javaVersion} from DISCO API: ${response.result}`
|
||||
)
|
||||
}
|
||||
const result = response.result?.result[0]
|
||||
try {
|
||||
const pkg_info_uri = result.links.pkg_info_uri
|
||||
return await getLatestMandrelReleaseUrlHelper(
|
||||
_http,
|
||||
javaVersion,
|
||||
pkg_info_uri
|
||||
)
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Failed to get latest Mandrel release for Java ${javaVersion} from DISCO API: ${error}`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
async function getLatestMandrelReleaseUrlHelper(
|
||||
_http: httpClient.HttpClient,
|
||||
java_version: string,
|
||||
pkg_info_uri: string
|
||||
): Promise<string> {
|
||||
const response = await _http.getJson<JdkData>(pkg_info_uri)
|
||||
if (response.statusCode !== 200) {
|
||||
throw new Error(
|
||||
`Failed to fetch package info of latest Mandrel release for Java ${java_version} from DISCO API: ${response.result}`
|
||||
)
|
||||
}
|
||||
const result = response.result?.result[0]
|
||||
try {
|
||||
return result.direct_download_uri
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Failed to get download URI of latest Mandrel release for Java ${java_version} from DISCO API: ${error}`
|
||||
)
|
||||
}
|
||||
throw new Error(`Could not find latest Mandrel release: ${tag_name}`)
|
||||
}
|
||||
|
||||
async function setUpMandrelRelease(
|
||||
version: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const identifier = determineMandrelIdentifier(version, javaVersion)
|
||||
const downloadUrl = `${MANDREL_DL_BASE}/${MANDREL_TAG_PREFIX}${version}/${identifier}${c.GRAALVM_FILE_EXTENSION}`
|
||||
const toolName = determineToolName(javaVersion)
|
||||
return downloadExtractAndCacheJDK(
|
||||
async () => downloadTool(downloadUrl),
|
||||
async () => downloadMandrelJDK(version, javaVersion),
|
||||
toolName,
|
||||
version
|
||||
)
|
||||
}
|
||||
|
||||
async function downloadMandrelJDK(
|
||||
version: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const identifier = determineMandrelIdentifier(version, javaVersion)
|
||||
const downloadUrl = `${MANDREL_DL_BASE}/${MANDREL_TAG_PREFIX}${version}/${identifier}${c.GRAALVM_FILE_EXTENSION}`
|
||||
try {
|
||||
return await downloadTool(downloadUrl)
|
||||
} catch (error) {
|
||||
if (error instanceof Error && error.message.includes('404')) {
|
||||
// Not Found
|
||||
throw new Error(
|
||||
`Failed to download ${basename(
|
||||
downloadUrl
|
||||
)}. Are you sure version: '${version}' and java-version: '${javaVersion}' are correct?`
|
||||
)
|
||||
}
|
||||
throw new Error(
|
||||
`Failed to download ${basename(downloadUrl)} (error: ${error}).`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function determineMandrelIdentifier(
|
||||
version: string,
|
||||
javaVersion: string
|
||||
@@ -65,3 +149,14 @@ function determineMandrelIdentifier(
|
||||
function determineToolName(javaVersion: string): string {
|
||||
return `mandrel-java${javaVersion}-${c.GRAALVM_PLATFORM}`
|
||||
}
|
||||
|
||||
export function stripMandrelNamespace(graalVMVersion: string) {
|
||||
if (graalVMVersion.startsWith(c.MANDREL_NAMESPACE)) {
|
||||
return graalVMVersion.substring(
|
||||
c.MANDREL_NAMESPACE.length,
|
||||
graalVMVersion.length
|
||||
)
|
||||
} else {
|
||||
return graalVMVersion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user