From 11ccd12b526d0b0df490456b7d235850ec43b0e1 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 19 Apr 2025 15:01:12 +0800 Subject: [PATCH 1/2] Fix github action --- .github/build-native-debian.sh | 9 +++++++-- .github/experimental-docker.json | 4 ---- .github/workflows/native-linux.yml | 30 ++++++++++++++++++------------ 3 files changed, 25 insertions(+), 18 deletions(-) delete mode 100644 .github/experimental-docker.json diff --git a/.github/build-native-debian.sh b/.github/build-native-debian.sh index 0f72ab1c..a23c2281 100755 --- a/.github/build-native-debian.sh +++ b/.github/build-native-debian.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env bash set -ex @@ -17,8 +17,13 @@ wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg -- 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 apt-get update -y +if [[ "$CROSS_ARCH" == "riscv64" ]]; then + # JDK 8 is not available on RISC-V 64 + apt-get install -y temurin-17-jdk +else + apt-get install -y temurin-8-jdk +fi -apt-get install -y temurin-8-jdk apt-get install -y --no-install-recommends make gcc libc6-dev texinfo # Needs to be split, otherwise a newer version of OpenJDK is pulled apt-get install -y --no-install-recommends ant diff --git a/.github/experimental-docker.json b/.github/experimental-docker.json deleted file mode 100644 index a5a039d8..00000000 --- a/.github/experimental-docker.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "cgroup-parent": "/actions_job", - "experimental": true -} diff --git a/.github/workflows/native-linux.yml b/.github/workflows/native-linux.yml index 0104d889..50a9fe76 100644 --- a/.github/workflows/native-linux.yml +++ b/.github/workflows/native-linux.yml @@ -13,16 +13,18 @@ jobs: native: # Switch back to ubuntu-latest after that maps to 20.04 - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 strategy: matrix: arch: - - "386" + # https://github.com/adoptium/temurin-build/issues/986 + # - "386" - amd64 - arm - arm64 - linux-arm-v5 + - riscv64 # this build does not work and ends up just rebuilding x86_64 #- s390x fail-fast: false @@ -30,9 +32,9 @@ jobs: name: Linux binary ${{ matrix.arch }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v4 with: path: ~/.m2 key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} @@ -43,21 +45,25 @@ jobs: run: sudo apt-get update -y - name: Install qemu run: sudo apt-get install -y --no-install-recommends qemu-user-static - - name: Experimental Docker - run: sudo cp .github/experimental-docker.json /etc/docker/daemon.json - - name: Restart Docker - run: sudo systemctl restart docker.service + - name: Initialize environment variables + run: | + echo "CROSS_ARCH=${{ matrix.arch }}" >> $GITHUB_ENV + if [[ "${{ matrix.arch }}" == "riscv64" ]]; then + echo "DOCKER_IMAGE_NAME=debian:trixie" >> $GITHUB_ENV + else + echo "DOCKER_IMAGE_NAME=debian:10" >> $GITHUB_ENV + fi - name: Pull docker image - run: docker pull --platform $(echo ${{ matrix.arch }} | sed 's|-|/|g') debian:10 || true + run: docker pull --platform $(echo ${{ matrix.arch }} | sed 's|-|/|g') "$DOCKER_IMAGE_NAME" || true - name: Build inside Docker - run: docker run --rm -v $GITHUB_WORKSPACE:/work debian:10 /work/.github/build-native-debian.sh + run: docker run --rm -v $GITHUB_WORKSPACE:/work "$DOCKER_IMAGE_NAME" /work/.github/build-native-debian.sh - name: Archive built library - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: shared-object-${{ matrix.arch }} path: build/jni/*.so - name: Archive built jar - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: jar-${{ matrix.arch }} path: archive/*.jar From 98bfe62fdc6dbfdbb83ad75b30b6112c39a2f756 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sat, 19 Apr 2025 15:09:11 +0800 Subject: [PATCH 2/2] cleanup --- .github/build-native-debian.sh | 2 +- .github/workflows/native-linux.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/build-native-debian.sh b/.github/build-native-debian.sh index a23c2281..33efe6b6 100755 --- a/.github/build-native-debian.sh +++ b/.github/build-native-debian.sh @@ -17,7 +17,7 @@ wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | gpg -- 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 apt-get update -y -if [[ "$CROSS_ARCH" == "riscv64" ]]; then +if [[ "$(uname -m)" == "riscv64" ]]; then # JDK 8 is not available on RISC-V 64 apt-get install -y temurin-17-jdk else diff --git a/.github/workflows/native-linux.yml b/.github/workflows/native-linux.yml index 50a9fe76..8fde179e 100644 --- a/.github/workflows/native-linux.yml +++ b/.github/workflows/native-linux.yml @@ -47,7 +47,6 @@ jobs: run: sudo apt-get install -y --no-install-recommends qemu-user-static - name: Initialize environment variables run: | - echo "CROSS_ARCH=${{ matrix.arch }}" >> $GITHUB_ENV if [[ "${{ matrix.arch }}" == "riscv64" ]]; then echo "DOCKER_IMAGE_NAME=debian:trixie" >> $GITHUB_ENV else