Skip to content
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
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion dist/cleanup.js

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

22 changes: 4 additions & 18 deletions dist/main.js

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

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "setup-graalvm",
"author": "GraalVM Community",
"description": "GitHub Action for GraalVM",
"version": "1.4.1",
"version": "1.4.2",
"type": "module",
"private": true,
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as otypes from '@octokit/types'

export const ACTION_VERSION = '1.4.1'
export const ACTION_VERSION = '1.4.2'

export const INPUT_VERSION = 'version'
export const INPUT_GDS_TOKEN = 'gds-token'
Expand Down
23 changes: 3 additions & 20 deletions src/features/musl.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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()
Expand Down
Loading