From ee0c7805d23f2ea03dc86c936cfd352f65e6e03d Mon Sep 17 00:00:00 2001 From: mingcheng Date: Wed, 5 Mar 2025 11:29:05 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20update=20artifact=20attestation=20in?= =?UTF-8?q?=20CI=20workflow=20and=20optimize=20release=20profile=20?= =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove commented-out artifact attestation step in `ghcr.yml` - Add release profile optimizations in `Cargo.toml` --- .github/workflows/ghcr.yml | 12 ++++++------ Cargo.toml | 7 +++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml index d063b00..5a02186 100644 --- a/.github/workflows/ghcr.yml +++ b/.github/workflows/ghcr.yml @@ -48,9 +48,9 @@ jobs: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.short-sha.outputs.sha }} labels: ${{ steps.meta.outputs.labels }} - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v2 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true + # - name: Generate artifact attestation + # uses: actions/attest-build-provenance@v2 + # with: + # subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + # subject-digest: ${{ steps.push.outputs.digest }} + # push-to-registry: true diff --git a/Cargo.toml b/Cargo.toml index e2af2ac..06b4e7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,3 +41,10 @@ arboard = "3.4" [[bin]] name = "aigitcommit" path = "src/main.rs" + +[profile.release] +strip = true +opt-level = "z" +lto = true +codegen-units = 1 +panic = "abort" From c9f866ec93ff6a51de1d36c4e27d803d74e7d589 Mon Sep 17 00:00:00 2001 From: mingcheng Date: Wed, 5 Mar 2025 11:29:05 +0800 Subject: [PATCH 2/2] =?UTF-8?q?refactor:=20remove=20deploy=20image=20workf?= =?UTF-8?q?low=20=F0=9F=9B=A0=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete `.github/workflows/deploy_image.yml` --- .github/workflows/deploy_image.yml | 56 ------------------------------ 1 file changed, 56 deletions(-) delete mode 100644 .github/workflows/deploy_image.yml diff --git a/.github/workflows/deploy_image.yml b/.github/workflows/deploy_image.yml deleted file mode 100644 index a7ed010..0000000 --- a/.github/workflows/deploy_image.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Create and publish a Docker image - -on: - push: - branches: - - main - tags: - - "v*" - workflow_dispatch: - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - build-and-push-image: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - attestations: write - id-token: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GHCR_PASSWD }} - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - - uses: benjlevesque/short-sha@v3.0 - id: short-sha - with: - length: 7 - - name: Build and push Docker image - id: push - uses: docker/build-push-action@v6 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: | - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.SHA }} - labels: ${{ steps.meta.outputs.labels }} - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v2 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true