Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get latest mandrel when version not specified #69

Merged
merged 2 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ jobs:
java-version: '17'
distribution: '' # test empty distribution for backward compatibility
os: ubuntu-latest
- version: '' # test with no version
java-version: '21'
distribution: 'mandrel'
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run setup-graalvm action
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ jobs:
| `native-image-job-reports` *) | `'false'` | If set to `'true'`, post a job summary containing a Native Image build report. |
| `native-image-pr-reports` *) | `'false'` | If set to `'true'`, post a comment containing a Native Image build report on pull requests. Requires `write` permissions for the [`pull-requests` scope][gha-permissions]. |
| `components` | `''` | Comma-separated list of GraalVM components (e.g., `native-image` or `ruby,nodejs`) that will be installed by the [GraalVM Updater][gu]. |
| `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z` (e.g., `mandrel-21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` for [latest Mandrel stable release][mandrel-stable]. |
| `version` | `''` | `X.Y.Z` (e.g., `22.3.0`) for a specific [GraalVM release][releases] up to `22.3.2`<br>`mandrel-X.Y.Z.W` or `X.Y.Z.W-Final` (e.g., `mandrel-21.3.0.0-Final` or `21.3.0.0-Final`) for a specific [Mandrel release][mandrel-releases],<br>`mandrel-latest` or `latest` for the latest Mandrel stable release. |
| `gds-token` | `''` | Download token for the GraalVM Download Service. If a non-empty token is provided, the action will set up GraalVM Enterprise Edition (see [GraalVM EE template](#template-for-graalvm-enterprise-edition)). |

**) Make sure that Native Image is used only once per build job. Otherwise, the report is only generated for the last Native Image build.*
Expand Down
1 change: 0 additions & 1 deletion __tests__/mandrel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,3 @@ test('get latest Mandrel for specific JDK', async () => {
expect(latest).toContain(`mandrel-java${javaVersion}`)
}
})

4 changes: 3 additions & 1 deletion dist/main/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/mandrel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export async function setUpMandrel(
const version = stripMandrelNamespace(mandrelVersion)
let mandrelHome
switch (version) {
case '':
// fetch latest if no version is specified
case 'latest':
mandrelHome = await setUpMandrelLatest(javaVersion)
break
Expand Down Expand Up @@ -59,7 +61,7 @@ export async function getLatestMandrelReleaseUrl(
javaVersion: string
): Promise<string> {
const url = `${DISCO_API_BASE}?jdk_version=${javaVersion}&distribution=${c.DISTRIBUTION_MANDREL}&architecture=${c.JDK_ARCH}&operating_system=${c.JDK_PLATFORM}&latest=per_distro`
const _http = new httpClient.HttpClient('http-client-tests')
const _http = new httpClient.HttpClient()
const response = await _http.getJson<JdkData>(url)
if (response.statusCode !== 200) {
throw new Error(
Expand Down
Loading