From 9c2e5ef65efea11bfb2adba4061538f531d1173d Mon Sep 17 00:00:00 2001 From: Lior Dux Date: Mon, 21 Apr 2025 06:06:30 +0000 Subject: [PATCH 1/4] feat: use ghcr image instead of docker --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8cef855d..7c45db63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # See Dockerfile.build for instructions on bumping this. -FROM ewjoachim/python-coverage-comment-action-base:v6 +FROM ghcr.io/py-cov-action/python-coverage-comment-action-base:v6 COPY coverage_comment ./coverage_comment RUN md5sum -c pyproject.toml.md5 || pip install -e . From bb38e071ad49fed23d055c59c637d09d553db41e Mon Sep 17 00:00:00 2001 From: Lior Dux Date: Mon, 21 Apr 2025 06:11:01 +0000 Subject: [PATCH 2/4] feat: add readme note about sources --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2fcbfc43..46358d3a 100644 --- a/README.md +++ b/README.md @@ -614,3 +614,10 @@ with badges. We've been iterating a lot on the new format. It's perfectly ok if you preferred the old format. In that case, see #335 for instructions on how to emulate the old format using `COMMENT_TEMPLATE`. + +## New base image registry + +The Dockerfile used by this image can have both registeries as sources: +- ewjoachim/python-coverage-comment-action-base:v6 +- ghcr.io/py-cov-action/python-coverage-comment-action-base:v6 +Take your pick according to your needs. From 55f51fb1e2c374d28fa6626bbd3eb736b292fbf5 Mon Sep 17 00:00:00 2001 From: Lior Dux Date: Mon, 21 Apr 2025 06:14:59 +0000 Subject: [PATCH 3/4] feat: buildx, caching, added label to image --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3d562bf..903b3550 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,23 +27,49 @@ jobs: username: ewjoachim password: ${{ secrets.DOCKER_PASSWORD }} - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3.6.0 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.10.0 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3.3.0 with: registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} + username: ${{ github.actor }} + password: ${{ github.token }} + + - id: docker_meta + uses: docker/metadata-action@v5.7.0 + with: + images: ghcr.io/${{ github.repository }} + tags: type=sha,format=long - name: Build and push Docker image uses: docker/build-push-action@v6 with: - # See Dockerfile.build for instructions on bumping this. + context: . + file: Dockerfile.build + platforms: linux/amd64,linux/arm64 + labels: | + project='python-coverage-comment-action-base' + org='py-cov-action' + commit-sha='${{ github.sha }}' + org.opencontainers.image.source='https://github.com/${{ github.repository }}' + org.opencontainers.image.description='AWS Lambda Calculator is the only extensive and thorough cost estimation tool for the AWS Lambda product. It's based on a simple API that produces a cost estimation based on different Lambda configuration variables and parameters such as CPU, RAM, concurrency, invocations, free tier, and much more. This can be helpful for any FinOps fields or tools in the future.' + org.opencontainers.image.licenses='MIT' tags: | ewjoachim/python-coverage-comment-action-base:v6 ghcr.io/py-cov-action/python-coverage-comment-action-base:v6 + ${{ steps.docker_meta.outputs.tags }} + ghcr.io/${{ github.repository }}:${{ github.sha }} + ghcr.io/${{ github.repository }}:latest + cache-from: | + ghcr.io/${{ github.repository }}:${{ github.sha }} + ghcr.io/${{ github.repository }}:latest + cache-to: type=inline push: true - file: Dockerfile.build - platforms: linux/amd64,linux/arm64 compute-tags: name: Re-tag action with new version From 8ed83f8ccc659541791726373b29d5abbe0c1cd2 Mon Sep 17 00:00:00 2001 From: Lior Dux Date: Mon, 21 Apr 2025 06:15:53 +0000 Subject: [PATCH 4/4] fix: description label --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 903b3550..6317d1ee 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -57,7 +57,7 @@ jobs: org='py-cov-action' commit-sha='${{ github.sha }}' org.opencontainers.image.source='https://github.com/${{ github.repository }}' - org.opencontainers.image.description='AWS Lambda Calculator is the only extensive and thorough cost estimation tool for the AWS Lambda product. It's based on a simple API that produces a cost estimation based on different Lambda configuration variables and parameters such as CPU, RAM, concurrency, invocations, free tier, and much more. This can be helpful for any FinOps fields or tools in the future.' + org.opencontainers.image.description='Publish coverage report as PR comment, and create a coverage badge & dashboard to display on the Readme for Python projects, all inside GitHub without third party servers' org.opencontainers.image.licenses='MIT' tags: | ewjoachim/python-coverage-comment-action-base:v6