Skip to content

Commit 6670056

Browse files
Add musl build action
1 parent 9ef71de commit 6670056

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,34 @@ jobs:
4141
- name: Run Gradle Build
4242
run: ./gradlew build -Ptarget=${{ matrix.target }}
4343

44+
linux-musl:
45+
strategy:
46+
matrix:
47+
include:
48+
- target: x86_64-unknown-linux-musl
49+
arch: x86_64
50+
- target: aarch64-unknown-linux-musl
51+
arch: aarch64
52+
53+
name: Build ${{ matrix.target }}
54+
runs-on: ubuntu-latest
55+
container:
56+
image: ghcr.io/blackdex/rust-musl:${{ matrix.arch }}-musl-stable
57+
steps:
58+
- name: Checkout sources
59+
uses: taiki-e/checkout-action@v1
60+
- name: Install Essentials
61+
run: |
62+
apt-get update -y
63+
apt-get install -y openjdk17
64+
- name: Install Rust toolchain
65+
uses: dtolnay/rust-toolchain@stable
66+
with:
67+
toolchain: stable
68+
target: x86_64-unknown-linux-musl ${{ matrix.target }} # requires native target installed to build proc-macros2
69+
- name: Run Gradle Build
70+
run: ./gradlew build -Ptarget=${{ matrix.target }}
71+
4472
windows:
4573
strategy:
4674
matrix:

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,38 @@ jobs:
5050
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5151
run: ./gradlew native:publish native:jreleaserRelease -Ptarget=${{ matrix.target }}
5252

53+
linux-musl:
54+
strategy:
55+
matrix:
56+
include:
57+
- target: x86_64-unknown-linux-musl
58+
deps: |
59+
apk add musl openjdk17
60+
- target: aarch64-unknown-linux-musl
61+
deps: |
62+
apk add musl openjdk17 aarch64-linux-musl-gcc aarch64-linux-musl-binutils
63+
64+
name: Publish ${{ matrix.target }}
65+
environment: MavenRelease
66+
runs-on: ubuntu-latest
67+
container:
68+
image: alpine:3.20
69+
steps:
70+
- name: Checkout sources
71+
uses: taiki-e/checkout-action@v1
72+
- name: Install Essentials
73+
run: apk add build-base curl
74+
- name: Install Rust toolchain
75+
uses: dtolnay/rust-toolchain@stable
76+
with:
77+
toolchain: stable
78+
target: x86_64-unknown-linux-musl ${{ matrix.target }} # requires native target installed to build proc-macros2
79+
- name: Install linker dependencies
80+
run: ${{ matrix.deps }}
81+
if: ${{ matrix.deps != '' }}
82+
- name: Run Gradle Build
83+
run: ./gradlew native:publish native:jreleaserRelease -Ptarget=${{ matrix.target }}
84+
5385
windows:
5486
strategy:
5587
matrix:
@@ -85,6 +117,7 @@ jobs:
85117

86118
macos:
87119
name: Build macOS universal binary
120+
environment: MavenRelease
88121
runs-on: macos-14
89122
steps:
90123
- name: Checkout sources

0 commit comments

Comments
 (0)