mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-01-18 11:12:43 +08:00
Temporarily use 22.3.1
for latest
builds.
This is a temporary fix while we are rolling out the new GraalVM for JDK17/20 release.
This commit is contained in:
parent
babc303d7e
commit
b11d36630f
@ -1,7 +1,7 @@
|
||||
import * as path from 'path'
|
||||
import * as graalvm from '../src/graalvm'
|
||||
import {expect, test} from '@jest/globals'
|
||||
import {getLatestRelease} from '../src/utils'
|
||||
import {getTaggedRelease} from '../src/utils'
|
||||
import {findGraalVMVersion, findHighestJavaVersion} from '../src/graalvm'
|
||||
import {GRAALVM_RELEASES_REPO} from '../src/constants'
|
||||
|
||||
@ -31,7 +31,10 @@ test('request invalid version/javaVersion', async () => {
|
||||
})
|
||||
|
||||
test('find version/javaVersion', async () => {
|
||||
const latestRelease = await getLatestRelease(GRAALVM_RELEASES_REPO)
|
||||
const latestRelease = await getTaggedRelease(
|
||||
GRAALVM_RELEASES_REPO,
|
||||
'vm-22.3.1'
|
||||
)
|
||||
const latestVersion = findGraalVMVersion(latestRelease)
|
||||
expect(latestVersion).not.toBe('')
|
||||
const latestJavaVersion = findHighestJavaVersion(latestRelease, latestVersion)
|
||||
@ -43,7 +46,7 @@ test('find version/javaVersion', async () => {
|
||||
findGraalVMVersion(invalidRelease)
|
||||
} catch (err) {
|
||||
if (!(err instanceof Error)) {
|
||||
fail(`Unexpected non-Erro: ${err}`)
|
||||
fail(`Unexpected non-Error: ${err}`)
|
||||
}
|
||||
error = err
|
||||
}
|
||||
|
15
dist/cleanup/index.js
generated
vendored
15
dist/cleanup/index.js
generated
vendored
@ -70461,7 +70461,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getLatestRelease = exports.exec = void 0;
|
||||
exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const github = __importStar(__nccwpck_require__(5438));
|
||||
@ -70503,6 +70503,19 @@ function getLatestRelease(repo) {
|
||||
});
|
||||
}
|
||||
exports.getLatestRelease = getLatestRelease;
|
||||
function getTaggedRelease(repo, tag) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const githubToken = getGitHubToken();
|
||||
const options = githubToken.length > 0 ? { auth: githubToken } : {};
|
||||
const octokit = new GitHubDotCom(options);
|
||||
return (yield octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo,
|
||||
tag
|
||||
})).data;
|
||||
});
|
||||
}
|
||||
exports.getTaggedRelease = getTaggedRelease;
|
||||
function downloadAndExtractJDK(downloadUrl) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return findJavaHomeInSubfolder(yield extract(yield tc.downloadTool(downloadUrl)));
|
||||
|
22
dist/main/index.js
generated
vendored
22
dist/main/index.js
generated
vendored
@ -70141,7 +70141,7 @@ function checkForUpdates(graalVMVersion, javaVersion) {
|
||||
core.notice('Please consider upgrading your project to Java 17+. GraalVM 22.3.X releases are the last to support JDK11: https://github.com/oracle/graal/issues/5063');
|
||||
return;
|
||||
}
|
||||
const latestRelease = yield (0, utils_1.getLatestRelease)(constants_1.GRAALVM_RELEASES_REPO);
|
||||
const latestRelease = yield (0, utils_1.getTaggedRelease)(constants_1.GRAALVM_RELEASES_REPO, 'vm-22.3.1');
|
||||
const latestGraalVMVersion = (0, graalvm_1.findGraalVMVersion)(latestRelease);
|
||||
const selectedVersion = (0, utils_1.toSemVer)(graalVMVersion);
|
||||
const latestVersion = (0, utils_1.toSemVer)(latestGraalVMVersion);
|
||||
@ -70778,10 +70778,11 @@ const GRAALVM_REPO_DEV_BUILDS = 'graalvm-ce-dev-builds';
|
||||
const GRAALVM_TAG_PREFIX = 'vm-';
|
||||
function setUpGraalVMLatest(gdsToken, javaVersion) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const lockedVersion = '22.3.1';
|
||||
if (gdsToken.length > 0) {
|
||||
return setUpGraalVMRelease(gdsToken, c.VERSION_LATEST, javaVersion);
|
||||
return setUpGraalVMRelease(gdsToken, lockedVersion, javaVersion);
|
||||
}
|
||||
const latestRelease = yield (0, utils_1.getLatestRelease)(c.GRAALVM_RELEASES_REPO);
|
||||
const latestRelease = yield (0, utils_1.getTaggedRelease)(c.GRAALVM_RELEASES_REPO, GRAALVM_TAG_PREFIX + lockedVersion);
|
||||
const version = findGraalVMVersion(latestRelease);
|
||||
return setUpGraalVMRelease(gdsToken, version, javaVersion);
|
||||
});
|
||||
@ -71292,7 +71293,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getLatestRelease = exports.exec = void 0;
|
||||
exports.createPRComment = exports.isPREvent = exports.toSemVer = exports.calculateSHA256 = exports.downloadExtractAndCacheJDK = exports.downloadAndExtractJDK = exports.getTaggedRelease = exports.getLatestRelease = exports.exec = void 0;
|
||||
const c = __importStar(__nccwpck_require__(9042));
|
||||
const core = __importStar(__nccwpck_require__(2186));
|
||||
const github = __importStar(__nccwpck_require__(5438));
|
||||
@ -71334,6 +71335,19 @@ function getLatestRelease(repo) {
|
||||
});
|
||||
}
|
||||
exports.getLatestRelease = getLatestRelease;
|
||||
function getTaggedRelease(repo, tag) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const githubToken = getGitHubToken();
|
||||
const options = githubToken.length > 0 ? { auth: githubToken } : {};
|
||||
const octokit = new GitHubDotCom(options);
|
||||
return (yield octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo,
|
||||
tag
|
||||
})).data;
|
||||
});
|
||||
}
|
||||
exports.getTaggedRelease = getTaggedRelease;
|
||||
function downloadAndExtractJDK(downloadUrl) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
return findJavaHomeInSubfolder(yield extract(yield tc.downloadTool(downloadUrl)));
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as core from '@actions/core'
|
||||
import {getLatestRelease, toSemVer} from '../utils'
|
||||
import {getTaggedRelease, toSemVer} from '../utils'
|
||||
import {lt, major, minor, valid} from 'semver'
|
||||
import {findGraalVMVersion} from '../graalvm'
|
||||
import {GRAALVM_RELEASES_REPO} from '../constants'
|
||||
@ -15,7 +15,10 @@ export async function checkForUpdates(
|
||||
return
|
||||
}
|
||||
|
||||
const latestRelease = await getLatestRelease(GRAALVM_RELEASES_REPO)
|
||||
const latestRelease = await getTaggedRelease(
|
||||
GRAALVM_RELEASES_REPO,
|
||||
'vm-22.3.1'
|
||||
)
|
||||
const latestGraalVMVersion = findGraalVMVersion(latestRelease)
|
||||
const selectedVersion = toSemVer(graalVMVersion)
|
||||
const latestVersion = toSemVer(latestGraalVMVersion)
|
||||
|
@ -2,7 +2,8 @@ import * as c from './constants'
|
||||
import {
|
||||
downloadAndExtractJDK,
|
||||
downloadExtractAndCacheJDK,
|
||||
getLatestRelease
|
||||
getLatestRelease,
|
||||
getTaggedRelease
|
||||
} from './utils'
|
||||
import {downloadGraalVMEE} from './gds'
|
||||
import {downloadTool} from '@actions/tool-cache'
|
||||
@ -15,10 +16,14 @@ export async function setUpGraalVMLatest(
|
||||
gdsToken: string,
|
||||
javaVersion: string
|
||||
): Promise<string> {
|
||||
const lockedVersion = '22.3.1'
|
||||
if (gdsToken.length > 0) {
|
||||
return setUpGraalVMRelease(gdsToken, c.VERSION_LATEST, javaVersion)
|
||||
return setUpGraalVMRelease(gdsToken, lockedVersion, javaVersion)
|
||||
}
|
||||
const latestRelease = await getLatestRelease(c.GRAALVM_RELEASES_REPO)
|
||||
const latestRelease = await getTaggedRelease(
|
||||
c.GRAALVM_RELEASES_REPO,
|
||||
GRAALVM_TAG_PREFIX + lockedVersion
|
||||
)
|
||||
const version = findGraalVMVersion(latestRelease)
|
||||
return setUpGraalVMRelease(gdsToken, version, javaVersion)
|
||||
}
|
||||
|
16
src/utils.ts
16
src/utils.ts
@ -47,6 +47,22 @@ export async function getLatestRelease(
|
||||
).data
|
||||
}
|
||||
|
||||
export async function getTaggedRelease(
|
||||
repo: string,
|
||||
tag: string
|
||||
): Promise<c.LatestReleaseResponse['data']> {
|
||||
const githubToken = getGitHubToken()
|
||||
const options = githubToken.length > 0 ? {auth: githubToken} : {}
|
||||
const octokit = new GitHubDotCom(options)
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo,
|
||||
tag
|
||||
})
|
||||
).data
|
||||
}
|
||||
|
||||
export async function downloadAndExtractJDK(
|
||||
downloadUrl: string
|
||||
): Promise<string> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user