Skip to content

Commit cca461d

Browse files
authored
Merge pull request #168 from Glavo/master
Building for RISC-V 64 using GitHub Action
2 parents d3fdcad + 98bfe62 commit cca461d

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.github/build-native-debian.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/usr/bin/env bash
22

33
set -ex
44

@@ -17,8 +17,13 @@ wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg --
1717
echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list
1818

1919
apt-get update -y
20+
if [[ "$(uname -m)" == "riscv64" ]]; then
21+
# JDK 8 is not available on RISC-V 64
22+
apt-get install -y temurin-17-jdk
23+
else
24+
apt-get install -y temurin-8-jdk
25+
fi
2026

21-
apt-get install -y temurin-8-jdk
2227
apt-get install -y --no-install-recommends make gcc libc6-dev texinfo
2328
# Needs to be split, otherwise a newer version of OpenJDK is pulled
2429
apt-get install -y --no-install-recommends ant

.github/experimental-docker.json

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

.github/workflows/native-linux.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,28 @@ jobs:
1313
native:
1414

1515
# Switch back to ubuntu-latest after that maps to 20.04
16-
runs-on: ubuntu-20.04
16+
runs-on: ubuntu-24.04
1717

1818
strategy:
1919
matrix:
2020
arch:
21-
- "386"
21+
# https://github.com/adoptium/temurin-build/issues/986
22+
# - "386"
2223
- amd64
2324
- arm
2425
- arm64
2526
- linux-arm-v5
27+
- riscv64
2628
# this build does not work and ends up just rebuilding x86_64
2729
#- s390x
2830
fail-fast: false
2931

3032
name: Linux binary ${{ matrix.arch }}
3133

3234
steps:
33-
- uses: actions/checkout@v2
35+
- uses: actions/checkout@v4
3436
- name: cache dependencies
35-
uses: actions/cache@v1
37+
uses: actions/cache@v4
3638
with:
3739
path: ~/.m2
3840
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
@@ -43,21 +45,24 @@ jobs:
4345
run: sudo apt-get update -y
4446
- name: Install qemu
4547
run: sudo apt-get install -y --no-install-recommends qemu-user-static
46-
- name: Experimental Docker
47-
run: sudo cp .github/experimental-docker.json /etc/docker/daemon.json
48-
- name: Restart Docker
49-
run: sudo systemctl restart docker.service
48+
- name: Initialize environment variables
49+
run: |
50+
if [[ "${{ matrix.arch }}" == "riscv64" ]]; then
51+
echo "DOCKER_IMAGE_NAME=debian:trixie" >> $GITHUB_ENV
52+
else
53+
echo "DOCKER_IMAGE_NAME=debian:10" >> $GITHUB_ENV
54+
fi
5055
- name: Pull docker image
51-
run: docker pull --platform $(echo ${{ matrix.arch }} | sed 's|-|/|g') debian:10 || true
56+
run: docker pull --platform $(echo ${{ matrix.arch }} | sed 's|-|/|g') "$DOCKER_IMAGE_NAME" || true
5257
- name: Build inside Docker
53-
run: docker run --rm -v $GITHUB_WORKSPACE:/work debian:10 /work/.github/build-native-debian.sh
58+
run: docker run --rm -v $GITHUB_WORKSPACE:/work "$DOCKER_IMAGE_NAME" /work/.github/build-native-debian.sh
5459
- name: Archive built library
55-
uses: actions/upload-artifact@v2
60+
uses: actions/upload-artifact@v4
5661
with:
5762
name: shared-object-${{ matrix.arch }}
5863
path: build/jni/*.so
5964
- name: Archive built jar
60-
uses: actions/upload-artifact@v2
65+
uses: actions/upload-artifact@v4
6166
with:
6267
name: jar-${{ matrix.arch }}
6368
path: archive/*.jar

0 commit comments

Comments
 (0)