From 22d8c54bfa596fd50c822bf4eb29b3ef03f6efbf Mon Sep 17 00:00:00 2001 From: Florian Wilhelm Date: Tue, 29 Oct 2024 11:25:29 +0100 Subject: [PATCH] don't build in container to avoid cross build on arm --- .github/workflows/ci.yaml | 9 +++++++++ Containerfile | 8 ++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2b1a4e4..8d50e72 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -53,6 +53,8 @@ jobs: container-image: runs-on: ubuntu-24.04 + needs: + - build env: IMAGE_NAME: gardenlinux/glvd-api IMAGE_TAG: latest @@ -61,6 +63,13 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 + - run: mkdir -p build + - name: Download built jar + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: build + - name: Install qemu dependency for multi-arch build run: | sudo apt-get update diff --git a/Containerfile b/Containerfile index e760b6f..f866a7a 100644 --- a/Containerfile +++ b/Containerfile @@ -3,14 +3,14 @@ RUN apt-get update -q && apt-get install -y binutils RUN mkdir /usr/src/glvd COPY . /usr/src/glvd WORKDIR /usr/src/glvd -RUN ./gradlew --no-daemon build -x asciidoctor -x test -RUN jar xf build/libs/glvd-0.0.1-SNAPSHOT.jar +COPY build/libs/glvd-0.0.1-SNAPSHOT.jar glvd.jar +RUN jar xf glvd-0.0.1-SNAPSHOT.jar RUN jdeps --ignore-missing-deps -q \ --recursive \ --multi-release 21 \ --print-module-deps \ --class-path 'BOOT-INF/lib/*' \ - build/libs/glvd-0.0.1-SNAPSHOT.jar > deps.info + glvd-0.0.1-SNAPSHOT.jar > deps.info RUN jlink \ --add-modules $(cat deps.info) \ --strip-debug \ @@ -26,6 +26,6 @@ ENV JAVA_HOME /user/java/jdk17 ENV PATH $JAVA_HOME/bin:$PATH COPY --from=build /tinysapmachine $JAVA_HOME RUN mkdir /glvd -COPY --from=build /usr/src/glvd/build/libs/glvd-0.0.1-SNAPSHOT.jar /glvd/ +COPY --from=build /usr/src/glvd/glvd-0.0.1-SNAPSHOT.jar /glvd/ WORKDIR /glvd ENTRYPOINT java -jar glvd-0.0.1-SNAPSHOT.jar