From 04859cdfa7cf30bf692f4b11562833d739e92145 Mon Sep 17 00:00:00 2001 From: thxCode Date: Sun, 11 Aug 2024 15:32:48 +0800 Subject: [PATCH] ci: adjust Signed-off-by: thxCode --- .github/workflows/cmd.yml | 6 ++++-- Makefile | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml index b44393a..5759e48 100644 --- a/.github/workflows/cmd.yml +++ b/.github/workflows/cmd.yml @@ -82,7 +82,6 @@ jobs: - name: Setup Buildx uses: docker/setup-buildx-action@v3 - name: Login DockerHub - if: ${{ github.event_name != 'pull_request' }} uses: docker/login-action@v3 with: username: ${{ secrets.CI_DOCKERHUB_USERNAME }} @@ -99,7 +98,6 @@ jobs: images: "${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}" - name: Package uses: docker/build-push-action@v6 - id: package with: push: true file: ${{ github.workspace }}/Dockerfile @@ -107,5 +105,9 @@ jobs: platforms: "linux/amd64,linux/arm64" tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} + cache-from: | + type=registry,ref=${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}:build-cache + cache-to: | + type=registry,mode=max,oci-mediatypes=false,compression=gzip,ref=${{ env.PACKAGE_REGISTRY }}/${{ env.PACKAGE_IMAGE }}:build-cache,ignore-error=true provenance: true sbom: true diff --git a/Makefile b/Makefile index 1cbad92..b1d523b 100644 --- a/Makefile +++ b/Makefile @@ -104,8 +104,6 @@ gguf-parser: fi;\ done -ci: deps generate test lint - build: gguf-parser PACKAGE_PUBLISH ?= false @@ -135,3 +133,5 @@ package: build fi @echo "--- $@ ---" + +ci: deps generate test lint build