Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53e44097d9 | ||
|
|
13a63544a5 | ||
|
|
790e28947b | ||
|
|
434a92bc4f | ||
|
|
fe4a6b3a89 | ||
|
|
d8578a7f98 | ||
|
|
98e485c1fb | ||
|
|
dec5790292 | ||
|
|
181df6a97e | ||
|
|
00d42bd278 | ||
|
|
339a71db2d | ||
|
|
ad3c25e809 | ||
|
|
cfa19cdd20 | ||
|
|
dc8a7ea391 | ||
|
|
8623f5e13e | ||
|
|
23e0acf4b9 |
6
.github/workflows/check-dist.yml
vendored
6
.github/workflows/check-dist.yml
vendored
@@ -32,11 +32,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
id: checkout
|
id: checkout
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
id: setup-node
|
id: setup-node
|
||||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -70,7 +70,7 @@ jobs:
|
|||||||
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
|
- if: ${{ failure() && steps.diff.outcome == 'failure' }}
|
||||||
name: Upload Artifact
|
name: Upload Artifact
|
||||||
id: upload
|
id: upload
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||||
with:
|
with:
|
||||||
name: dist
|
name: dist
|
||||||
path: dist/
|
path: dist/
|
||||||
|
|||||||
33
.github/workflows/ci.yml
vendored
33
.github/workflows/ci.yml
vendored
@@ -18,9 +18,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
|
||||||
with:
|
with:
|
||||||
node-version-file: .node-version
|
node-version-file: .node-version
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -49,16 +49,19 @@ jobs:
|
|||||||
ubuntu-latest, # Linux on Intel
|
ubuntu-latest, # Linux on Intel
|
||||||
ubuntu-22.04-arm, # Linux on arm64
|
ubuntu-22.04-arm, # Linux on arm64
|
||||||
macos-latest, # macOS on Apple silicon
|
macos-latest, # macOS on Apple silicon
|
||||||
macos-13, # macOS on Intel
|
macos-15-intel, # macOS on Intel
|
||||||
windows-latest
|
windows-latest
|
||||||
]
|
]
|
||||||
set-gds-token: [false]
|
set-gds-token: [false]
|
||||||
components: ['']
|
components: ['']
|
||||||
|
exclude:
|
||||||
|
- os: macos-15-intel
|
||||||
|
java-version: 'dev'
|
||||||
include:
|
include:
|
||||||
- java-version: 'latest-ea'
|
- java-version: 'latest-ea'
|
||||||
distribution: 'graalvm'
|
distribution: 'graalvm'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- java-version: '25-ea'
|
- java-version: '25e1-ea'
|
||||||
distribution: 'graalvm'
|
distribution: 'graalvm'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- java-version: '21'
|
- java-version: '21'
|
||||||
@@ -83,7 +86,7 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
set-gds-token: true
|
set-gds-token: true
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -141,7 +144,7 @@ jobs:
|
|||||||
- version: '22.3.1'
|
- version: '22.3.1'
|
||||||
java-version: '11' # for JDK 11 notification
|
java-version: '11' # for JDK 11 notification
|
||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
os: macos-13
|
os: macos-15-intel
|
||||||
- version: '22.3.1'
|
- version: '22.3.1'
|
||||||
java-version: '17'
|
java-version: '17'
|
||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
@@ -151,7 +154,7 @@ jobs:
|
|||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -208,7 +211,7 @@ jobs:
|
|||||||
components: 'native-image'
|
components: 'native-image'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -257,7 +260,7 @@ jobs:
|
|||||||
distribution: 'mandrel'
|
distribution: 'mandrel'
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -292,7 +295,7 @@ jobs:
|
|||||||
java-package: ['', 'jdk', 'jdk+fx']
|
java-package: ['', 'jdk', 'jdk+fx']
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -332,7 +335,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: write # for `native-image-pr-reports` option
|
pull-requests: write # for `native-image-pr-reports` option
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -355,7 +358,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: write # for `native-image-pr-reports` option
|
pull-requests: write # for `native-image-pr-reports` option
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -382,7 +385,7 @@ jobs:
|
|||||||
java-version: ['21', '25']
|
java-version: ['21', '25']
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -406,7 +409,7 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
pull-requests: write # for `native-image-pr-reports` option
|
pull-requests: write # for `native-image-pr-reports` option
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
@@ -467,7 +470,7 @@ jobs:
|
|||||||
os: [macos-latest, windows-latest, ubuntu-latest, ubuntu-22.04-arm]
|
os: [macos-latest, windows-latest, ubuntu-latest, ubuntu-22.04-arm]
|
||||||
components: ['']
|
components: ['']
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||||
- name: Run setup-graalvm action
|
- name: Run setup-graalvm action
|
||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: graalvm/setup-graalvm@v1
|
- uses: graalvm/setup-graalvm@v1
|
||||||
with:
|
with:
|
||||||
java-version: '26-ea' # or 'latest-ea' for the latest Java version available
|
java-version: '25e1-ea' # or 'latest-ea' for the latest Java version available
|
||||||
distribution: 'graalvm'
|
distribution: 'graalvm'
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
@@ -194,7 +194,7 @@ This actions can be configured with the following options:
|
|||||||
|
|
||||||
| Name | Default | Description |
|
| Name | Default | Description |
|
||||||
|-----------------|:--------:|-------------|
|
|-----------------|:--------:|-------------|
|
||||||
| `java-version`<br>*(required)* | n/a | Java version <ul><li>major versions: `'25'`, `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.3'`, `'17.0.11'`</li><li>early access (EA) builds: `'26-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'`</li></ul> |
|
| `java-version`<br>*(required)* | n/a | Java version <ul><li>major versions: `'25'`, `'21'`, `'17'`, `'11'`, `'8'`</li><li>specific versions: `'21.0.3'`, `'17.0.11'`</li><li>early access (EA) builds: `'25e1-ea'` *(requires `distribution: 'graalvm'`)*</li><li>latest EA build: `'latest-ea'` *(requires `distribution: 'graalvm'`)*</li><li>dev builds: `'dev'` *(requires `distribution: 'graalvm-community'`)*</li></ul> |
|
||||||
| `distribution` | `'graalvm'` | GraalVM distribution (see [supported distributions](#supported-distributions)) |
|
| `distribution` | `'graalvm'` | GraalVM distribution (see [supported distributions](#supported-distributions)) |
|
||||||
| `java-package` | `'jdk'` | The package type (`'jdk'` or `'jdk+fx'`). Currently applies to Liberica only. |
|
| `java-package` | `'jdk'` | The package type (`'jdk'` or `'jdk+fx'`). Currently applies to Liberica only. |
|
||||||
| `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. |
|
| `github-token` | `'${{ github.token }}'` | Token for communication with the GitHub API. Please set this to `${{ secrets.GITHUB_TOKEN }}` (see [templates](#templates)) to allow the action to authenticate with the GitHub API, which helps reduce rate-limiting issues. |
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ test('find version/javaVersion', async () => {
|
|||||||
}
|
}
|
||||||
error = err
|
error = err
|
||||||
}
|
}
|
||||||
expect(error.message).toContain('Could not find highest Java version.')
|
expect(error.message).toContain('Could not find latest GraalVM release:')
|
||||||
})
|
})
|
||||||
|
|
||||||
test('find EA version/javaVersion', async () => {
|
test('find EA version/javaVersion', async () => {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ describe('sbom feature', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should not throw an error when the java-version is supported', () => {
|
it('should not throw an error when the java-version is supported', () => {
|
||||||
const supported_versions = ['25', '26-ea', 'latest-ea']
|
const supported_versions = ['25', '25e1-ea', 'latest-ea']
|
||||||
for (const version of supported_versions) {
|
for (const version of supported_versions) {
|
||||||
expect(() => setUpSBOMSupport(version, distribution)).not.toThrow()
|
expect(() => setUpSBOMSupport(version, distribution)).not.toThrow()
|
||||||
}
|
}
|
||||||
|
|||||||
4566
dist/cleanup.js
generated
vendored
4566
dist/cleanup.js
generated
vendored
File diff suppressed because it is too large
Load Diff
5928
dist/main.js
generated
vendored
5928
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 jest from 'eslint-plugin-jest'
|
||||||
import prettier from 'eslint-plugin-prettier'
|
import prettier from 'eslint-plugin-prettier'
|
||||||
import globals from 'globals'
|
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({
|
const compat = new FlatCompat({
|
||||||
baseDirectory: __dirname,
|
baseDirectory: import.meta.dirname,
|
||||||
recommendedConfig: js.configs.recommended,
|
recommendedConfig: js.configs.recommended,
|
||||||
allConfig: js.configs.all
|
allConfig: js.configs.all
|
||||||
})
|
})
|
||||||
@@ -52,8 +48,18 @@ export default [
|
|||||||
sourceType: 'module',
|
sourceType: 'module',
|
||||||
|
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
project: ['tsconfig.eslint.json'],
|
projectService: {
|
||||||
tsconfigRootDir: __dirname
|
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': {
|
'import/resolver': {
|
||||||
typescript: {
|
typescript: {
|
||||||
alwaysTryTypes: true,
|
alwaysTryTypes: true,
|
||||||
project: 'tsconfig.eslint.json'
|
project: 'tsconfig.json'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export default {
|
|||||||
'^.+\\.ts$': [
|
'^.+\\.ts$': [
|
||||||
'ts-jest',
|
'ts-jest',
|
||||||
{
|
{
|
||||||
tsconfig: 'tsconfig.eslint.json',
|
tsconfig: 'tsconfig.json',
|
||||||
useESM: true
|
useESM: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
648
package-lock.json
generated
648
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
36
package.json
36
package.json
@@ -2,7 +2,7 @@
|
|||||||
"name": "setup-graalvm",
|
"name": "setup-graalvm",
|
||||||
"author": "GraalVM Community",
|
"author": "GraalVM Community",
|
||||||
"description": "GitHub Action for GraalVM",
|
"description": "GitHub Action for GraalVM",
|
||||||
"version": "1.4.2",
|
"version": "1.4.4",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -42,39 +42,39 @@
|
|||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^6.0.1",
|
"@actions/github": "^6.0.1",
|
||||||
"@actions/glob": "^0.5.0",
|
"@actions/glob": "^0.5.0",
|
||||||
"@actions/http-client": "^2.2.3",
|
"@actions/http-client": "^3.0.0",
|
||||||
"@actions/io": "^1.1.3",
|
"@actions/io": "^2.0.0",
|
||||||
"@actions/tool-cache": "^2.0.2",
|
"@actions/tool-cache": "^2.0.2",
|
||||||
"@octokit/types": "^15.0.0",
|
"@octokit/types": "^16.0.0",
|
||||||
"@github/dependency-submission-toolkit": "^2.0.5",
|
"@github/dependency-submission-toolkit": "^2.0.5",
|
||||||
"semver": "^7.7.2",
|
"semver": "^7.7.3",
|
||||||
"uuid": "^13.0.0"
|
"uuid": "^13.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/compat": "^1.4.0",
|
"@eslint/compat": "^2.0.0",
|
||||||
"@rollup/plugin-commonjs": "^28.0.6",
|
"@rollup/plugin-commonjs": "^29.0.0",
|
||||||
"@rollup/plugin-json": "^6.1.0",
|
"@rollup/plugin-json": "^6.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^16.0.1",
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
||||||
"@rollup/plugin-typescript": "^12.1.4",
|
"@rollup/plugin-typescript": "^12.3.0",
|
||||||
"@types/jest": "^30.0.0",
|
"@types/jest": "^30.0.0",
|
||||||
"@types/node": "^24.6.1",
|
"@types/node": "^24.10.1",
|
||||||
"@types/semver": "^7.7.1",
|
"@types/semver": "^7.7.1",
|
||||||
"@typescript-eslint/eslint-plugin": "^8.45.0",
|
"@typescript-eslint/eslint-plugin": "^8.48.0",
|
||||||
"@typescript-eslint/parser": "^8.31.1",
|
"@typescript-eslint/parser": "^8.31.1",
|
||||||
"eslint": "^9.36.0",
|
"eslint": "^9.39.1",
|
||||||
"eslint-config-prettier": "^10.1.8",
|
"eslint-config-prettier": "^10.1.8",
|
||||||
"eslint-import-resolver-typescript": "^4.4.4",
|
"eslint-import-resolver-typescript": "^4.4.4",
|
||||||
"eslint-plugin-import": "^2.32.0",
|
"eslint-plugin-import": "^2.32.0",
|
||||||
"eslint-plugin-jest": "^29.0.1",
|
"eslint-plugin-jest": "^29.2.1",
|
||||||
"eslint-plugin-jsonc": "^2.20.1",
|
"eslint-plugin-jsonc": "^2.21.0",
|
||||||
"eslint-plugin-node": "^11.1.0",
|
"eslint-plugin-node": "^11.1.0",
|
||||||
"eslint-plugin-prettier": "^5.5.4",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"jest": "^30.2.0",
|
"jest": "^30.2.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.1",
|
||||||
"prettier": "^3.6.2",
|
"prettier": "^3.7.3",
|
||||||
"prettier-eslint": "^16.4.2",
|
"prettier-eslint": "^16.4.2",
|
||||||
"rollup": "^4.52.3",
|
"rollup": "^4.53.3",
|
||||||
"ts-jest": "^29.4.4",
|
"ts-jest": "^29.4.6",
|
||||||
"ts-jest-resolver": "^2.0.1",
|
"ts-jest-resolver": "^2.0.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as otypes from '@octokit/types'
|
import * as otypes from '@octokit/types'
|
||||||
|
|
||||||
export const ACTION_VERSION = '1.4.2'
|
export const ACTION_VERSION = '1.4.4'
|
||||||
|
|
||||||
export const INPUT_VERSION = 'version'
|
export const INPUT_VERSION = 'version'
|
||||||
export const INPUT_GDS_TOKEN = 'gds-token'
|
export const INPUT_GDS_TOKEN = 'gds-token'
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as c from '../constants.js'
|
|||||||
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 { join } from 'path'
|
import { join } from 'path'
|
||||||
|
import { downloadFile } from '../utils.js'
|
||||||
|
|
||||||
const MUSL_NAME = 'musl-toolchain'
|
const MUSL_NAME = 'musl-toolchain'
|
||||||
const MUSL_VERSION = '1.2.5-oracle-00001'
|
const MUSL_VERSION = '1.2.5-oracle-00001'
|
||||||
@@ -16,7 +17,7 @@ export async function setUpNativeImageMusl(): Promise<void> {
|
|||||||
core.info(`Found ${MUSL_NAME} ${MUSL_VERSION} in tool-cache @ ${toolPath}`)
|
core.info(`Found ${MUSL_NAME} ${MUSL_VERSION} in tool-cache @ ${toolPath}`)
|
||||||
} else {
|
} else {
|
||||||
core.startGroup(`Setting up musl for GraalVM Native Image...`)
|
core.startGroup(`Setting up musl for GraalVM Native Image...`)
|
||||||
const muslDownloadPath = await tc.downloadTool(
|
const muslDownloadPath = await downloadFile(
|
||||||
`https://gds.oracle.com/download/bfs/archive/musl-toolchain-${MUSL_VERSION}-linux-amd64.tar.gz`
|
`https://gds.oracle.com/download/bfs/archive/musl-toolchain-${MUSL_VERSION}-linux-amd64.tar.gz`
|
||||||
)
|
)
|
||||||
const muslExtractPath = await tc.extractTar(muslDownloadPath)
|
const muslExtractPath = await tc.extractTar(muslDownloadPath)
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import * as c from './constants.js'
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import * as semver from 'semver'
|
import * as semver from 'semver'
|
||||||
import {
|
import {
|
||||||
|
downloadFile,
|
||||||
downloadAndExtractJDK,
|
downloadAndExtractJDK,
|
||||||
downloadExtractAndCacheJDK,
|
downloadExtractAndCacheJDK,
|
||||||
getContents,
|
getContents,
|
||||||
@@ -10,7 +11,6 @@ import {
|
|||||||
getTaggedRelease
|
getTaggedRelease
|
||||||
} from './utils.js'
|
} from './utils.js'
|
||||||
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds.js'
|
import { downloadGraalVM, downloadGraalVMEELegacy } from './gds.js'
|
||||||
import { downloadTool } from '@actions/tool-cache'
|
|
||||||
import { basename } from 'path'
|
import { basename } from 'path'
|
||||||
|
|
||||||
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm'
|
const GRAALVM_DL_BASE = 'https://download.oracle.com/graalvm'
|
||||||
@@ -153,7 +153,7 @@ function determineToolName(javaVersion: string, isCommunity: boolean) {
|
|||||||
|
|
||||||
async function downloadGraalVMJDK(downloadUrl: string, javaVersion: string): Promise<string> {
|
async function downloadGraalVMJDK(downloadUrl: string, javaVersion: string): Promise<string> {
|
||||||
try {
|
try {
|
||||||
return await downloadTool(downloadUrl)
|
return await downloadFile(downloadUrl)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof Error && error.message.includes('404')) {
|
if (error instanceof Error && error.message.includes('404')) {
|
||||||
// Not Found
|
// Not Found
|
||||||
@@ -174,7 +174,7 @@ export async function setUpGraalVMJDKDevBuild(): Promise<string> {
|
|||||||
return downloadAndExtractJDK(downloadUrl)
|
return downloadAndExtractJDK(downloadUrl)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function findHighestJavaVersion(release: c.LatestReleaseResponseData, version: string): string {
|
export function findHighestJavaVersion(release: c.LatestReleaseResponseData, version: string): string | undefined {
|
||||||
const graalVMIdentifierPattern = determineGraalVMLegacyIdentifier(false, version, '(\\d+)')
|
const graalVMIdentifierPattern = determineGraalVMLegacyIdentifier(false, version, '(\\d+)')
|
||||||
const expectedFileNameRegExp = new RegExp(
|
const expectedFileNameRegExp = new RegExp(
|
||||||
`^${graalVMIdentifierPattern}${c.GRAALVM_FILE_EXTENSION.replace(/\./g, '\\.')}$`
|
`^${graalVMIdentifierPattern}${c.GRAALVM_FILE_EXTENSION.replace(/\./g, '\\.')}$`
|
||||||
@@ -192,9 +192,7 @@ export function findHighestJavaVersion(release: c.LatestReleaseResponseData, ver
|
|||||||
if (highestJavaVersion > 0) {
|
if (highestJavaVersion > 0) {
|
||||||
return String(highestJavaVersion)
|
return String(highestJavaVersion)
|
||||||
} else {
|
} else {
|
||||||
throw new Error(
|
return undefined
|
||||||
'Could not find highest Java version. Please file an issue at: https://github.com/graalvm/setup-graalvm/issues.'
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -234,8 +232,10 @@ export async function setUpGraalVMRelease(gdsToken: string, version: string, jav
|
|||||||
return downloadExtractAndCacheJDK(downloader, toolName, version)
|
return downloadExtractAndCacheJDK(downloader, toolName, version)
|
||||||
}
|
}
|
||||||
|
|
||||||
function findDownloadUrl(release: c.LatestReleaseResponseData, javaVersion: string): string {
|
function findDownloadUrl(release: c.LatestReleaseResponseData, javaVersion?: string): string {
|
||||||
const graalVMIdentifier = determineGraalVMLegacyIdentifier(false, c.VERSION_DEV, javaVersion)
|
const graalVMIdentifier = javaVersion
|
||||||
|
? determineGraalVMLegacyIdentifier(false, c.VERSION_DEV, javaVersion)
|
||||||
|
: determineGraalVMIdentifier(false, c.VERSION_DEV)
|
||||||
const expectedFileName = `${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`
|
const expectedFileName = `${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`
|
||||||
for (const asset of release.assets) {
|
for (const asset of release.assets) {
|
||||||
if (asset.name === expectedFileName) {
|
if (asset.name === expectedFileName) {
|
||||||
@@ -247,6 +247,11 @@ function findDownloadUrl(release: c.LatestReleaseResponseData, javaVersion: stri
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function determineGraalVMIdentifier(isEE: boolean, version: string): string {
|
||||||
|
const infix = isEE ? 'ee' : version === c.VERSION_DEV ? 'community' : 'ce'
|
||||||
|
return `graalvm-${infix}-${version}-${c.GRAALVM_PLATFORM}-${c.GRAALVM_ARCH}`
|
||||||
|
}
|
||||||
|
|
||||||
function determineGraalVMLegacyIdentifier(isEE: boolean, version: string, javaVersion: string): string {
|
function determineGraalVMLegacyIdentifier(isEE: boolean, version: string, javaVersion: string): string {
|
||||||
return `${determineLegacyToolName(isEE, version, javaVersion)}-${c.GRAALVM_ARCH}-${version}`
|
return `${determineLegacyToolName(isEE, version, javaVersion)}-${c.GRAALVM_ARCH}-${version}`
|
||||||
}
|
}
|
||||||
@@ -260,7 +265,7 @@ async function downloadGraalVMCELegacy(version: string, javaVersion: string): Pr
|
|||||||
const graalVMIdentifier = determineGraalVMLegacyIdentifier(false, version, javaVersion)
|
const graalVMIdentifier = determineGraalVMLegacyIdentifier(false, version, javaVersion)
|
||||||
const downloadUrl = `${GRAALVM_CE_DL_BASE}/${GRAALVM_TAG_PREFIX}${version}/${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`
|
const downloadUrl = `${GRAALVM_CE_DL_BASE}/${GRAALVM_TAG_PREFIX}${version}/${graalVMIdentifier}${c.GRAALVM_FILE_EXTENSION}`
|
||||||
try {
|
try {
|
||||||
return await downloadTool(downloadUrl)
|
return await downloadFile(downloadUrl)
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error instanceof Error && error.message.includes('404')) {
|
if (error instanceof Error && error.message.includes('404')) {
|
||||||
// Not Found
|
// Not Found
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import * as c from './constants.js'
|
import * as c from './constants.js'
|
||||||
import * as semver from 'semver'
|
import * as semver from 'semver'
|
||||||
import { downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils.js'
|
import { downloadFile, downloadExtractAndCacheJDK, getTaggedRelease, getMatchingTags } from './utils.js'
|
||||||
import { downloadTool } from '@actions/tool-cache'
|
|
||||||
import { spawnSync } from 'child_process'
|
import { spawnSync } from 'child_process'
|
||||||
|
|
||||||
const LIBERICA_GH_USER = 'bell-sw'
|
const LIBERICA_GH_USER = 'bell-sw'
|
||||||
@@ -13,7 +12,7 @@ export async function setUpLiberica(javaVersion: string, javaPackage: string): P
|
|||||||
const resolvedJavaVersion = await findLatestLibericaJavaVersion(javaVersion)
|
const resolvedJavaVersion = await findLatestLibericaJavaVersion(javaVersion)
|
||||||
const downloadUrl = await findLibericaURL(resolvedJavaVersion, javaPackage)
|
const downloadUrl = await findLibericaURL(resolvedJavaVersion, javaPackage)
|
||||||
const toolName = determineToolName(javaVersion, javaPackage)
|
const toolName = determineToolName(javaVersion, javaPackage)
|
||||||
return downloadExtractAndCacheJDK(async () => downloadTool(downloadUrl), toolName, javaVersion)
|
return downloadExtractAndCacheJDK(async () => downloadFile(downloadUrl), toolName, javaVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function findLatestLibericaJavaVersion(javaVersion: string): Promise<string> {
|
export async function findLatestLibericaJavaVersion(javaVersion: string): Promise<string> {
|
||||||
|
|||||||
19
src/utils.ts
19
src/utils.ts
@@ -5,9 +5,10 @@ import * as semver from 'semver'
|
|||||||
import * as tc from '@actions/tool-cache'
|
import * as tc from '@actions/tool-cache'
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import { ExecOptions, exec as e } from '@actions/exec'
|
import { ExecOptions, exec as e } from '@actions/exec'
|
||||||
|
import { ok } from 'assert'
|
||||||
import { readFileSync, readdirSync } from 'fs'
|
import { readFileSync, readdirSync } from 'fs'
|
||||||
import { createHash } from 'crypto'
|
import { createHash } from 'crypto'
|
||||||
import { join } from 'path'
|
import { extname, join } from 'path'
|
||||||
import { tmpdir } from 'os'
|
import { tmpdir } from 'os'
|
||||||
import { GitHub } from '@actions/github/lib/utils.js'
|
import { GitHub } from '@actions/github/lib/utils.js'
|
||||||
|
|
||||||
@@ -86,6 +87,22 @@ export async function downloadExtractAndCacheJDK(
|
|||||||
return findJavaHomeInSubfolder(toolPath)
|
return findJavaHomeInSubfolder(toolPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This copy of tc.downloadTool() preserves the file extension in the dest.
|
||||||
|
* The file extension is required on Windows runners without .NET to extract zip files correctly.
|
||||||
|
* See #195 and https://github.com/actions/toolkit/blob/6b63a2bfc339a753a113d2266323a4d52d84dee0/packages/tool-cache/src/tool-cache.ts#L44
|
||||||
|
*/
|
||||||
|
export async function downloadFile(downloadUrl: string): Promise<string> {
|
||||||
|
const dest = join(_getTempDirectory(), crypto.randomUUID(), extname(downloadUrl))
|
||||||
|
return tc.downloadTool(downloadUrl, dest)
|
||||||
|
}
|
||||||
|
|
||||||
|
function _getTempDirectory(): string {
|
||||||
|
const tempDirectory = process.env['RUNNER_TEMP'] || ''
|
||||||
|
ok(tempDirectory, 'Expected RUNNER_TEMP to be defined')
|
||||||
|
return tempDirectory
|
||||||
|
}
|
||||||
|
|
||||||
export function calculateSHA256(filePath: string): string {
|
export function calculateSHA256(filePath: string): string {
|
||||||
const hashSum = createHash('sha256')
|
const hashSum = createHash('sha256')
|
||||||
hashSum.update(readFileSync(filePath))
|
hashSum.update(readFileSync(filePath))
|
||||||
|
|||||||
@@ -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",
|
"$schema": "https://json.schemastore.org/tsconfig",
|
||||||
"extends": "./tsconfig.base.json",
|
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"declaration": false,
|
||||||
|
"declarationMap": false,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
|
"lib": ["ES2022"],
|
||||||
"module": "NodeNext",
|
"module": "NodeNext",
|
||||||
"moduleResolution": "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"],
|
"exclude": ["__fixtures__", "__tests__", "coverage", "dist", "node_modules"],
|
||||||
"include": ["src"]
|
"include": ["src"]
|
||||||
|
|||||||
Reference in New Issue
Block a user