Skip to content

Commit b3094fb

Browse files
committed
Refactor Build Build a Statically Linked or Mostly-Statically Linked Images demo
1 parent df7760f commit b3094fb

File tree

7 files changed

+50
-171
lines changed

7 files changed

+50
-171
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: native-image/build-static-images
2+
on:
3+
push:
4+
paths:
5+
- 'native-image/build-static-images/**'
6+
- '.github/workflows/native-image-build-static-images.yml'
7+
pull_request:
8+
paths:
9+
- 'native-image/build-static-images/**'
10+
- '.github/workflows/native-image-build-static-images.yml'
11+
schedule:
12+
- cron: "0 0 1 * *" # run every month
13+
workflow_dispatch:
14+
permissions:
15+
contents: read
16+
jobs:
17+
run-static:
18+
name: Run static 'native-image/build-static-images'
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 15
21+
strategy:
22+
matrix:
23+
java-version: ['21', '24-ea']
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: graalvm/setup-graalvm@v1
27+
with:
28+
java-version: ${{ matrix.java-version }}
29+
native-image-musl: 'true'
30+
github-token: ${{ secrets.GITHUB_TOKEN }}
31+
native-image-job-reports: 'true'
32+
- name: Run static images build
33+
run: |
34+
cd native-image/build-static-images
35+
./run.sh

.github/workflows/native-static-images.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
*.txt
22
*.class
3-
envmap
3+
envmap

native-static-images/EnvMap.java renamed to native-image/build-static-images/EnvMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2023, 2024 Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Building Statically Linked or Mostly-Statically Linked Native Executables
2+
3+
You can find the steps to run this demo on [the website](https://www.graalvm.org/latest/reference-manual/native-image/guides/build-static-executables/).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
set -ex
3+
4+
javac EnvMap.java
5+
# Run fully static image build
6+
native-image --static --libc=musl EnvMap
7+
ldd EnvMap
8+
# Run mostly-static image build
9+
javac EnvMap.java
10+
native-image --static-nolibc EnvMap

native-static-images/README.md

Lines changed: 0 additions & 112 deletions
This file was deleted.

0 commit comments

Comments
 (0)