mirror of
https://github.com/graalvm/setup-graalvm.git
synced 2025-12-06 07:48:06 +08:00
Compare commits
12 Commits
v1.4.0
...
cfa19cdd20
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfa19cdd20 | ||
|
|
dc8a7ea391 | ||
|
|
8623f5e13e | ||
|
|
23e0acf4b9 | ||
|
|
eec48106e0 | ||
|
|
0f48fc0abd | ||
|
|
3716035e2a | ||
|
|
2a24120090 | ||
|
|
39a82c0b2c | ||
|
|
62b95e60c7 | ||
|
|
a19d2ab4f7 | ||
|
|
319b5062ea |
4
.github/workflows/check-dist.yml
vendored
4
.github/workflows/check-dist.yml
vendored
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
- name: Setup Node.js
|
||||
id: setup-node
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
@@ -70,7 +70,7 @@ jobs:
|
||||
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
|
||||
name: Upload Artifact
|
||||
id: upload
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: dist
|
||||
path: dist/
|
||||
|
||||
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: npm
|
||||
@@ -372,18 +372,22 @@ jobs:
|
||||
./helloworld
|
||||
|
||||
test-action-native-image-musl:
|
||||
name: native-image-musl on ubuntu-latest
|
||||
runs-on: ubuntu-latest
|
||||
name: native-image-musl + JDK${{ matrix.java-version }} on ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write # for `native-image-pr-reports` option
|
||||
strategy:
|
||||
matrix:
|
||||
java-version: ['21', '25']
|
||||
os: [ubuntu-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
- name: Run setup-graalvm action
|
||||
uses: ./
|
||||
with:
|
||||
java-version: 'dev'
|
||||
distribution: 'graalvm-community'
|
||||
java-version: ${{ matrix.java-version }}
|
||||
distribution: 'graalvm'
|
||||
native-image-musl: 'true'
|
||||
native-image-job-reports: 'true'
|
||||
native-image-pr-reports: 'true'
|
||||
@@ -392,7 +396,7 @@ jobs:
|
||||
run: |
|
||||
echo 'public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World!"); } }' > HelloWorld.java
|
||||
javac HelloWorld.java
|
||||
native-image --static --libc=musl HelloWorld
|
||||
native-image --static --libc=musl --gc=G1 HelloWorld
|
||||
./helloworld
|
||||
|
||||
test-action-extensive:
|
||||
|
||||
3838
dist/cleanup.js
generated
vendored
3838
dist/cleanup.js
generated
vendored
File diff suppressed because it is too large
Load Diff
5192
dist/main.js
generated
vendored
5192
dist/main.js
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -9,13 +9,9 @@ import _import from 'eslint-plugin-import'
|
||||
import jest from 'eslint-plugin-jest'
|
||||
import prettier from 'eslint-plugin-prettier'
|
||||
import globals from 'globals'
|
||||
import path from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url)
|
||||
const __dirname = path.dirname(__filename)
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
baseDirectory: import.meta.dirname,
|
||||
recommendedConfig: js.configs.recommended,
|
||||
allConfig: js.configs.all
|
||||
})
|
||||
@@ -52,8 +48,18 @@ export default [
|
||||
sourceType: 'module',
|
||||
|
||||
parserOptions: {
|
||||
project: ['tsconfig.eslint.json'],
|
||||
tsconfigRootDir: __dirname
|
||||
projectService: {
|
||||
allowDefaultProject: [
|
||||
'__fixtures__/*.ts',
|
||||
'__tests__/*.ts',
|
||||
'eslint.config.mjs',
|
||||
'jest.config.js',
|
||||
'rollup.cleanup.config.ts',
|
||||
'rollup.main.config.ts'
|
||||
],
|
||||
maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING: 32
|
||||
},
|
||||
tsconfigRootDir: import.meta.dirname
|
||||
}
|
||||
},
|
||||
|
||||
@@ -61,7 +67,7 @@ export default [
|
||||
'import/resolver': {
|
||||
typescript: {
|
||||
alwaysTryTypes: true,
|
||||
project: 'tsconfig.eslint.json'
|
||||
project: 'tsconfig.json'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -20,7 +20,7 @@ export default {
|
||||
'^.+\\.ts$': [
|
||||
'ts-jest',
|
||||
{
|
||||
tsconfig: 'tsconfig.eslint.json',
|
||||
tsconfig: 'tsconfig.json',
|
||||
useESM: true
|
||||
}
|
||||
]
|
||||
|
||||
1242
package-lock.json
generated
1242
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
37
package.json
37
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "setup-graalvm",
|
||||
"author": "GraalVM Community",
|
||||
"description": "GitHub Action for GraalVM",
|
||||
"version": "1.4.0",
|
||||
"version": "1.4.2",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"repository": {
|
||||
@@ -37,48 +37,47 @@
|
||||
},
|
||||
"license": "UPL",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.5",
|
||||
"@actions/cache": "^4.1.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/github": "^6.0.1",
|
||||
"@actions/glob": "^0.5.0",
|
||||
"@actions/http-client": "^2.2.3",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/http-client": "^3.0.0",
|
||||
"@actions/io": "^2.0.0",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"@octokit/types": "^14.1.0",
|
||||
"@octokit/types": "^16.0.0",
|
||||
"@github/dependency-submission-toolkit": "^2.0.5",
|
||||
"semver": "^7.7.2",
|
||||
"semver": "^7.7.3",
|
||||
"uuid": "^13.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/compat": "^1.3.2",
|
||||
"@rollup/plugin-commonjs": "^28.0.6",
|
||||
"@eslint/compat": "^1.4.1",
|
||||
"@rollup/plugin-commonjs": "^29.0.0",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
||||
"@rollup/plugin-typescript": "^12.1.4",
|
||||
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||
"@rollup/plugin-typescript": "^12.3.0",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.4.0",
|
||||
"@types/node": "^24.9.2",
|
||||
"@types/semver": "^7.7.1",
|
||||
"@types/uuid": "^10.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.46.2",
|
||||
"@typescript-eslint/parser": "^8.31.1",
|
||||
"eslint": "^9.35.0",
|
||||
"eslint": "^9.39.0",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-import-resolver-typescript": "^4.4.4",
|
||||
"eslint-plugin-import": "^2.32.0",
|
||||
"eslint-plugin-jest": "^29.0.1",
|
||||
"eslint-plugin-jsonc": "^2.20.1",
|
||||
"eslint-plugin-jsonc": "^2.21.0",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"jest": "^30.1.3",
|
||||
"jest": "^30.2.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"prettier": "^3.6.2",
|
||||
"prettier-eslint": "^16.4.2",
|
||||
"rollup": "^4.50.2",
|
||||
"ts-jest": "^29.4.1",
|
||||
"rollup": "^4.52.5",
|
||||
"ts-jest": "^29.4.5",
|
||||
"ts-jest-resolver": "^2.0.1",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^5.9.2"
|
||||
"typescript": "^5.9.3"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rollup/rollup-linux-x64-gnu": "*"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as otypes from '@octokit/types'
|
||||
|
||||
export const ACTION_VERSION = '1.4.0'
|
||||
export const ACTION_VERSION = '1.4.2'
|
||||
|
||||
export const INPUT_VERSION = 'version'
|
||||
export const INPUT_GDS_TOKEN = 'gds-token'
|
||||
@@ -53,13 +53,13 @@ export const ERROR_REQUEST = 'Please file an issue at: https://github.com/graalv
|
||||
export const ERROR_HINT =
|
||||
'If you think this is a mistake, please file an issue at: https://github.com/graalvm/setup-graalvm/issues.'
|
||||
|
||||
export type LatestReleaseResponse = otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']
|
||||
export type LatestReleaseResponseData =
|
||||
otypes.Endpoints['GET /repos/{owner}/{repo}/releases/latest']['response']['data']
|
||||
|
||||
export type MatchingRefsResponse = otypes.Endpoints['GET /repos/{owner}/{repo}/git/matching-refs/{ref}']['response']
|
||||
export type MatchingRefsResponseData =
|
||||
otypes.Endpoints['GET /repos/{owner}/{repo}/git/matching-refs/{ref}']['response']['data']
|
||||
|
||||
export type ReleasesResponse = otypes.Endpoints['GET /repos/{owner}/{repo}/releases']['response']
|
||||
|
||||
export type ContentsResponse = otypes.Endpoints['GET /repos/{owner}/{repo}/contents/{path}']['response']
|
||||
export type ContentsResponseData = otypes.Endpoints['GET /repos/{owner}/{repo}/contents/{path}']['response']['data']
|
||||
|
||||
export interface OracleGraalVMEAFile {
|
||||
filename: string
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import * as c from '../constants.js'
|
||||
import * as core from '@actions/core'
|
||||
import * as tc from '@actions/tool-cache'
|
||||
import { exec } from '../utils.js'
|
||||
import { join } from 'path'
|
||||
|
||||
const MUSL_NAME = 'x86_64-linux-musl-native'
|
||||
const MUSL_VERSION = '10.2.1'
|
||||
const MUSL_NAME = 'musl-toolchain'
|
||||
const MUSL_VERSION = '1.2.5-oracle-00001'
|
||||
|
||||
export async function setUpNativeImageMusl(): Promise<void> {
|
||||
if (!c.IS_LINUX) {
|
||||
@@ -18,26 +17,10 @@ export async function setUpNativeImageMusl(): Promise<void> {
|
||||
} else {
|
||||
core.startGroup(`Setting up musl for GraalVM Native Image...`)
|
||||
const muslDownloadPath = await tc.downloadTool(
|
||||
`https://github.com/graalvm/setup-graalvm/releases/download/x86_64-linux-musl-${MUSL_VERSION}/${MUSL_NAME}.tgz`
|
||||
`https://gds.oracle.com/download/bfs/archive/musl-toolchain-${MUSL_VERSION}-linux-amd64.tar.gz`
|
||||
)
|
||||
const muslExtractPath = await tc.extractTar(muslDownloadPath)
|
||||
const muslPath = join(muslExtractPath, MUSL_NAME)
|
||||
|
||||
const zlibCommit = 'ec3df00224d4b396e2ac6586ab5d25f673caa4c2'
|
||||
const zlibDownloadPath = await tc.downloadTool(`https://github.com/madler/zlib/archive/${zlibCommit}.tar.gz`)
|
||||
const zlibExtractPath = await tc.extractTar(zlibDownloadPath)
|
||||
const zlibPath = join(zlibExtractPath, `zlib-${zlibCommit}`)
|
||||
const zlibBuildOptions = {
|
||||
cwd: zlibPath,
|
||||
env: {
|
||||
...process.env,
|
||||
CC: join(muslPath, 'bin', 'gcc')
|
||||
}
|
||||
}
|
||||
await exec('./configure', [`--prefix=${muslPath}`, '--static'], zlibBuildOptions)
|
||||
await exec('make', [], zlibBuildOptions)
|
||||
await exec('make', ['install'], { cwd: zlibPath })
|
||||
|
||||
core.info(`Adding ${MUSL_NAME} ${MUSL_VERSION} to tool-cache ...`)
|
||||
toolPath = await tc.cacheDir(muslPath, MUSL_NAME, MUSL_VERSION)
|
||||
core.endGroup()
|
||||
|
||||
@@ -174,7 +174,7 @@ export async function setUpGraalVMJDKDevBuild(): Promise<string> {
|
||||
return downloadAndExtractJDK(downloadUrl)
|
||||
}
|
||||
|
||||
export function findHighestJavaVersion(release: c.LatestReleaseResponse['data'], version: string): string {
|
||||
export function findHighestJavaVersion(release: c.LatestReleaseResponseData, version: string): string {
|
||||
const graalVMIdentifierPattern = determineGraalVMLegacyIdentifier(false, version, '(\\d+)')
|
||||
const expectedFileNameRegExp = new RegExp(
|
||||
`^${graalVMIdentifierPattern}${c.GRAALVM_FILE_EXTENSION.replace(/\./g, '\\.')}$`
|
||||
@@ -214,7 +214,7 @@ export async function setUpGraalVMLatest_22_X(gdsToken: string, javaVersion: str
|
||||
return setUpGraalVMRelease(gdsToken, version, javaVersion)
|
||||
}
|
||||
|
||||
export function findGraalVMVersion(release: c.LatestReleaseResponse['data']) {
|
||||
export function findGraalVMVersion(release: c.LatestReleaseResponseData) {
|
||||
const tag_name = release.tag_name
|
||||
if (!tag_name.startsWith(GRAALVM_TAG_PREFIX)) {
|
||||
throw new Error(`Could not find latest GraalVM release: ${tag_name}`)
|
||||
@@ -234,7 +234,7 @@ export async function setUpGraalVMRelease(gdsToken: string, version: string, jav
|
||||
return downloadExtractAndCacheJDK(downloader, toolName, version)
|
||||
}
|
||||
|
||||
function findDownloadUrl(release: c.LatestReleaseResponse['data'], javaVersion: string): string {
|
||||
function findDownloadUrl(release: c.LatestReleaseResponseData, javaVersion: string): string {
|
||||
const graalVMIdentifier = determineGraalVMLegacyIdentifier(false, c.VERSION_DEV, javaVersion)
|
||||
const expectedFileName = `${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`
|
||||
for (const asset of release.assets) {
|
||||
|
||||
16
src/utils.ts
16
src/utils.ts
@@ -18,17 +18,17 @@ export async function exec(commandLine: string, args?: string[], options?: ExecO
|
||||
}
|
||||
}
|
||||
|
||||
export async function getLatestRelease(repo: string): Promise<c.LatestReleaseResponse['data']> {
|
||||
export async function getLatestRelease(repo: string): Promise<c.LatestReleaseResponseData> {
|
||||
const octokit = getOctokit()
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/releases/latest', {
|
||||
owner: c.GRAALVM_GH_USER,
|
||||
repo
|
||||
})
|
||||
).data
|
||||
).data as c.LatestReleaseResponseData /** missing digest property */
|
||||
}
|
||||
|
||||
export async function getContents(repo: string, path: string): Promise<c.ContentsResponse['data']> {
|
||||
export async function getContents(repo: string, path: string): Promise<c.ContentsResponseData> {
|
||||
const octokit = getOctokit()
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/contents/{path}', {
|
||||
@@ -39,11 +39,7 @@ export async function getContents(repo: string, path: string): Promise<c.Content
|
||||
).data
|
||||
}
|
||||
|
||||
export async function getTaggedRelease(
|
||||
owner: string,
|
||||
repo: string,
|
||||
tag: string
|
||||
): Promise<c.LatestReleaseResponse['data']> {
|
||||
export async function getTaggedRelease(owner: string, repo: string, tag: string): Promise<c.LatestReleaseResponseData> {
|
||||
const octokit = getOctokit()
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/releases/tags/{tag}', {
|
||||
@@ -51,14 +47,14 @@ export async function getTaggedRelease(
|
||||
repo,
|
||||
tag
|
||||
})
|
||||
).data
|
||||
).data as c.LatestReleaseResponseData /** missing digest property */
|
||||
}
|
||||
|
||||
export async function getMatchingTags(
|
||||
owner: string,
|
||||
repo: string,
|
||||
tagPrefix: string
|
||||
): Promise<c.MatchingRefsResponse['data']> {
|
||||
): Promise<c.MatchingRefsResponseData> {
|
||||
const octokit = getOctokit()
|
||||
return (
|
||||
await octokit.request('GET /repos/{owner}/{repo}/git/matching-refs/tags/{tagPrefix}', {
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"lib": ["ES2022"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"newLine": "lf",
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": false,
|
||||
"pretty": true,
|
||||
"resolveJsonModule": true,
|
||||
"sourceMap": false,
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "ES2022"
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"noEmit": true
|
||||
},
|
||||
"exclude": ["dist", "node_modules"],
|
||||
"include": [
|
||||
"__fixtures__",
|
||||
"__tests__",
|
||||
"src",
|
||||
"eslint.config.mjs",
|
||||
"jest.config.js",
|
||||
"rollup.cleanup.config.ts",
|
||||
"rollup.main.config.ts"
|
||||
]
|
||||
}
|
||||
@@ -1,11 +1,25 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"esModuleInterop": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
"lib": ["ES2022"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"outDir": "./dist"
|
||||
"newLine": "lf",
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": false,
|
||||
"outDir": "./dist",
|
||||
"pretty": true,
|
||||
"resolveJsonModule": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"target": "ES2022"
|
||||
},
|
||||
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
|
||||
"include": ["src"]
|
||||
|
||||
Reference in New Issue
Block a user