mirror of
https://github.com/actions/setup-java.git
synced 2025-11-26 17:09:09 +08:00
Compare commits
5 Commits
dependabot
...
4e7e684fbb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e7e684fbb | ||
|
|
46c56d6f92 | ||
|
|
66b945764b | ||
|
|
6ba5449b7d | ||
|
|
de5a937a1d |
18
.github/workflows/e2e-cache.yml
vendored
18
.github/workflows/e2e-cache.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -46,7 +46,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
needs: gradle-save
|
needs: gradle-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -93,7 +93,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
needs: maven-save
|
needs: maven-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -121,7 +121,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-22.04]
|
os: [macos-15-intel, windows-latest, ubuntu-22.04]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -133,7 +133,7 @@ jobs:
|
|||||||
java-version: '11'
|
java-version: '11'
|
||||||
cache: sbt
|
cache: sbt
|
||||||
- name: Setup SBT
|
- name: Setup SBT
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-15-intel'
|
||||||
run: |
|
run: |
|
||||||
echo ""Installing SBT...""
|
echo ""Installing SBT...""
|
||||||
brew install sbt
|
brew install sbt
|
||||||
@@ -141,7 +141,7 @@ jobs:
|
|||||||
run: sbt update
|
run: sbt update
|
||||||
|
|
||||||
- name: Check files to cache on macos-latest
|
- name: Check files to cache on macos-latest
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-15-intel'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
if [ ! -d ~/Library/Caches/Coursier ]; then
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
||||||
@@ -170,7 +170,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-22.04]
|
os: [macos-15-intel, windows-latest, ubuntu-22.04]
|
||||||
needs: sbt-save
|
needs: sbt-save
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -184,7 +184,7 @@ jobs:
|
|||||||
cache: sbt
|
cache: sbt
|
||||||
|
|
||||||
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
- name: Confirm that ~/Library/Caches/Coursier directory has been made
|
||||||
if: matrix.os == 'macos-13'
|
if: matrix.os == 'macos-15-intel'
|
||||||
run: |
|
run: |
|
||||||
if [ ! -d ~/Library/Caches/Coursier ]; then
|
if [ ! -d ~/Library/Caches/Coursier ]; then
|
||||||
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
echo "::error::The ~/Library/Caches/Coursier directory does not exist unexpectedly"
|
||||||
|
|||||||
26
.github/workflows/e2e-versions.yml
vendored
26
.github/workflows/e2e-versions.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
distribution: [
|
distribution: [
|
||||||
'temurin',
|
'temurin',
|
||||||
'adopt',
|
'adopt',
|
||||||
@@ -39,10 +39,19 @@ jobs:
|
|||||||
- distribution: microsoft
|
- distribution: microsoft
|
||||||
version: 8
|
version: 8
|
||||||
- distribution: dragonwell
|
- distribution: dragonwell
|
||||||
os: macos-13
|
os: macos-15-intel
|
||||||
include:
|
include:
|
||||||
|
- distribution: microsoft
|
||||||
|
os: windows-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: microsoft
|
||||||
|
os: ubuntu-latest
|
||||||
|
version: 25
|
||||||
|
- distribution: microsoft
|
||||||
|
os: macos-latest
|
||||||
|
version: 25
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: macos-13
|
os: macos-15-intel
|
||||||
version: 17
|
version: 17
|
||||||
- distribution: oracle
|
- distribution: oracle
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
@@ -220,7 +229,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
version: ['17-ea', '15.0.0-ea.14']
|
version: ['17-ea', '15.0.0-ea.14']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -286,7 +295,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-13, windows-latest, ubuntu-latest]
|
os: [macos-15-intel, windows-latest, ubuntu-latest]
|
||||||
distribution:
|
distribution:
|
||||||
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
|
['temurin', 'zulu', 'liberica', 'semeru', 'sapmachine', 'jetbrains']
|
||||||
java-package: ['jre']
|
java-package: ['jre']
|
||||||
@@ -481,14 +490,14 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
setup-java-version-from-file-major-minor-patch-with-dist:
|
setup-java-version-from-file-major-minor-patch-with-dist:
|
||||||
name: ${{ matrix.distribution }} version from file 'openjdk64-17.0.10' - ${{ matrix.os }}
|
name: ${{ matrix.distribution }} version from file '${{ matrix.java-version-file }}' - ${{ matrix.os }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [macos-latest, windows-latest, ubuntu-latest]
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
||||||
distribution: ['adopt', 'zulu', 'liberica']
|
distribution: ['adopt', 'zulu', 'liberica']
|
||||||
java-version-file: ['.java-version', '.tool-versions']
|
java-version-file: ['.java-version', '.tool-versions', '.sdkmanrc']
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v5
|
uses: actions/checkout@v5
|
||||||
@@ -498,6 +507,9 @@ jobs:
|
|||||||
- name: Create .tool-versions file
|
- name: Create .tool-versions file
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo "java openjdk64-17.0.10" > .tool-versions
|
run: echo "java openjdk64-17.0.10" > .tool-versions
|
||||||
|
- name: Create .sdkmanrc file
|
||||||
|
shell: bash
|
||||||
|
run: echo "java=17.0.10-tem" > .sdkmanrc
|
||||||
- name: setup-java
|
- name: setup-java
|
||||||
uses: ./
|
uses: ./
|
||||||
id: setup-java
|
id: setup-java
|
||||||
|
|||||||
@@ -1,4 +1,47 @@
|
|||||||
[
|
[
|
||||||
|
{
|
||||||
|
"version": "25.0.0",
|
||||||
|
"stable": true,
|
||||||
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-macos-x64.tar.gz",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "darwin",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-x64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-linux-x64.tar.gz",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "linux",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-x64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-windows-x64.zip",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "win32",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-x64.zip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-macos-aarch64.tar.gz",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "darwin",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-aarch64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-linux-aarch64.tar.gz",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "linux",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-aarch64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-25.0.0-windows-aarch64.zip",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "win32",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-aarch64.zip"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "21.0.0",
|
"version": "21.0.0",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
|
|||||||
135
__tests__/data/sdkman-java-versions.csv
Normal file
135
__tests__/data/sdkman-java-versions.csv
Normal file
@@ -0,0 +1,135 @@
|
|||||||
|
6.0.119-zulu, 6.0.119
|
||||||
|
7.0.352-zulu, 7.0.352
|
||||||
|
8.0.282-trava, 8.0.282
|
||||||
|
8.0.432-albba, 8.0.432
|
||||||
|
8.0.432-amzn, 8.0.432
|
||||||
|
8.0.432-kona, 8.0.432
|
||||||
|
8.0.432-librca, 8.0.432
|
||||||
|
8.0.432-sem, 8.0.432
|
||||||
|
8.0.432-tem, 8.0.432
|
||||||
|
8.0.432-zulu, 8.0.432
|
||||||
|
8.0.432.fx-librca, 8.0.432
|
||||||
|
8.0.432.fx-zulu, 8.0.432
|
||||||
|
8.0.442-amzn, 8.0.442
|
||||||
|
8.0.442-librca, 8.0.442
|
||||||
|
8.0.442-tem, 8.0.442
|
||||||
|
8.0.442-zulu, 8.0.442
|
||||||
|
8.0.442.fx-librca, 8.0.442
|
||||||
|
8.0.442.fx-zulu, 8.0.442
|
||||||
|
11.0.14.1-jbr, 11.0.14
|
||||||
|
11.0.15-trava, 11.0.15
|
||||||
|
11.0.25-albba, 11.0.25
|
||||||
|
11.0.25-amzn, 11.0.25
|
||||||
|
11.0.25-kona, 11.0.25
|
||||||
|
11.0.25-librca, 11.0.25
|
||||||
|
11.0.25-ms, 11.0.25
|
||||||
|
11.0.25-sapmchn, 11.0.25
|
||||||
|
11.0.25-sem, 11.0.25
|
||||||
|
11.0.25-tem, 11.0.25
|
||||||
|
11.0.25-zulu, 11.0.25
|
||||||
|
11.0.25.fx-librca, 11.0.25
|
||||||
|
11.0.25.fx-zulu, 11.0.25
|
||||||
|
11.0.26-amzn, 11.0.26
|
||||||
|
11.0.26-librca, 11.0.26
|
||||||
|
11.0.26-ms, 11.0.26
|
||||||
|
11.0.26-sapmchn, 11.0.26
|
||||||
|
11.0.26-zulu, 11.0.26
|
||||||
|
11.0.26.fx-librca, 11.0.26
|
||||||
|
11.0.26.fx-zulu, 11.0.26
|
||||||
|
17.0.12-graal, 17.0.12
|
||||||
|
17.0.12-jbr, 17.0.12
|
||||||
|
17.0.12-oracle, 17.0.12
|
||||||
|
17.0.13-albba, 17.0.13
|
||||||
|
17.0.13-amzn, 17.0.13
|
||||||
|
17.0.13-kona, 17.0.13
|
||||||
|
17.0.13-librca, 17.0.13
|
||||||
|
17.0.13-ms, 17.0.13
|
||||||
|
17.0.13-sapmchn, 17.0.13
|
||||||
|
17.0.13-sem, 17.0.13
|
||||||
|
17.0.13-tem, 17.0.13
|
||||||
|
17.0.13-zulu, 17.0.13
|
||||||
|
17.0.13.crac-librca, 17.0.13
|
||||||
|
17.0.13.crac-zulu, 17.0.13
|
||||||
|
17.0.13.fx-librca, 17.0.13
|
||||||
|
17.0.13.fx-zulu, 17.0.13
|
||||||
|
17.0.14-amzn, 17.0.14
|
||||||
|
17.0.14-librca, 17.0.14
|
||||||
|
17.0.14-ms, 17.0.14
|
||||||
|
17.0.14-sapmchn, 17.0.14
|
||||||
|
17.0.14-zulu, 17.0.14
|
||||||
|
17.0.14.fx-librca, 17.0.14
|
||||||
|
17.0.14.fx-zulu, 17.0.14
|
||||||
|
17.0.9-graalce, 17.0.9
|
||||||
|
21.0.2-graalce, 21.0.2
|
||||||
|
21.0.2-open, 21.0.2
|
||||||
|
21.0.5-amzn, 21.0.5
|
||||||
|
21.0.5-graal, 21.0.5
|
||||||
|
21.0.5-jbr, 21.0.5
|
||||||
|
21.0.5-kona, 21.0.5
|
||||||
|
21.0.5-librca, 21.0.5
|
||||||
|
21.0.5-ms, 21.0.5
|
||||||
|
21.0.5-oracle, 21.0.5
|
||||||
|
21.0.5-sapmchn, 21.0.5
|
||||||
|
21.0.5-sem, 21.0.5
|
||||||
|
21.0.5-tem, 21.0.5
|
||||||
|
21.0.5-zulu, 21.0.5
|
||||||
|
21.0.5.crac-librca, 21.0.5
|
||||||
|
21.0.5.crac-zulu, 21.0.5
|
||||||
|
21.0.5.fx-librca, 21.0.5
|
||||||
|
21.0.5.fx-zulu, 21.0.5
|
||||||
|
21.0.6-amzn, 21.0.6
|
||||||
|
21.0.6-graal, 21.0.6
|
||||||
|
21.0.6-librca, 21.0.6
|
||||||
|
21.0.6-ms, 21.0.6
|
||||||
|
21.0.6-oracle, 21.0.6
|
||||||
|
21.0.6-sapmchn, 21.0.6
|
||||||
|
21.0.6-tem, 21.0.6
|
||||||
|
21.0.6-zulu, 21.0.6
|
||||||
|
21.0.6.fx-librca, 21.0.6
|
||||||
|
21.0.6.fx-zulu, 21.0.6
|
||||||
|
22.0.2-oracle, 22.0.2
|
||||||
|
22.1.0.1.r11-gln, 22.1.0
|
||||||
|
22.1.0.1.r17-gln, 22.1.0
|
||||||
|
22.3.5.r11-nik, 22.3.5
|
||||||
|
22.3.5.r17-mandrel, 22.3.5
|
||||||
|
22.3.5.r17-nik, 22.3.5
|
||||||
|
23-open, 23
|
||||||
|
23.0.1-amzn, 23.0.1
|
||||||
|
23.0.1-graal, 23.0.1
|
||||||
|
23.0.1-graalce, 23.0.1
|
||||||
|
23.0.1-librca, 23.0.1
|
||||||
|
23.0.1-open, 23.0.1
|
||||||
|
23.0.1-oracle, 23.0.1
|
||||||
|
23.0.1-sapmchn, 23.0.1
|
||||||
|
23.0.1-tem, 23.0.1
|
||||||
|
23.0.1-zulu, 23.0.1
|
||||||
|
23.0.1.crac-zulu, 23.0.1
|
||||||
|
23.0.1.fx-librca, 23.0.1
|
||||||
|
23.0.1.fx-zulu, 23.0.1
|
||||||
|
23.0.2-amzn, 23.0.2
|
||||||
|
23.0.2-graal, 23.0.2
|
||||||
|
23.0.2-graalce, 23.0.2
|
||||||
|
23.0.2-librca, 23.0.2
|
||||||
|
23.0.2-oracle, 23.0.2
|
||||||
|
23.0.2-sapmchn, 23.0.2
|
||||||
|
23.0.2-tem, 23.0.2
|
||||||
|
23.0.2-zulu, 23.0.2
|
||||||
|
23.0.2.fx-librca, 23.0.2
|
||||||
|
23.0.2.fx-zulu, 23.0.2
|
||||||
|
23.0.6.fx-nik, 23.0.6
|
||||||
|
23.0.6.r17-mandrel, 23.0.6
|
||||||
|
23.0.6.r17-nik, 23.0.6
|
||||||
|
23.1.5.fx-nik, 23.1.5
|
||||||
|
23.1.5.r21-mandrel, 23.1.5
|
||||||
|
23.1.5.r21-nik, 23.1.5
|
||||||
|
24.0.2.r22-mandrel, 24.0.2
|
||||||
|
24.ea.27-graal, 24.0.0
|
||||||
|
24.ea.28-graal, 24.0.0
|
||||||
|
24.ea.31-open, 24.0.0
|
||||||
|
24.ea.32-open, 24.0.0
|
||||||
|
24.1.1.r23-mandrel, 24.1.1
|
||||||
|
24.1.1.r23-nik, 24.1.1
|
||||||
|
25.ea.4-graal, 25.0.0
|
||||||
|
25.ea.5-graal, 25.0.0
|
||||||
|
25.ea.5-open, 25.0.0
|
||||||
|
25.ea.6-open, 25.0.0
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,11 @@ describe('findPackageForDownload', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it.each([
|
it.each([
|
||||||
|
[
|
||||||
|
'25.x',
|
||||||
|
'25.0.0',
|
||||||
|
'https://aka.ms/download-jdk/microsoft-jdk-25.0.0-{{OS_TYPE}}-x64.{{ARCHIVE_TYPE}}'
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'21.x',
|
'21.x',
|
||||||
'21.0.0',
|
'21.0.0',
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import * as cache from '@actions/cache';
|
import * as cache from '@actions/cache';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
import {
|
import {
|
||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
|
getVersionFromFileContent,
|
||||||
isVersionSatisfies,
|
isVersionSatisfies,
|
||||||
isCacheFeatureAvailable,
|
isCacheFeatureAvailable,
|
||||||
isGhes
|
isGhes
|
||||||
@@ -82,6 +85,43 @@ describe('convertVersionToSemver', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('getVersionFromFileContent', () => {
|
||||||
|
describe('.sdkmanrc', () => {
|
||||||
|
it.each([
|
||||||
|
['java=11.0.20.1-tem', '11.0.20'],
|
||||||
|
['java = 11.0.20.1-tem', '11.0.20'],
|
||||||
|
['java=11.0.20.1-tem # a comment in sdkmanrc', '11.0.20'],
|
||||||
|
['java=11.0.20.1-tem\n#java=21.0.20.1-tem\n', '11.0.20'], // choose first match
|
||||||
|
['java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '11.0.20'], // choose first match
|
||||||
|
['#java=11.0.20.1-tem\njava=21.0.20.1-tem\n', '21.0.20'] // first one is 'commented' in .sdkmanrc
|
||||||
|
])('parsing %s should return %s', (content: string, expected: string) => {
|
||||||
|
const actual = getVersionFromFileContent(content, 'openjdk', '.sdkmanrc');
|
||||||
|
expect(actual).toBe(expected);
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('known versions', () => {
|
||||||
|
const csv = fs.readFileSync(
|
||||||
|
path.join(__dirname, 'data/sdkman-java-versions.csv'),
|
||||||
|
'utf8'
|
||||||
|
);
|
||||||
|
const versions = csv.split('\n').map(r => r.split(', '));
|
||||||
|
|
||||||
|
it.each(versions)(
|
||||||
|
'parsing %s should return %s',
|
||||||
|
(sdkmanJavaVersion: string, expected: string) => {
|
||||||
|
const asContent = `java=${sdkmanJavaVersion}`;
|
||||||
|
const actual = getVersionFromFileContent(
|
||||||
|
asContent,
|
||||||
|
'openjdk',
|
||||||
|
'.sdkmanrc'
|
||||||
|
);
|
||||||
|
expect(actual).toBe(expected);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('isGhes', () => {
|
describe('isGhes', () => {
|
||||||
const pristineEnv = process.env;
|
const pristineEnv = process.env;
|
||||||
|
|
||||||
|
|||||||
15
dist/cleanup/index.js
vendored
15
dist/cleanup/index.js
vendored
@@ -94706,17 +94706,20 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
|||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
||||||
}
|
}
|
||||||
|
else if (versionFileName == '.sdkmanrc') {
|
||||||
|
javaVersionRegExp = /^java\s*=\s*(?<version>[^-]+)/m;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
const capturedVersion = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||||
: '';
|
: '';
|
||||||
if (!fileContent) {
|
core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`);
|
||||||
|
if (!capturedVersion) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
core.debug(`Version from file '${fileContent}'`);
|
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||||
const tentativeVersion = avoidOldNotation(fileContent);
|
|
||||||
const rawVersion = tentativeVersion.split('-')[0];
|
const rawVersion = tentativeVersion.split('-')[0];
|
||||||
let version = semver.validRange(rawVersion)
|
let version = semver.validRange(rawVersion)
|
||||||
? tentativeVersion
|
? tentativeVersion
|
||||||
@@ -94747,8 +94750,8 @@ function convertVersionToSemver(version) {
|
|||||||
}
|
}
|
||||||
exports.convertVersionToSemver = convertVersionToSemver;
|
exports.convertVersionToSemver = convertVersionToSemver;
|
||||||
function getGitHubHttpHeaders() {
|
function getGitHubHttpHeaders() {
|
||||||
const token = core.getInput('token');
|
const resolvedToken = core.getInput('token') || process.env.GITHUB_TOKEN;
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
const auth = !resolvedToken ? undefined : `token ${resolvedToken}`;
|
||||||
const headers = {
|
const headers = {
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
|
|||||||
296
dist/setup/index.js
vendored
296
dist/setup/index.js
vendored
@@ -129856,6 +129856,7 @@ class JavaBase {
|
|||||||
this.checkLatest = installerOptions.checkLatest;
|
this.checkLatest = installerOptions.checkLatest;
|
||||||
}
|
}
|
||||||
setupJava() {
|
setupJava() {
|
||||||
|
var _a, _b;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
let foundJava = this.findInToolcache();
|
let foundJava = this.findInToolcache();
|
||||||
if (foundJava && !this.checkLatest) {
|
if (foundJava && !this.checkLatest) {
|
||||||
@@ -129863,40 +129864,106 @@ class JavaBase {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.info('Trying to resolve the latest version from remote');
|
core.info('Trying to resolve the latest version from remote');
|
||||||
try {
|
const MAX_RETRIES = 4;
|
||||||
const javaRelease = yield this.findPackageForDownload(this.version);
|
const RETRY_DELAY_MS = 2000;
|
||||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
const retryableCodes = [
|
||||||
if ((foundJava === null || foundJava === void 0 ? void 0 : foundJava.version) === javaRelease.version) {
|
'ETIMEDOUT',
|
||||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
'ECONNRESET',
|
||||||
}
|
'ENOTFOUND',
|
||||||
else {
|
'ECONNREFUSED'
|
||||||
core.info('Trying to download...');
|
];
|
||||||
foundJava = yield this.downloadTool(javaRelease);
|
let retries = MAX_RETRIES;
|
||||||
core.info(`Java ${foundJava.version} was downloaded`);
|
while (retries > 0) {
|
||||||
}
|
try {
|
||||||
}
|
// Clear console timers before each attempt to prevent conflicts
|
||||||
catch (error) {
|
if (retries < MAX_RETRIES && core.isDebug()) {
|
||||||
if (error instanceof tc.HTTPError) {
|
const consoleAny = console;
|
||||||
if (error.httpStatusCode === 403) {
|
(_b = (_a = consoleAny._times) === null || _a === void 0 ? void 0 : _a.clear) === null || _b === void 0 ? void 0 : _b.call(_a);
|
||||||
core.error('HTTP 403: Permission denied or access restricted.');
|
|
||||||
}
|
}
|
||||||
else if (error.httpStatusCode === 429) {
|
const javaRelease = yield this.findPackageForDownload(this.version);
|
||||||
core.warning('HTTP 429: Rate limit exceeded. Please retry later.');
|
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||||
|
if ((foundJava === null || foundJava === void 0 ? void 0 : foundJava.version) === javaRelease.version) {
|
||||||
|
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.error(`HTTP ${error.httpStatusCode}: ${error.message}`);
|
core.info('Trying to download...');
|
||||||
|
foundJava = yield this.downloadTool(javaRelease);
|
||||||
|
core.info(`Java ${foundJava.version} was downloaded`);
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else {
|
catch (error) {
|
||||||
const message = error instanceof Error ? error.message : JSON.stringify(error);
|
retries--;
|
||||||
core.error(`Java setup failed due to network issue or timeout: ${message}`);
|
// Check if error is retryable (including aggregate errors)
|
||||||
|
const isRetryable = (error instanceof tc.HTTPError &&
|
||||||
|
error.httpStatusCode &&
|
||||||
|
[429, 502, 503, 504].includes(error.httpStatusCode)) ||
|
||||||
|
retryableCodes.includes(error === null || error === void 0 ? void 0 : error.code) ||
|
||||||
|
((error === null || error === void 0 ? void 0 : error.errors) &&
|
||||||
|
Array.isArray(error.errors) &&
|
||||||
|
error.errors.some((err) => retryableCodes.includes(err === null || err === void 0 ? void 0 : err.code)));
|
||||||
|
if (retries > 0 && isRetryable) {
|
||||||
|
core.debug(`Attempt failed due to network or timeout issues, initiating retry... (${retries} attempts left)`);
|
||||||
|
yield new Promise(r => setTimeout(r, RETRY_DELAY_MS));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (error instanceof tc.HTTPError) {
|
||||||
|
if (error.httpStatusCode === 403) {
|
||||||
|
core.error('HTTP 403: Permission denied or access restricted.');
|
||||||
|
}
|
||||||
|
else if (error.httpStatusCode === 429) {
|
||||||
|
core.warning('HTTP 429: Rate limit exceeded. Please retry later.');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.error(`HTTP ${error.httpStatusCode}: ${error.message}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (error && error.errors && Array.isArray(error.errors)) {
|
||||||
|
core.error(`Java setup failed due to network or configuration error(s)`);
|
||||||
|
if (error instanceof Error && error.stack) {
|
||||||
|
core.debug(error.stack);
|
||||||
|
}
|
||||||
|
for (const err of error.errors) {
|
||||||
|
const endpoint = (err === null || err === void 0 ? void 0 : err.address) || (err === null || err === void 0 ? void 0 : err.hostname) || '';
|
||||||
|
const port = (err === null || err === void 0 ? void 0 : err.port) ? `:${err.port}` : '';
|
||||||
|
const message = (err === null || err === void 0 ? void 0 : err.message) || 'Aggregate error';
|
||||||
|
const endpointInfo = !message.includes(endpoint)
|
||||||
|
? ` ${endpoint}${port}`
|
||||||
|
: '';
|
||||||
|
const localInfo = err.localAddress && err.localPort
|
||||||
|
? ` - Local (${err.localAddress}:${err.localPort})`
|
||||||
|
: '';
|
||||||
|
const logMessage = `${message}${endpointInfo}${localInfo}`;
|
||||||
|
core.error(logMessage);
|
||||||
|
core.debug(`${err.stack || err.message}`);
|
||||||
|
Object.entries(err).forEach(([key, value]) => {
|
||||||
|
core.debug(`"${key}": ${JSON.stringify(value)}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const message = error instanceof Error ? error.message : JSON.stringify(error);
|
||||||
|
core.error(`Java setup process failed due to: ${message}`);
|
||||||
|
if (typeof (error === null || error === void 0 ? void 0 : error.code) === 'string') {
|
||||||
|
core.debug(error.stack);
|
||||||
|
}
|
||||||
|
const errorDetails = Object.assign({ name: error.name, message: error.message }, Object.getOwnPropertyNames(error)
|
||||||
|
.filter(prop => !['name', 'message', 'stack'].includes(prop))
|
||||||
|
.reduce((acc, prop) => {
|
||||||
|
acc[prop] = error[prop];
|
||||||
|
return acc;
|
||||||
|
}, {}));
|
||||||
|
Object.entries(errorDetails).forEach(([key, value]) => {
|
||||||
|
core.debug(`"${key}": ${JSON.stringify(value)}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
if (error instanceof Error && error.stack) {
|
|
||||||
core.debug(error.stack);
|
|
||||||
}
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!foundJava) {
|
||||||
|
throw new Error('Failed to resolve Java version');
|
||||||
|
}
|
||||||
// JDK folder may contain postfix "Contents/Home" on macOS
|
// JDK folder may contain postfix "Contents/Home" on macOS
|
||||||
const macOSPostfixPath = path_1.default.join(foundJava.path, constants_1.MACOS_JAVA_CONTENT_POSTFIX);
|
const macOSPostfixPath = path_1.default.join(foundJava.path, constants_1.MACOS_JAVA_CONTENT_POSTFIX);
|
||||||
if (process.platform === 'darwin' && fs.existsSync(macOSPostfixPath)) {
|
if (process.platform === 'darwin' && fs.existsSync(macOSPostfixPath)) {
|
||||||
@@ -130525,37 +130592,56 @@ const tc = __importStar(__nccwpck_require__(27784));
|
|||||||
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
const fs_1 = __importDefault(__nccwpck_require__(57147));
|
||||||
const path_1 = __importDefault(__nccwpck_require__(71017));
|
const path_1 = __importDefault(__nccwpck_require__(71017));
|
||||||
const base_installer_1 = __nccwpck_require__(59741);
|
const base_installer_1 = __nccwpck_require__(59741);
|
||||||
const util_1 = __nccwpck_require__(92629);
|
|
||||||
const http_client_1 = __nccwpck_require__(96255);
|
const http_client_1 = __nccwpck_require__(96255);
|
||||||
|
const util_1 = __nccwpck_require__(92629);
|
||||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
|
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
|
||||||
|
const GRAALVM_MIN_VERSION = 17;
|
||||||
|
const SUPPORTED_ARCHITECTURES = ['x64', 'aarch64'];
|
||||||
class GraalVMDistribution extends base_installer_1.JavaBase {
|
class GraalVMDistribution extends base_installer_1.JavaBase {
|
||||||
constructor(installerOptions) {
|
constructor(installerOptions) {
|
||||||
super('GraalVM', installerOptions);
|
super('GraalVM', installerOptions);
|
||||||
}
|
}
|
||||||
downloadTool(javaRelease) {
|
downloadTool(javaRelease) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
|
try {
|
||||||
let javaArchivePath = yield tc.downloadTool(javaRelease.url);
|
core.info(`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`);
|
||||||
core.info(`Extracting Java archive...`);
|
let javaArchivePath = yield tc.downloadTool(javaRelease.url);
|
||||||
const extension = (0, util_1.getDownloadArchiveExtension)();
|
core.info(`Extracting Java archive...`);
|
||||||
if (process.platform === 'win32') {
|
const extension = (0, util_1.getDownloadArchiveExtension)();
|
||||||
javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
|
if (IS_WINDOWS) {
|
||||||
|
javaArchivePath = (0, util_1.renameWinArchive)(javaArchivePath);
|
||||||
|
}
|
||||||
|
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
|
||||||
|
// Add validation for extracted path
|
||||||
|
if (!fs_1.default.existsSync(extractedJavaPath)) {
|
||||||
|
throw new Error(`Extraction failed: path ${extractedJavaPath} does not exist`);
|
||||||
|
}
|
||||||
|
const dirContents = fs_1.default.readdirSync(extractedJavaPath);
|
||||||
|
if (dirContents.length === 0) {
|
||||||
|
throw new Error('Extraction failed: no files found in extracted directory');
|
||||||
|
}
|
||||||
|
const archivePath = path_1.default.join(extractedJavaPath, dirContents[0]);
|
||||||
|
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||||
|
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
|
||||||
|
return { version: javaRelease.version, path: javaPath };
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.error(`Failed to download and extract GraalVM: ${error}`);
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
const extractedJavaPath = yield (0, util_1.extractJdkFile)(javaArchivePath, extension);
|
|
||||||
const archiveName = fs_1.default.readdirSync(extractedJavaPath)[0];
|
|
||||||
const archivePath = path_1.default.join(extractedJavaPath, archiveName);
|
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
|
||||||
const javaPath = yield tc.cacheDir(archivePath, this.toolcacheFolderName, version, this.architecture);
|
|
||||||
return { version: javaRelease.version, path: javaPath };
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
findPackageForDownload(range) {
|
findPackageForDownload(range) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// Add input validation
|
||||||
|
if (!range || typeof range !== 'string') {
|
||||||
|
throw new Error('Version range is required and must be a string');
|
||||||
|
}
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
if (arch !== 'x64' && arch !== 'aarch64') {
|
if (!SUPPORTED_ARCHITECTURES.includes(arch)) {
|
||||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
throw new Error(`Unsupported architecture: ${this.architecture}. Supported architectures are: ${SUPPORTED_ARCHITECTURES.join(', ')}`);
|
||||||
}
|
}
|
||||||
if (!this.stable) {
|
if (!this.stable) {
|
||||||
return this.findEABuildDownloadUrl(`${range}-ea`);
|
return this.findEABuildDownloadUrl(`${range}-ea`);
|
||||||
@@ -130565,81 +130651,104 @@ class GraalVMDistribution extends base_installer_1.JavaBase {
|
|||||||
}
|
}
|
||||||
const platform = this.getPlatform();
|
const platform = this.getPlatform();
|
||||||
const extension = (0, util_1.getDownloadArchiveExtension)();
|
const extension = (0, util_1.getDownloadArchiveExtension)();
|
||||||
let major;
|
const major = range.includes('.') ? range.split('.')[0] : range;
|
||||||
let fileUrl;
|
const majorVersion = parseInt(major);
|
||||||
if (range.includes('.')) {
|
if (isNaN(majorVersion)) {
|
||||||
major = range.split('.')[0];
|
throw new Error(`Invalid version format: ${range}`);
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
|
||||||
}
|
}
|
||||||
else {
|
if (majorVersion < GRAALVM_MIN_VERSION) {
|
||||||
major = range;
|
throw new Error(`GraalVM is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`);
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${range}/latest/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
|
||||||
}
|
|
||||||
if (parseInt(major) < 17) {
|
|
||||||
throw new Error('GraalVM is only supported for JDK 17 and later');
|
|
||||||
}
|
}
|
||||||
|
const fileUrl = this.constructFileUrl(range, major, platform, arch, extension);
|
||||||
const response = yield this.http.head(fileUrl);
|
const response = yield this.http.head(fileUrl);
|
||||||
if (response.message.statusCode === http_client_1.HttpCodes.NotFound) {
|
this.handleHttpResponse(response, range);
|
||||||
throw new Error(`Could not find GraalVM for SemVer ${range}`);
|
|
||||||
}
|
|
||||||
if (response.message.statusCode !== http_client_1.HttpCodes.OK) {
|
|
||||||
throw new Error(`Http request for GraalVM failed with status code: ${response.message.statusCode}`);
|
|
||||||
}
|
|
||||||
return { url: fileUrl, version: range };
|
return { url: fileUrl, version: range };
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
constructFileUrl(range, major, platform, arch, extension) {
|
||||||
|
return range.includes('.')
|
||||||
|
? `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`
|
||||||
|
: `${GRAALVM_DL_BASE}/${range}/latest/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||||
|
}
|
||||||
|
handleHttpResponse(response, range) {
|
||||||
|
const statusCode = response.message.statusCode;
|
||||||
|
if (statusCode === http_client_1.HttpCodes.NotFound) {
|
||||||
|
throw new Error(`Could not find GraalVM for SemVer ${range}. Please check if this version is available at ${GRAALVM_DL_BASE}`);
|
||||||
|
}
|
||||||
|
if (statusCode === http_client_1.HttpCodes.Unauthorized ||
|
||||||
|
statusCode === http_client_1.HttpCodes.Forbidden) {
|
||||||
|
throw new Error(`Access denied when downloading GraalVM. Status code: ${statusCode}. Please check your credentials or permissions.`);
|
||||||
|
}
|
||||||
|
if (statusCode !== http_client_1.HttpCodes.OK) {
|
||||||
|
throw new Error(`HTTP request for GraalVM failed with status code: ${statusCode} (${response.message.statusMessage || 'Unknown error'})`);
|
||||||
|
}
|
||||||
|
}
|
||||||
findEABuildDownloadUrl(javaEaVersion) {
|
findEABuildDownloadUrl(javaEaVersion) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
core.debug(`Searching for EA build: ${javaEaVersion}`);
|
||||||
const versions = yield this.fetchEAJson(javaEaVersion);
|
const versions = yield this.fetchEAJson(javaEaVersion);
|
||||||
|
core.debug(`Found ${versions.length} EA versions`);
|
||||||
const latestVersion = versions.find(v => v.latest);
|
const latestVersion = versions.find(v => v.latest);
|
||||||
if (!latestVersion) {
|
if (!latestVersion) {
|
||||||
|
core.error(`Available versions: ${versions.map(v => v.version).join(', ')}`);
|
||||||
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
|
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
|
||||||
}
|
}
|
||||||
|
core.debug(`Latest version found: ${latestVersion.version}`);
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
const file = latestVersion.files.find(f => f.arch === arch && f.platform === GRAALVM_PLATFORM);
|
const file = latestVersion.files.find(f => f.arch === arch && f.platform === GRAALVM_PLATFORM);
|
||||||
if (!file || !file.filename.startsWith('graalvm-jdk-')) {
|
if (!file) {
|
||||||
throw new Error(`Unable to find file metadata for '${javaEaVersion}'`);
|
core.error(`Available files for architecture ${arch}: ${JSON.stringify(latestVersion.files)}`);
|
||||||
|
throw new Error(`Unable to find file for architecture '${arch}' and platform '${GRAALVM_PLATFORM}'`);
|
||||||
}
|
}
|
||||||
|
if (!file.filename.startsWith('graalvm-jdk-')) {
|
||||||
|
throw new Error(`Invalid filename format: ${file.filename}. Expected to start with 'graalvm-jdk-'`);
|
||||||
|
}
|
||||||
|
const downloadUrl = `${latestVersion.download_base_url}${file.filename}`;
|
||||||
|
core.debug(`Download URL: ${downloadUrl}`);
|
||||||
return {
|
return {
|
||||||
url: `${latestVersion.download_base_url}${file.filename}`,
|
url: downloadUrl,
|
||||||
version: latestVersion.version
|
version: latestVersion.version
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
fetchEAJson(javaEaVersion) {
|
fetchEAJson(javaEaVersion) {
|
||||||
|
var _a;
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const owner = 'graalvm';
|
const url = `https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/contents/versions/${javaEaVersion}.json?ref=main`;
|
||||||
const repository = 'oracle-graalvm-ea-builds';
|
|
||||||
const branch = 'main';
|
|
||||||
const filePath = `versions/${javaEaVersion}.json`;
|
|
||||||
const url = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
|
||||||
const headers = (0, util_1.getGitHubHttpHeaders)();
|
const headers = (0, util_1.getGitHubHttpHeaders)();
|
||||||
core.debug(`Trying to fetch available version info for GraalVM EA builds from '${url}'`);
|
core.debug(`Trying to fetch available version info for GraalVM EA builds from '${url}'`);
|
||||||
let fetchedJson;
|
|
||||||
try {
|
try {
|
||||||
fetchedJson = (yield this.http.getJson(url, headers))
|
const response = yield this.http.getJson(url, headers);
|
||||||
.result;
|
if (!response.result) {
|
||||||
|
throw new Error(`No GraalVM EA build found for version '${javaEaVersion}'. Please check if the version is correct.`);
|
||||||
|
}
|
||||||
|
return response.result;
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (error) {
|
||||||
throw Error(`Fetching version info for GraalVM EA builds from '${url}' failed with the error: ${err.message}`);
|
if (error instanceof Error) {
|
||||||
|
// Check if it's a 404 error (file not found)
|
||||||
|
if ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('404')) {
|
||||||
|
throw new Error(`GraalVM EA version '${javaEaVersion}' not found. Please verify the version exists in the EA builds repository.`);
|
||||||
|
}
|
||||||
|
// Re-throw with more context
|
||||||
|
throw new Error(`Failed to fetch GraalVM EA version information for '${javaEaVersion}': ${error.message}`);
|
||||||
|
}
|
||||||
|
// If it's not an Error instance, throw a generic error
|
||||||
|
throw new Error(`Failed to fetch GraalVM EA version information for '${javaEaVersion}'`);
|
||||||
}
|
}
|
||||||
if (fetchedJson === null) {
|
|
||||||
throw Error(`No GraalVM EA build found. Are you sure java-version: '${javaEaVersion}' is correct?`);
|
|
||||||
}
|
|
||||||
return fetchedJson;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getPlatform(platform = process.platform) {
|
getPlatform(platform = process.platform) {
|
||||||
switch (platform) {
|
const platformMap = {
|
||||||
case 'darwin':
|
darwin: 'macos',
|
||||||
return 'macos';
|
win32: 'windows',
|
||||||
case 'win32':
|
linux: 'linux'
|
||||||
return 'windows';
|
};
|
||||||
case 'linux':
|
const result = platformMap[platform];
|
||||||
return 'linux';
|
if (!result) {
|
||||||
default:
|
throw new Error(`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`);
|
||||||
throw new Error(`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`);
|
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.GraalVMDistribution = GraalVMDistribution;
|
exports.GraalVMDistribution = GraalVMDistribution;
|
||||||
@@ -131520,9 +131629,9 @@ class SapMachineDistribution extends base_installer_1.JavaBase {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const platform = this.getPlatformOption();
|
const platform = this.getPlatformOption();
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
let fetchedReleasesJson = yield this.fetchReleasesFromUrl('https://sap.github.io/SapMachine/assets/data/sapmachine-releases-all.json');
|
let fetchedReleasesJson = yield this.fetchReleasesFromUrl('https://sapmachine.io/assets/data/sapmachine-releases-all.json');
|
||||||
if (!fetchedReleasesJson) {
|
if (!fetchedReleasesJson) {
|
||||||
fetchedReleasesJson = yield this.fetchReleasesFromUrl('https://api.github.com/repos/SAP/SapMachine/contents/assets/data/sapmachine-releases-all.json?ref=gh-pages', (0, util_1.getGitHubHttpHeaders)());
|
fetchedReleasesJson = yield this.fetchReleasesFromUrl('https://sap.github.io/SapMachine/assets/data/sapmachine-releases-all.json');
|
||||||
}
|
}
|
||||||
if (!fetchedReleasesJson) {
|
if (!fetchedReleasesJson) {
|
||||||
throw new Error(`Couldn't fetch SapMachine versions information from both primary and backup urls`);
|
throw new Error(`Couldn't fetch SapMachine versions information from both primary and backup urls`);
|
||||||
@@ -132741,17 +132850,20 @@ function getVersionFromFileContent(content, distributionName, versionFile) {
|
|||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
||||||
}
|
}
|
||||||
|
else if (versionFileName == '.sdkmanrc') {
|
||||||
|
javaVersionRegExp = /^java\s*=\s*(?<version>[^-]+)/m;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
const fileContent = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
const capturedVersion = ((_b = (_a = content.match(javaVersionRegExp)) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.version)
|
||||||
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
? (_d = (_c = content.match(javaVersionRegExp)) === null || _c === void 0 ? void 0 : _c.groups) === null || _d === void 0 ? void 0 : _d.version
|
||||||
: '';
|
: '';
|
||||||
if (!fileContent) {
|
core.debug(`Parsed version '${capturedVersion}' from file '${versionFileName}'`);
|
||||||
|
if (!capturedVersion) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
core.debug(`Version from file '${fileContent}'`);
|
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||||
const tentativeVersion = avoidOldNotation(fileContent);
|
|
||||||
const rawVersion = tentativeVersion.split('-')[0];
|
const rawVersion = tentativeVersion.split('-')[0];
|
||||||
let version = semver.validRange(rawVersion)
|
let version = semver.validRange(rawVersion)
|
||||||
? tentativeVersion
|
? tentativeVersion
|
||||||
@@ -132782,8 +132894,8 @@ function convertVersionToSemver(version) {
|
|||||||
}
|
}
|
||||||
exports.convertVersionToSemver = convertVersionToSemver;
|
exports.convertVersionToSemver = convertVersionToSemver;
|
||||||
function getGitHubHttpHeaders() {
|
function getGitHubHttpHeaders() {
|
||||||
const token = core.getInput('token');
|
const resolvedToken = core.getInput('token') || process.env.GITHUB_TOKEN;
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
const auth = !resolvedToken ? undefined : `token ${resolvedToken}`;
|
||||||
const headers = {
|
const headers = {
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -601,14 +601,29 @@ steps:
|
|||||||
## Java version file
|
## Java version file
|
||||||
If the `java-version-file` input is specified, the action will extract the version from the file and install it.
|
If the `java-version-file` input is specified, the action will extract the version from the file and install it.
|
||||||
|
|
||||||
Supported files are .java-version and .tool-versions.
|
Supported files are `.java-version`, `.tool-versions` and `.sdkmanrc`.
|
||||||
In .java-version file, only the version should be specified (e.g., 17.0.7).
|
* In `.java-version` file, only the version should be specified (e.g., 17.0.7). The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv).
|
||||||
In .tool-versions file, java version should be preceded by the java keyword (e.g., java 17.0.7).
|
* In `.tool-versions` file, java version should be preceded by the java keyword (e.g., java 17.0.7). The `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
||||||
The `.java-version` file recognizes all variants of the version description according to [jenv](https://github.com/jenv/jenv). Similarly, the `.tool-versions` file supports version specifications in accordance with [asdf](https://github.com/asdf-vm/asdf) standards, adhering to Semantic Versioning ([semver](https://semver.org/)).
|
* In `.sdkmanrc` file, java version should be preceded by the `java=` prefix (e.g., java=17.0.7-tem) and include the distribution. The `.sdkmanrc` file supports version specifications in accordance with [file format](https://sdkman.io/usage#env-command), see [Sdkman! documentation](https://sdkman.io/jdks) for more information.
|
||||||
|
|
||||||
If both java-version and java-version-file inputs are provided, the java-version input will be used.
|
|
||||||
|
|
||||||
Valid entry options:
|
|
||||||
|
If both `java-version` and `java-version-file` **inputs** are provided, the `java-version` input will be used.
|
||||||
|
|
||||||
|
**Example step using `Sdkman!`**:
|
||||||
|
```yml
|
||||||
|
- name: Setup java
|
||||||
|
uses: actions/setup-java@v5
|
||||||
|
with:
|
||||||
|
java-version-file: '.sdkmanrc'
|
||||||
|
distribution: 'temurin'
|
||||||
|
```
|
||||||
|
|
||||||
|
**Example `.sdkmanrc`**:
|
||||||
|
```
|
||||||
|
java=17.0.7-tem
|
||||||
|
```
|
||||||
|
|
||||||
|
Valid entry options (does not apply to `.sdkmanrc`):
|
||||||
```
|
```
|
||||||
major versions: 8, 11, 16, 17, 21
|
major versions: 8, 11, 16, 17, 21
|
||||||
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
|
more specific versions: 8.0.282+8, 8.0.232, 11.0, 11.0.4, 17.0
|
||||||
@@ -619,4 +634,4 @@ LTS versions : temurin-21.0.5+11.0.LTS
|
|||||||
If the file contains multiple versions, only the first one will be recognized.
|
If the file contains multiple versions, only the first one will be recognized.
|
||||||
|
|
||||||
***NOTE***:
|
***NOTE***:
|
||||||
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).
|
For the tool-version file, ensure that you use standard semantic versioning (semver) formats, as non-standard formats (such as jetbrains-21b212.1) may not be parsed correctly. Additionally, for complex version strings containing multiple version-like segments (for example, java semeru-openj9-11.0.15+10_openj9-0.32.0), the extraction logic may incorrectly capture the last segment (0.32.0) instead of the main version (11.0.15+10).
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Pull requests are the easiest way to contribute changes to git repos at GitHub.
|
|||||||
Adding or changing tests is an integral part of making a change to the code.
|
Adding or changing tests is an integral part of making a change to the code.
|
||||||
Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml).
|
Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workflows` folder, particularly take a look at the files with `e2e` prefix, for instance, [e2e-cache.yml](https://github.com/actions/setup-java/blob/main/.github/workflows/e2e-cache.yml).
|
||||||
|
|
||||||
- The contributor can add various types of tests (like unit tests or end-to-end tests), which, in his opinion, will be necessary and sufficient for testing new or changed functionality
|
- The contributor can add various types of tests (like unit tests or end-to-end tests), which, in their opinion, will be necessary and sufficient for testing new or changed functionality
|
||||||
- Tests should cover a successful execution, as well as some edge cases and possible errors
|
- Tests should cover a successful execution, as well as some edge cases and possible errors
|
||||||
- As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request
|
- As already mentioned, pull requests without tests will be considered more carefully by maintainers. If you are sure that in this situation the tests are not needed or cannot be implemented with a commensurate effort - please add this clarification message to your pull request
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ Unit tests are in the `__tests__` folder, and end-to-end tests are in the `workf
|
|||||||
|
|
||||||
- CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem
|
- CI will start automatically with some checks. Wait until the end of the execution and make sure that all checks passed successfully. If some checks fail, you can open them one by one, try to find the reason for failing and make changes to your code to resolve the problem
|
||||||
- Maintainers will review your pull request
|
- Maintainers will review your pull request
|
||||||
- If a maintainer requests changes, first of all, try to think about his request critically and only after that implement and request another review
|
- If a maintainer requests changes, first of all, try to think about their request critically and only after that implement and request another review
|
||||||
- If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag
|
- If your PR gets accepted, it will soon be merged into the main branch. But your contribution will take effect only after the release of a new version of the action and updating the major tag
|
||||||
> Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart:
|
> Sometimes maintainers reject pull requests and that's ok! Usually, along with rejection, we supply the reason for it. Nonetheless, we still really appreciate you taking the time to do it, and we don't take that lightly :heart:
|
||||||
|
|
||||||
|
|||||||
152
package-lock.json
generated
152
package-lock.json
generated
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "setup-java",
|
"name": "setup-java",
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
@@ -367,6 +366,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz",
|
||||||
"integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==",
|
"integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ampproject/remapping": "^2.2.0",
|
"@ampproject/remapping": "^2.2.0",
|
||||||
"@babel/code-frame": "^7.22.13",
|
"@babel/code-frame": "^7.22.13",
|
||||||
@@ -841,9 +841,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@eslint-community/eslint-utils": {
|
"node_modules/@eslint-community/eslint-utils": {
|
||||||
"version": "4.7.0",
|
"version": "4.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz",
|
||||||
"integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==",
|
"integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"eslint-visitor-keys": "^3.4.3"
|
"eslint-visitor-keys": "^3.4.3"
|
||||||
@@ -1716,17 +1716,16 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.43.0.tgz",
|
||||||
"integrity": "sha512-9XNTlo7P7RJxbVeICaIIIEipqxLKguyh+3UbXuT2XQuFp6d8VOeDEGuz5IiX0dgZo8CiI6aOFLg4e8cF71SFVg==",
|
"integrity": "sha512-8tg+gt7ENL7KewsKMKDHXR1vm8tt9eMxjJBYINf6swonlWgkYn5NwyIgXpbbDxTNU5DgpDFfj95prcTq2clIQQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/regexpp": "^4.10.0",
|
"@eslint-community/regexpp": "^4.10.0",
|
||||||
"@typescript-eslint/scope-manager": "8.35.1",
|
"@typescript-eslint/scope-manager": "8.43.0",
|
||||||
"@typescript-eslint/type-utils": "8.35.1",
|
"@typescript-eslint/type-utils": "8.43.0",
|
||||||
"@typescript-eslint/utils": "8.35.1",
|
"@typescript-eslint/utils": "8.43.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.35.1",
|
"@typescript-eslint/visitor-keys": "8.43.0",
|
||||||
"graphemer": "^1.4.0",
|
"graphemer": "^1.4.0",
|
||||||
"ignore": "^7.0.0",
|
"ignore": "^7.0.0",
|
||||||
"natural-compare": "^1.4.0",
|
"natural-compare": "^1.4.0",
|
||||||
@@ -1740,9 +1739,9 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/parser": "^8.35.1",
|
"@typescript-eslint/parser": "^8.43.0",
|
||||||
"eslint": "^8.57.0 || ^9.0.0",
|
"eslint": "^8.57.0 || ^9.0.0",
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
|
"node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {
|
||||||
@@ -1750,22 +1749,22 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",
|
||||||
"integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
|
"integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 4"
|
"node": ">= 4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/parser": {
|
"node_modules/@typescript-eslint/parser": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.43.0.tgz",
|
||||||
"integrity": "sha512-3MyiDfrfLeK06bi/g9DqJxP5pV74LNv4rFTyvGDmT3x2p1yp1lOd+qYZfiRPIOf/oON+WRZR5wxxuF85qOar+w==",
|
"integrity": "sha512-B7RIQiTsCBBmY+yW4+ILd6mF5h1FUwJsVvpqkrgpszYifetQ2Ke+Z4u6aZh0CblkUGIdR59iYVyXqqZGkZ3aBw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/scope-manager": "8.35.1",
|
"@typescript-eslint/scope-manager": "8.43.0",
|
||||||
"@typescript-eslint/types": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.35.1",
|
"@typescript-eslint/typescript-estree": "8.43.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.35.1",
|
"@typescript-eslint/visitor-keys": "8.43.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1777,18 +1776,17 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0",
|
"eslint": "^8.57.0 || ^9.0.0",
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/project-service": {
|
"node_modules/@typescript-eslint/project-service": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.43.0.tgz",
|
||||||
"integrity": "sha512-VYxn/5LOpVxADAuP3NrnxxHYfzVtQzLKeldIhDhzC8UHaiQvYlXvKuVho1qLduFbJjjy5U5bkGwa3rUGUb1Q6Q==",
|
"integrity": "sha512-htB/+D/BIGoNTQYffZw4uM4NzzuolCoaA/BusuSIcC8YjmBYQioew5VUZAYdAETPjeed0hqCaW7EHg+Robq8uw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/tsconfig-utils": "^8.35.1",
|
"@typescript-eslint/tsconfig-utils": "^8.43.0",
|
||||||
"@typescript-eslint/types": "^8.35.1",
|
"@typescript-eslint/types": "^8.43.0",
|
||||||
"debug": "^4.3.4"
|
"debug": "^4.3.4"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1799,18 +1797,17 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/scope-manager": {
|
"node_modules/@typescript-eslint/scope-manager": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.43.0.tgz",
|
||||||
"integrity": "sha512-s/Bpd4i7ht2934nG+UoSPlYXd08KYz3bmjLEb7Ye1UVob0d1ENiT3lY8bsCmik4RqfSbPw9xJJHbugpPpP5JUg==",
|
"integrity": "sha512-daSWlQ87ZhsjrbMLvpuuMAt3y4ba57AuvadcR7f3nl8eS3BjRc8L9VLxFLk92RL5xdXOg6IQ+qKjjqNEimGuAg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.35.1"
|
"@typescript-eslint/visitor-keys": "8.43.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -1821,11 +1818,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/tsconfig-utils": {
|
"node_modules/@typescript-eslint/tsconfig-utils": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.43.0.tgz",
|
||||||
"integrity": "sha512-K5/U9VmT9dTHoNowWZpz+/TObS3xqC5h0xAIjXPw+MNcKV9qg6eSatEnmeAwkjHijhACH0/N7bkhKvbt1+DXWQ==",
|
"integrity": "sha512-ALC2prjZcj2YqqL5X/bwWQmHA2em6/94GcbB/KKu5SX3EBDOsqztmmX1kMkvAJHzxk7TazKzJfFiEIagNV3qEA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
},
|
},
|
||||||
@@ -1834,18 +1830,18 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/type-utils": {
|
"node_modules/@typescript-eslint/type-utils": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.43.0.tgz",
|
||||||
"integrity": "sha512-HOrUBlfVRz5W2LIKpXzZoy6VTZzMu2n8q9C2V/cFngIC5U1nStJgv0tMV4sZPzdf4wQm9/ToWUFPMN9Vq9VJQQ==",
|
"integrity": "sha512-qaH1uLBpBuBBuRf8c1mLJ6swOfzCXryhKND04Igr4pckzSEW9JX5Aw9AgW00kwfjWJF0kk0ps9ExKTfvXfw4Qg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/typescript-estree": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"@typescript-eslint/utils": "8.35.1",
|
"@typescript-eslint/typescript-estree": "8.43.0",
|
||||||
|
"@typescript-eslint/utils": "8.43.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"ts-api-utils": "^2.1.0"
|
"ts-api-utils": "^2.1.0"
|
||||||
},
|
},
|
||||||
@@ -1858,15 +1854,14 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0",
|
"eslint": "^8.57.0 || ^9.0.0",
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/types": {
|
"node_modules/@typescript-eslint/types": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.43.0.tgz",
|
||||||
"integrity": "sha512-q/O04vVnKHfrrhNAscndAn1tuQhIkwqnaW+eu5waD5IPts2eX1dgJxgqcPx5BX109/qAz7IG6VrEPTOYKCNfRQ==",
|
"integrity": "sha512-vQ2FZaxJpydjSZJKiSW/LJsabFFvV7KgLC5DiLhkBcykhQj8iK9BOaDmQt74nnKdLvceM5xmhaTF+pLekrxEkw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
},
|
},
|
||||||
@@ -1876,16 +1871,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree": {
|
"node_modules/@typescript-eslint/typescript-estree": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.43.0.tgz",
|
||||||
"integrity": "sha512-Vvpuvj4tBxIka7cPs6Y1uvM7gJgdF5Uu9F+mBJBPY4MhvjrjWGK4H0lVgLJd/8PWZ23FTqsaJaLEkBCFUk8Y9g==",
|
"integrity": "sha512-7Vv6zlAhPb+cvEpP06WXXy/ZByph9iL6BQRBDj4kmBsW98AqEeQHlj/13X+sZOrKSo9/rNKH4Ul4f6EICREFdw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/project-service": "8.35.1",
|
"@typescript-eslint/project-service": "8.43.0",
|
||||||
"@typescript-eslint/tsconfig-utils": "8.35.1",
|
"@typescript-eslint/tsconfig-utils": "8.43.0",
|
||||||
"@typescript-eslint/types": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"@typescript-eslint/visitor-keys": "8.35.1",
|
"@typescript-eslint/visitor-keys": "8.43.0",
|
||||||
"debug": "^4.3.4",
|
"debug": "^4.3.4",
|
||||||
"fast-glob": "^3.3.2",
|
"fast-glob": "^3.3.2",
|
||||||
"is-glob": "^4.0.3",
|
"is-glob": "^4.0.3",
|
||||||
@@ -1901,7 +1895,7 @@
|
|||||||
"url": "https://opencollective.com/typescript-eslint"
|
"url": "https://opencollective.com/typescript-eslint"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
"node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {
|
||||||
@@ -1909,7 +1903,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",
|
||||||
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
"integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"balanced-match": "^1.0.0"
|
"balanced-match": "^1.0.0"
|
||||||
}
|
}
|
||||||
@@ -1919,7 +1912,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",
|
||||||
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
"integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^2.0.1"
|
"brace-expansion": "^2.0.1"
|
||||||
},
|
},
|
||||||
@@ -1931,16 +1923,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/utils": {
|
"node_modules/@typescript-eslint/utils": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.43.0.tgz",
|
||||||
"integrity": "sha512-lhnwatFmOFcazAsUm3ZnZFpXSxiwoa1Lj50HphnDe1Et01NF4+hrdXONSUHIcbVu2eFb1bAf+5yjXkGVkXBKAQ==",
|
"integrity": "sha512-S1/tEmkUeeswxd0GGcnwuVQPFWo8NzZTOMxCvw8BX7OMxnNae+i8Tm7REQen/SwUIPoPqfKn7EaZ+YLpiB3k9g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.7.0",
|
"@eslint-community/eslint-utils": "^4.7.0",
|
||||||
"@typescript-eslint/scope-manager": "8.35.1",
|
"@typescript-eslint/scope-manager": "8.43.0",
|
||||||
"@typescript-eslint/types": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"@typescript-eslint/typescript-estree": "8.35.1"
|
"@typescript-eslint/typescript-estree": "8.43.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -1951,17 +1942,16 @@
|
|||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"eslint": "^8.57.0 || ^9.0.0",
|
"eslint": "^8.57.0 || ^9.0.0",
|
||||||
"typescript": ">=4.8.4 <5.9.0"
|
"typescript": ">=4.8.4 <6.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@typescript-eslint/visitor-keys": {
|
"node_modules/@typescript-eslint/visitor-keys": {
|
||||||
"version": "8.35.1",
|
"version": "8.43.0",
|
||||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.35.1.tgz",
|
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.43.0.tgz",
|
||||||
"integrity": "sha512-VRwixir4zBWCSTP/ljEo091lbpypz57PoeAQ9imjG+vbeof9LplljsL1mos4ccG6H9IjfrVGM359RozUnuFhpw==",
|
"integrity": "sha512-T+S1KqRD4sg/bHfLwrpF/K3gQLBM1n7Rp7OjjikjTEssI2YJzQpi5WXoynOaQ93ERIuq3O8RBTOUYDKszUCEHw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/types": "8.35.1",
|
"@typescript-eslint/types": "8.43.0",
|
||||||
"eslint-visitor-keys": "^4.2.1"
|
"eslint-visitor-keys": "^4.2.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -1977,7 +1967,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",
|
||||||
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
"integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "Apache-2.0",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
},
|
},
|
||||||
@@ -2016,6 +2005,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz",
|
||||||
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
|
"integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
@@ -2291,6 +2281,7 @@
|
|||||||
"url": "https://github.com/sponsors/ai"
|
"url": "https://github.com/sponsors/ai"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"caniuse-lite": "^1.0.30001541",
|
"caniuse-lite": "^1.0.30001541",
|
||||||
"electron-to-chromium": "^1.4.535",
|
"electron-to-chromium": "^1.4.535",
|
||||||
@@ -2746,6 +2737,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz",
|
||||||
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
"integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.6.1",
|
"@eslint-community/regexpp": "^4.6.1",
|
||||||
@@ -3097,7 +3089,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
||||||
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
|
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nodelib/fs.stat": "^2.0.2",
|
"@nodelib/fs.stat": "^2.0.2",
|
||||||
"@nodelib/fs.walk": "^1.2.3",
|
"@nodelib/fs.walk": "^1.2.3",
|
||||||
@@ -3114,7 +3105,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-glob": "^4.0.1"
|
"is-glob": "^4.0.1"
|
||||||
},
|
},
|
||||||
@@ -3744,6 +3734,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz",
|
||||||
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
|
"integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@jest/core": "^29.7.0",
|
"@jest/core": "^29.7.0",
|
||||||
"@jest/types": "^29.6.3",
|
"@jest/types": "^29.6.3",
|
||||||
@@ -4492,7 +4483,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
||||||
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
@@ -5495,6 +5485,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
|
||||||
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
"integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@@ -5507,7 +5498,6 @@
|
|||||||
"version": "5.29.0",
|
"version": "5.29.0",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz",
|
||||||
"integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
|
"integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fastify/busboy": "^2.0.0"
|
"@fastify/busboy": "^2.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -51,39 +51,115 @@ export abstract class JavaBase {
|
|||||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||||
} else {
|
} else {
|
||||||
core.info('Trying to resolve the latest version from remote');
|
core.info('Trying to resolve the latest version from remote');
|
||||||
try {
|
const MAX_RETRIES = 4;
|
||||||
const javaRelease = await this.findPackageForDownload(this.version);
|
const RETRY_DELAY_MS = 2000;
|
||||||
core.info(`Resolved latest version as ${javaRelease.version}`);
|
const retryableCodes = [
|
||||||
if (foundJava?.version === javaRelease.version) {
|
'ETIMEDOUT',
|
||||||
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
'ECONNRESET',
|
||||||
} else {
|
'ENOTFOUND',
|
||||||
core.info('Trying to download...');
|
'ECONNREFUSED'
|
||||||
foundJava = await this.downloadTool(javaRelease);
|
];
|
||||||
core.info(`Java ${foundJava.version} was downloaded`);
|
let retries = MAX_RETRIES;
|
||||||
}
|
while (retries > 0) {
|
||||||
} catch (error: any) {
|
try {
|
||||||
if (error instanceof tc.HTTPError) {
|
// Clear console timers before each attempt to prevent conflicts
|
||||||
if (error.httpStatusCode === 403) {
|
if (retries < MAX_RETRIES && core.isDebug()) {
|
||||||
core.error('HTTP 403: Permission denied or access restricted.');
|
const consoleAny = console as any;
|
||||||
} else if (error.httpStatusCode === 429) {
|
consoleAny._times?.clear?.();
|
||||||
core.warning('HTTP 429: Rate limit exceeded. Please retry later.');
|
|
||||||
} else {
|
|
||||||
core.error(`HTTP ${error.httpStatusCode}: ${error.message}`);
|
|
||||||
}
|
}
|
||||||
} else {
|
const javaRelease = await this.findPackageForDownload(this.version);
|
||||||
const message =
|
core.info(`Resolved latest version as ${javaRelease.version}`);
|
||||||
error instanceof Error ? error.message : JSON.stringify(error);
|
if (foundJava?.version === javaRelease.version) {
|
||||||
core.error(
|
core.info(`Resolved Java ${foundJava.version} from tool-cache`);
|
||||||
`Java setup failed due to network issue or timeout: ${message}`
|
} else {
|
||||||
);
|
core.info('Trying to download...');
|
||||||
|
foundJava = await this.downloadTool(javaRelease);
|
||||||
|
core.info(`Java ${foundJava.version} was downloaded`);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} catch (error: any) {
|
||||||
|
retries--;
|
||||||
|
// Check if error is retryable (including aggregate errors)
|
||||||
|
const isRetryable =
|
||||||
|
(error instanceof tc.HTTPError &&
|
||||||
|
error.httpStatusCode &&
|
||||||
|
[429, 502, 503, 504].includes(error.httpStatusCode)) ||
|
||||||
|
retryableCodes.includes(error?.code) ||
|
||||||
|
(error?.errors &&
|
||||||
|
Array.isArray(error.errors) &&
|
||||||
|
error.errors.some((err: any) =>
|
||||||
|
retryableCodes.includes(err?.code)
|
||||||
|
));
|
||||||
|
if (retries > 0 && isRetryable) {
|
||||||
|
core.debug(
|
||||||
|
`Attempt failed due to network or timeout issues, initiating retry... (${retries} attempts left)`
|
||||||
|
);
|
||||||
|
await new Promise(r => setTimeout(r, RETRY_DELAY_MS));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (error instanceof tc.HTTPError) {
|
||||||
|
if (error.httpStatusCode === 403) {
|
||||||
|
core.error('HTTP 403: Permission denied or access restricted.');
|
||||||
|
} else if (error.httpStatusCode === 429) {
|
||||||
|
core.warning(
|
||||||
|
'HTTP 429: Rate limit exceeded. Please retry later.'
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
core.error(`HTTP ${error.httpStatusCode}: ${error.message}`);
|
||||||
|
}
|
||||||
|
} else if (error && error.errors && Array.isArray(error.errors)) {
|
||||||
|
core.error(
|
||||||
|
`Java setup failed due to network or configuration error(s)`
|
||||||
|
);
|
||||||
|
if (error instanceof Error && error.stack) {
|
||||||
|
core.debug(error.stack);
|
||||||
|
}
|
||||||
|
for (const err of error.errors) {
|
||||||
|
const endpoint = err?.address || err?.hostname || '';
|
||||||
|
const port = err?.port ? `:${err.port}` : '';
|
||||||
|
const message = err?.message || 'Aggregate error';
|
||||||
|
const endpointInfo = !message.includes(endpoint)
|
||||||
|
? ` ${endpoint}${port}`
|
||||||
|
: '';
|
||||||
|
const localInfo =
|
||||||
|
err.localAddress && err.localPort
|
||||||
|
? ` - Local (${err.localAddress}:${err.localPort})`
|
||||||
|
: '';
|
||||||
|
const logMessage = `${message}${endpointInfo}${localInfo}`;
|
||||||
|
core.error(logMessage);
|
||||||
|
core.debug(`${err.stack || err.message}`);
|
||||||
|
Object.entries(err).forEach(([key, value]) => {
|
||||||
|
core.debug(`"${key}": ${JSON.stringify(value)}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const message =
|
||||||
|
error instanceof Error ? error.message : JSON.stringify(error);
|
||||||
|
core.error(`Java setup process failed due to: ${message}`);
|
||||||
|
if (typeof error?.code === 'string') {
|
||||||
|
core.debug(error.stack);
|
||||||
|
}
|
||||||
|
const errorDetails = {
|
||||||
|
name: error.name,
|
||||||
|
message: error.message,
|
||||||
|
...Object.getOwnPropertyNames(error)
|
||||||
|
.filter(prop => !['name', 'message', 'stack'].includes(prop))
|
||||||
|
.reduce<{[key: string]: any}>((acc, prop) => {
|
||||||
|
acc[prop] = error[prop];
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
};
|
||||||
|
Object.entries(errorDetails).forEach(([key, value]) => {
|
||||||
|
core.debug(`"${key}": ${JSON.stringify(value)}`);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
if (error instanceof Error && error.stack) {
|
|
||||||
core.debug(error.stack);
|
|
||||||
}
|
|
||||||
throw error;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!foundJava) {
|
||||||
|
throw new Error('Failed to resolve Java version');
|
||||||
|
}
|
||||||
// JDK folder may contain postfix "Contents/Home" on macOS
|
// JDK folder may contain postfix "Contents/Home" on macOS
|
||||||
const macOSPostfixPath = path.join(
|
const macOSPostfixPath = path.join(
|
||||||
foundJava.path,
|
foundJava.path,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as tc from '@actions/tool-cache';
|
import * as tc from '@actions/tool-cache';
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import {JavaBase} from '../base-installer';
|
import {JavaBase} from '../base-installer';
|
||||||
|
import {HttpCodes} from '@actions/http-client';
|
||||||
|
import {GraalVMEAVersion} from './models';
|
||||||
import {
|
import {
|
||||||
JavaDownloadRelease,
|
JavaDownloadRelease,
|
||||||
JavaInstallerOptions,
|
JavaInstallerOptions,
|
||||||
@@ -16,12 +16,14 @@ import {
|
|||||||
getGitHubHttpHeaders,
|
getGitHubHttpHeaders,
|
||||||
renameWinArchive
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
import {HttpCodes} from '@actions/http-client';
|
|
||||||
import {GraalVMEAVersion} from './models';
|
|
||||||
|
|
||||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm';
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
|
const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform;
|
||||||
|
const GRAALVM_MIN_VERSION = 17;
|
||||||
|
const SUPPORTED_ARCHITECTURES = ['x64', 'aarch64'] as const;
|
||||||
|
type SupportedArchitecture = (typeof SUPPORTED_ARCHITECTURES)[number];
|
||||||
|
type OsVersions = 'linux' | 'macos' | 'windows';
|
||||||
|
|
||||||
export class GraalVMDistribution extends JavaBase {
|
export class GraalVMDistribution extends JavaBase {
|
||||||
constructor(installerOptions: JavaInstallerOptions) {
|
constructor(installerOptions: JavaInstallerOptions) {
|
||||||
@@ -31,38 +33,67 @@ export class GraalVMDistribution extends JavaBase {
|
|||||||
protected async downloadTool(
|
protected async downloadTool(
|
||||||
javaRelease: JavaDownloadRelease
|
javaRelease: JavaDownloadRelease
|
||||||
): Promise<JavaInstallerResults> {
|
): Promise<JavaInstallerResults> {
|
||||||
core.info(
|
try {
|
||||||
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
core.info(
|
||||||
);
|
`Downloading Java ${javaRelease.version} (${this.distribution}) from ${javaRelease.url} ...`
|
||||||
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
);
|
||||||
|
let javaArchivePath = await tc.downloadTool(javaRelease.url);
|
||||||
|
|
||||||
core.info(`Extracting Java archive...`);
|
core.info(`Extracting Java archive...`);
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
if (process.platform === 'win32') {
|
if (IS_WINDOWS) {
|
||||||
javaArchivePath = renameWinArchive(javaArchivePath);
|
javaArchivePath = renameWinArchive(javaArchivePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
const extractedJavaPath = await extractJdkFile(
|
||||||
|
javaArchivePath,
|
||||||
|
extension
|
||||||
|
);
|
||||||
|
|
||||||
|
// Add validation for extracted path
|
||||||
|
if (!fs.existsSync(extractedJavaPath)) {
|
||||||
|
throw new Error(
|
||||||
|
`Extraction failed: path ${extractedJavaPath} does not exist`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const dirContents = fs.readdirSync(extractedJavaPath);
|
||||||
|
if (dirContents.length === 0) {
|
||||||
|
throw new Error(
|
||||||
|
'Extraction failed: no files found in extracted directory'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const archivePath = path.join(extractedJavaPath, dirContents[0]);
|
||||||
|
const version = this.getToolcacheVersionName(javaRelease.version);
|
||||||
|
|
||||||
|
const javaPath = await tc.cacheDir(
|
||||||
|
archivePath,
|
||||||
|
this.toolcacheFolderName,
|
||||||
|
version,
|
||||||
|
this.architecture
|
||||||
|
);
|
||||||
|
|
||||||
|
return {version: javaRelease.version, path: javaPath};
|
||||||
|
} catch (error) {
|
||||||
|
core.error(`Failed to download and extract GraalVM: ${error}`);
|
||||||
|
throw error;
|
||||||
}
|
}
|
||||||
const extractedJavaPath = await extractJdkFile(javaArchivePath, extension);
|
|
||||||
|
|
||||||
const archiveName = fs.readdirSync(extractedJavaPath)[0];
|
|
||||||
const archivePath = path.join(extractedJavaPath, archiveName);
|
|
||||||
const version = this.getToolcacheVersionName(javaRelease.version);
|
|
||||||
|
|
||||||
const javaPath = await tc.cacheDir(
|
|
||||||
archivePath,
|
|
||||||
this.toolcacheFolderName,
|
|
||||||
version,
|
|
||||||
this.architecture
|
|
||||||
);
|
|
||||||
|
|
||||||
return {version: javaRelease.version, path: javaPath};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async findPackageForDownload(
|
protected async findPackageForDownload(
|
||||||
range: string
|
range: string
|
||||||
): Promise<JavaDownloadRelease> {
|
): Promise<JavaDownloadRelease> {
|
||||||
|
// Add input validation
|
||||||
|
if (!range || typeof range !== 'string') {
|
||||||
|
throw new Error('Version range is required and must be a string');
|
||||||
|
}
|
||||||
|
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
if (arch !== 'x64' && arch !== 'aarch64') {
|
if (!SUPPORTED_ARCHITECTURES.includes(arch as SupportedArchitecture)) {
|
||||||
throw new Error(`Unsupported architecture: ${this.architecture}`);
|
throw new Error(
|
||||||
|
`Unsupported architecture: ${this.architecture}. Supported architectures are: ${SUPPORTED_ARCHITECTURES.join(', ')}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.stable) {
|
if (!this.stable) {
|
||||||
@@ -75,52 +106,113 @@ export class GraalVMDistribution extends JavaBase {
|
|||||||
|
|
||||||
const platform = this.getPlatform();
|
const platform = this.getPlatform();
|
||||||
const extension = getDownloadArchiveExtension();
|
const extension = getDownloadArchiveExtension();
|
||||||
let major;
|
const major = range.includes('.') ? range.split('.')[0] : range;
|
||||||
let fileUrl;
|
const majorVersion = parseInt(major);
|
||||||
if (range.includes('.')) {
|
|
||||||
major = range.split('.')[0];
|
if (isNaN(majorVersion)) {
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
throw new Error(`Invalid version format: ${range}`);
|
||||||
} else {
|
|
||||||
major = range;
|
|
||||||
fileUrl = `${GRAALVM_DL_BASE}/${range}/latest/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parseInt(major) < 17) {
|
if (majorVersion < GRAALVM_MIN_VERSION) {
|
||||||
throw new Error('GraalVM is only supported for JDK 17 and later');
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await this.http.head(fileUrl);
|
|
||||||
|
|
||||||
if (response.message.statusCode === HttpCodes.NotFound) {
|
|
||||||
throw new Error(`Could not find GraalVM for SemVer ${range}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (response.message.statusCode !== HttpCodes.OK) {
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Http request for GraalVM failed with status code: ${response.message.statusCode}`
|
`GraalVM is only supported for JDK ${GRAALVM_MIN_VERSION} and later. Requested version: ${major}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fileUrl = this.constructFileUrl(
|
||||||
|
range,
|
||||||
|
major,
|
||||||
|
platform,
|
||||||
|
arch,
|
||||||
|
extension
|
||||||
|
);
|
||||||
|
|
||||||
|
const response = await this.http.head(fileUrl);
|
||||||
|
this.handleHttpResponse(response, range);
|
||||||
|
|
||||||
return {url: fileUrl, version: range};
|
return {url: fileUrl, version: range};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private constructFileUrl(
|
||||||
|
range: string,
|
||||||
|
major: string,
|
||||||
|
platform: string,
|
||||||
|
arch: string,
|
||||||
|
extension: string
|
||||||
|
): string {
|
||||||
|
return range.includes('.')
|
||||||
|
? `${GRAALVM_DL_BASE}/${major}/archive/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`
|
||||||
|
: `${GRAALVM_DL_BASE}/${range}/latest/graalvm-jdk-${range}_${platform}-${arch}_bin.${extension}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private handleHttpResponse(response: any, range: string): void {
|
||||||
|
const statusCode = response.message.statusCode;
|
||||||
|
|
||||||
|
if (statusCode === HttpCodes.NotFound) {
|
||||||
|
throw new Error(
|
||||||
|
`Could not find GraalVM for SemVer ${range}. Please check if this version is available at ${GRAALVM_DL_BASE}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
statusCode === HttpCodes.Unauthorized ||
|
||||||
|
statusCode === HttpCodes.Forbidden
|
||||||
|
) {
|
||||||
|
throw new Error(
|
||||||
|
`Access denied when downloading GraalVM. Status code: ${statusCode}. Please check your credentials or permissions.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (statusCode !== HttpCodes.OK) {
|
||||||
|
throw new Error(
|
||||||
|
`HTTP request for GraalVM failed with status code: ${statusCode} (${response.message.statusMessage || 'Unknown error'})`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async findEABuildDownloadUrl(
|
private async findEABuildDownloadUrl(
|
||||||
javaEaVersion: string
|
javaEaVersion: string
|
||||||
): Promise<JavaDownloadRelease> {
|
): Promise<JavaDownloadRelease> {
|
||||||
|
core.debug(`Searching for EA build: ${javaEaVersion}`);
|
||||||
|
|
||||||
const versions = await this.fetchEAJson(javaEaVersion);
|
const versions = await this.fetchEAJson(javaEaVersion);
|
||||||
|
core.debug(`Found ${versions.length} EA versions`);
|
||||||
|
|
||||||
const latestVersion = versions.find(v => v.latest);
|
const latestVersion = versions.find(v => v.latest);
|
||||||
if (!latestVersion) {
|
if (!latestVersion) {
|
||||||
|
core.error(
|
||||||
|
`Available versions: ${versions.map(v => v.version).join(', ')}`
|
||||||
|
);
|
||||||
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
|
throw new Error(`Unable to find latest version for '${javaEaVersion}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.debug(`Latest version found: ${latestVersion.version}`);
|
||||||
|
|
||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
const file = latestVersion.files.find(
|
const file = latestVersion.files.find(
|
||||||
f => f.arch === arch && f.platform === GRAALVM_PLATFORM
|
f => f.arch === arch && f.platform === GRAALVM_PLATFORM
|
||||||
);
|
);
|
||||||
if (!file || !file.filename.startsWith('graalvm-jdk-')) {
|
|
||||||
throw new Error(`Unable to find file metadata for '${javaEaVersion}'`);
|
if (!file) {
|
||||||
|
core.error(
|
||||||
|
`Available files for architecture ${arch}: ${JSON.stringify(latestVersion.files)}`
|
||||||
|
);
|
||||||
|
throw new Error(
|
||||||
|
`Unable to find file for architecture '${arch}' and platform '${GRAALVM_PLATFORM}'`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!file.filename.startsWith('graalvm-jdk-')) {
|
||||||
|
throw new Error(
|
||||||
|
`Invalid filename format: ${file.filename}. Expected to start with 'graalvm-jdk-'`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const downloadUrl = `${latestVersion.download_base_url}${file.filename}`;
|
||||||
|
core.debug(`Download URL: ${downloadUrl}`);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
url: `${latestVersion.download_base_url}${file.filename}`,
|
url: downloadUrl,
|
||||||
version: latestVersion.version
|
version: latestVersion.version
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -128,49 +220,59 @@ export class GraalVMDistribution extends JavaBase {
|
|||||||
private async fetchEAJson(
|
private async fetchEAJson(
|
||||||
javaEaVersion: string
|
javaEaVersion: string
|
||||||
): Promise<GraalVMEAVersion[]> {
|
): Promise<GraalVMEAVersion[]> {
|
||||||
const owner = 'graalvm';
|
const url = `https://api.github.com/repos/graalvm/oracle-graalvm-ea-builds/contents/versions/${javaEaVersion}.json?ref=main`;
|
||||||
const repository = 'oracle-graalvm-ea-builds';
|
|
||||||
const branch = 'main';
|
|
||||||
const filePath = `versions/${javaEaVersion}.json`;
|
|
||||||
|
|
||||||
const url = `https://api.github.com/repos/${owner}/${repository}/contents/${filePath}?ref=${branch}`;
|
|
||||||
|
|
||||||
const headers = getGitHubHttpHeaders();
|
const headers = getGitHubHttpHeaders();
|
||||||
|
|
||||||
core.debug(
|
core.debug(
|
||||||
`Trying to fetch available version info for GraalVM EA builds from '${url}'`
|
`Trying to fetch available version info for GraalVM EA builds from '${url}'`
|
||||||
);
|
);
|
||||||
let fetchedJson;
|
|
||||||
try {
|
try {
|
||||||
fetchedJson = (await this.http.getJson<GraalVMEAVersion[]>(url, headers))
|
const response = await this.http.getJson<GraalVMEAVersion[]>(
|
||||||
.result;
|
url,
|
||||||
} catch (err) {
|
headers
|
||||||
throw Error(
|
);
|
||||||
`Fetching version info for GraalVM EA builds from '${url}' failed with the error: ${
|
|
||||||
(err as Error).message
|
if (!response.result) {
|
||||||
}`
|
throw new Error(
|
||||||
|
`No GraalVM EA build found for version '${javaEaVersion}'. Please check if the version is correct.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return response.result;
|
||||||
|
} catch (error) {
|
||||||
|
if (error instanceof Error) {
|
||||||
|
// Check if it's a 404 error (file not found)
|
||||||
|
if (error.message?.includes('404')) {
|
||||||
|
throw new Error(
|
||||||
|
`GraalVM EA version '${javaEaVersion}' not found. Please verify the version exists in the EA builds repository.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// Re-throw with more context
|
||||||
|
throw new Error(
|
||||||
|
`Failed to fetch GraalVM EA version information for '${javaEaVersion}': ${error.message}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// If it's not an Error instance, throw a generic error
|
||||||
|
throw new Error(
|
||||||
|
`Failed to fetch GraalVM EA version information for '${javaEaVersion}'`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (fetchedJson === null) {
|
|
||||||
throw Error(
|
|
||||||
`No GraalVM EA build found. Are you sure java-version: '${javaEaVersion}' is correct?`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return fetchedJson;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
public getPlatform(platform: NodeJS.Platform = process.platform): OsVersions {
|
||||||
switch (platform) {
|
const platformMap: Record<string, OsVersions> = {
|
||||||
case 'darwin':
|
darwin: 'macos',
|
||||||
return 'macos';
|
win32: 'windows',
|
||||||
case 'win32':
|
linux: 'linux'
|
||||||
return 'windows';
|
};
|
||||||
case 'linux':
|
|
||||||
return 'linux';
|
const result = platformMap[platform];
|
||||||
default:
|
if (!result) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`
|
`Platform '${platform}' is not supported. Supported platforms: 'linux', 'macos', 'windows'`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,90 +1,133 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"version": "21.0.2",
|
"version": "25.0.0",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-25.0.0-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-25.0.0-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-windows-x64.zip",
|
"filename": "microsoft-jdk-25.0.0-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-25.0.0-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-25.0.0-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.2-windows-aarch64.zip",
|
"filename": "microsoft-jdk-25.0.0-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-25.0.0-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"version": "21.0.1",
|
"version": "21.0.2",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-windows-x64.zip",
|
"filename": "microsoft-jdk-21.0.2-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-21.0.2-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-21.0.1-windows-aarch64.zip",
|
"filename": "microsoft-jdk-21.0.2-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.2-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"version": "21.0.1",
|
||||||
|
"stable": true,
|
||||||
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-macos-x64.tar.gz",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "darwin",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-x64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-linux-x64.tar.gz",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "linux",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-x64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-windows-x64.zip",
|
||||||
|
"arch": "x64",
|
||||||
|
"platform": "win32",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-x64.zip"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-macos-aarch64.tar.gz",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "darwin",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-macos-aarch64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-linux-aarch64.tar.gz",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "linux",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-linux-aarch64.tar.gz"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename": "microsoft-jdk-21.0.1-windows-aarch64.zip",
|
||||||
|
"arch": "aarch64",
|
||||||
|
"platform": "win32",
|
||||||
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-21.0.1-windows-aarch64.zip"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"version": "21.0.0",
|
"version": "21.0.0",
|
||||||
"stable": true,
|
"stable": true,
|
||||||
@@ -176,42 +219,42 @@
|
|||||||
"stable": true,
|
"stable": true,
|
||||||
"release_url": "https://aka.ms/download-jdk",
|
"release_url": "https://aka.ms/download-jdk",
|
||||||
"files": [
|
"files": [
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-macos-x64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-macos-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-linux-x64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-linux-x64.tar.gz",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-x64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-windows-x64.zip",
|
"filename": "microsoft-jdk-17.0.9-windows-x64.zip",
|
||||||
"arch": "x64",
|
"arch": "x64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-x64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-x64.zip"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-macos-aarch64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-macos-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "darwin",
|
"platform": "darwin",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-macos-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-linux-aarch64.tar.gz",
|
"filename": "microsoft-jdk-17.0.9-linux-aarch64.tar.gz",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "linux",
|
"platform": "linux",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-aarch64.tar.gz"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-linux-aarch64.tar.gz"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"filename": "microsoft-jdk-17.0.9-windows-aarch64.zip",
|
"filename": "microsoft-jdk-17.0.9-windows-aarch64.zip",
|
||||||
"arch": "aarch64",
|
"arch": "aarch64",
|
||||||
"platform": "win32",
|
"platform": "win32",
|
||||||
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-aarch64.zip"
|
"download_url": "https://aka.ms/download-jdk/microsoft-jdk-17.0.9-windows-aarch64.zip"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -835,4 +878,4 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
convertVersionToSemver,
|
convertVersionToSemver,
|
||||||
extractJdkFile,
|
extractJdkFile,
|
||||||
getDownloadArchiveExtension,
|
getDownloadArchiveExtension,
|
||||||
getGitHubHttpHeaders,
|
|
||||||
isVersionSatisfies,
|
isVersionSatisfies,
|
||||||
renameWinArchive
|
renameWinArchive
|
||||||
} from '../../util';
|
} from '../../util';
|
||||||
@@ -64,13 +63,12 @@ export class SapMachineDistribution extends JavaBase {
|
|||||||
const arch = this.distributionArchitecture();
|
const arch = this.distributionArchitecture();
|
||||||
|
|
||||||
let fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
let fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
||||||
'https://sap.github.io/SapMachine/assets/data/sapmachine-releases-all.json'
|
'https://sapmachine.io/assets/data/sapmachine-releases-all.json'
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!fetchedReleasesJson) {
|
if (!fetchedReleasesJson) {
|
||||||
fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
fetchedReleasesJson = await this.fetchReleasesFromUrl(
|
||||||
'https://api.github.com/repos/SAP/SapMachine/contents/assets/data/sapmachine-releases-all.json?ref=gh-pages',
|
'https://sap.github.io/SapMachine/assets/data/sapmachine-releases-all.json'
|
||||||
getGitHubHttpHeaders()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
18
src/util.ts
18
src/util.ts
@@ -134,20 +134,24 @@ export function getVersionFromFileContent(
|
|||||||
if (versionFileName == '.tool-versions') {
|
if (versionFileName == '.tool-versions') {
|
||||||
javaVersionRegExp =
|
javaVersionRegExp =
|
||||||
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
/^java\s+(?:\S*-)?(?<version>\d+(?:\.\d+)*([+_.-](?:openj9[-._]?\d[\w.-]*|java\d+|jre[-_\w]*|OpenJDK\d+[\w_.-]*|[a-z0-9]+))*)/im;
|
||||||
|
} else if (versionFileName == '.sdkmanrc') {
|
||||||
|
javaVersionRegExp = /^java\s*=\s*(?<version>[^-]+)/m;
|
||||||
} else {
|
} else {
|
||||||
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
javaVersionRegExp = /(?<version>(?<=(^|\s|-))(\d+\S*))(\s|$)/;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContent = content.match(javaVersionRegExp)?.groups?.version
|
const capturedVersion = content.match(javaVersionRegExp)?.groups?.version
|
||||||
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
? (content.match(javaVersionRegExp)?.groups?.version as string)
|
||||||
: '';
|
: '';
|
||||||
if (!fileContent) {
|
|
||||||
|
core.debug(
|
||||||
|
`Parsed version '${capturedVersion}' from file '${versionFileName}'`
|
||||||
|
);
|
||||||
|
if (!capturedVersion) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(`Version from file '${fileContent}'`);
|
const tentativeVersion = avoidOldNotation(capturedVersion);
|
||||||
|
|
||||||
const tentativeVersion = avoidOldNotation(fileContent);
|
|
||||||
const rawVersion = tentativeVersion.split('-')[0];
|
const rawVersion = tentativeVersion.split('-')[0];
|
||||||
|
|
||||||
let version = semver.validRange(rawVersion)
|
let version = semver.validRange(rawVersion)
|
||||||
@@ -184,8 +188,8 @@ export function convertVersionToSemver(version: number[] | string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
|
export function getGitHubHttpHeaders(): OutgoingHttpHeaders {
|
||||||
const token = core.getInput('token');
|
const resolvedToken = core.getInput('token') || process.env.GITHUB_TOKEN;
|
||||||
const auth = !token ? undefined : `token ${token}`;
|
const auth = !resolvedToken ? undefined : `token ${resolvedToken}`;
|
||||||
|
|
||||||
const headers: OutgoingHttpHeaders = {
|
const headers: OutgoingHttpHeaders = {
|
||||||
accept: 'application/vnd.github.VERSION.raw'
|
accept: 'application/vnd.github.VERSION.raw'
|
||||||
|
|||||||
Reference in New Issue
Block a user