diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3d562bf..6317d1ee 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='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 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 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 . 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.