Add infrastructure for setting up GraalVM.

This commit is contained in:
Fabio Niephaus
2022-01-03 08:52:11 +01:00
parent db50d45bd5
commit a686e47055
5 changed files with 267 additions and 0 deletions

19
src/constants.ts Normal file
View File

@@ -0,0 +1,19 @@
import * as otypes from '@octokit/types'
import {homedir} from 'os'
import {join} from 'path'
export const IS_MACOS = process.platform === 'darwin'
export const IS_WINDOWS = process.platform === 'win32'
export const VERSION_LATEST = 'latest'
export const VERSION_NIGHTLY = 'nightly'
export const VERSION_TRUNK = 'trunk'
export const GRAALVM_BASE = join(homedir(), '.graalvm')
export const GRAALVM_FILE_EXTENSION = IS_WINDOWS ? '.zip' : '.tar.gz'
export const GRAALVM_GH_USER = 'graalvm'
export const GRAALVM_PLATFORM = IS_WINDOWS ? 'windows' : process.platform
export const JDK_HOME_SUFFIX = IS_MACOS ? '/Contents/Home' : ''
export type LatestReleaseResponse =
otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']