From 46286a7343c40231b7ba2fb5c948c518c2ad9ca4 Mon Sep 17 00:00:00 2001 From: nscuro Date: Tue, 17 Jan 2023 21:55:38 +0100 Subject: [PATCH] Workaround for buildx build failures Until https://github.com/quarkusio/quarkus/issues/30424 is fixed Signed-off-by: nscuro --- .github/workflows/publishJar.yml | 53 +++++++++++++++++++++++++++----- mirror-service/pom.xml | 4 +++ 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publishJar.yml b/.github/workflows/publishJar.yml index 9bea33651..7a84392bb 100644 --- a/.github/workflows/publishJar.yml +++ b/.github/workflows/publishJar.yml @@ -28,12 +28,49 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and Push + - name: Determine project version + id: determine-project-version run: |- - mvn clean install -DskipTests \ - -Dquarkus.container-image.build=true \ - -Dquarkus.container-image.push=true \ - -Dquarkus.container-image.registry=ghcr.io \ - -Dquarkus.container-image.group=${{ github.repository_owner }} \ - -Dquarkus.container-image.additional-tags=latest \ - -Dquarkus.docker.buildx.platform=linux/amd64,linux/arm64 \ No newline at end of file + PROJECT_VERSION=$(yq -p=xml '.project.version' pom.xml) + echo "PROJECT_VERSION=$PROJECT_VERSION" >> $GITHUB_OUTPUT + - name: Build JARs + run: mvn clean install -DskipTests + # Manually invoke buildx for each service. + # Workaround for https://github.com/quarkusio/quarkus/issues/30424 + # Revert to Quarkus-native container build + push once the issue is fixed. + - name: Build and push mirror-service container image + uses: docker/build-push-action@v3 + with: + context: ./mirror-service + file: ./mirror-service/src/main/docker/Dockerfile.jvm + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/mirror-service:latest + ghcr.io/${{ github.repository_owner }}/mirror-service:${{ steps.determine-project-version.outputs.PROJECT_VERSION }} + - name: Build and push notification-publisher container image + uses: docker/build-push-action@v3 + with: + context: ./notification-publisher + file: ./notification-publisher/src/main/docker/Dockerfile.jvm + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/notification-publisher:latest + ghcr.io/${{ github.repository_owner }}/notification-publisher:${{ steps.determine-project-version.outputs.PROJECT_VERSION }} + - name: Build and push repository-meta-analyzer container image + uses: docker/build-push-action@v3 + with: + context: ./repository-meta-analyzer + file: ./repository-meta-analyzer/src/main/docker/Dockerfile.jvm + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/repository-meta-analyzer:latest + ghcr.io/${{ github.repository_owner }}/repository-meta-analyzer:${{ steps.determine-project-version.outputs.PROJECT_VERSION }} + - name: Build and push vulnerability-analyzer container image + uses: docker/build-push-action@v3 + with: + context: ./vulnerability-analyzer + file: ./vulnerability-analyzer/src/main/docker/Dockerfile.jvm + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/vulnerability-analyzer:latest + ghcr.io/${{ github.repository_owner }}/vulnerability-analyzer:${{ steps.determine-project-version.outputs.PROJECT_VERSION }} diff --git a/mirror-service/pom.xml b/mirror-service/pom.xml index dde2e4a11..b6e654e17 100644 --- a/mirror-service/pom.xml +++ b/mirror-service/pom.xml @@ -76,6 +76,10 @@ json 20220924 + + io.quarkus + quarkus-container-image-docker +