Skip to content

Commit c0d57c7

Browse files
committed
feat: ✨ Build Docker image
1 parent e247a46 commit c0d57c7

File tree

4 files changed

+47
-1
lines changed

4 files changed

+47
-1
lines changed

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,37 @@ jobs:
6262
- name: Publish to PyPI
6363
uses: pypa/gh-action-pypi-publish@release/v1
6464

65+
release_dockerhub:
66+
runs-on: ubuntu-latest
67+
needs: release
68+
69+
steps:
70+
- name: Checkout sources
71+
uses: actions/checkout@v4
72+
with:
73+
ref: main
74+
75+
- name: Set up QEMU
76+
uses: docker/setup-qemu-action@v3
77+
78+
- name: Set up Docker Buildx
79+
uses: docker/setup-buildx-action@v3
80+
81+
- name: Login to DockerHub
82+
uses: docker/login-action@v3
83+
with:
84+
username: ${{ secrets.DOCKERHUB_USERNAME }}
85+
password: ${{ secrets.DOCKERHUB_TOKEN }}
86+
87+
- name: Build and push Docker image
88+
uses: docker/build-push-action@v6
89+
with:
90+
platforms: linux/amd64,linux/arm64
91+
context: .
92+
file: Dockerfile
93+
push: true
94+
tags: getcodelimit/codelimit:latest
95+
6596
release_binaries:
6697
name: Release binaries
6798
needs:

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM python:3.12-slim-bookworm AS builder
2+
RUN apt update && apt install -y binutils
3+
4+
RUN pip install "uv==0.8.3"
5+
6+
RUN mkdir /app
7+
COPY pyproject.toml uv.lock README.md /app
8+
COPY codelimit /app/codelimit
9+
WORKDIR /app
10+
11+
ENV UV_PROJECT_ENVIRONMENT="/usr/local/"
12+
RUN uv sync --locked --dev
13+
14+
ENTRYPOINT ["uv", "run", "codelimit"]

codelimit/common/report/format_markdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ def _print_findings_with_repository(report_units: list[ReportUnit],
126126
link = (f'https://github.com/{owner}/{name}/blob/{branch}/{unit.file}#L{unit.measurement.start.line}-L'
127127
f'{unit.measurement.end.line}')
128128
console.print(
129-
f"| {violation_type} " + '\[' + unit.measurement.unit_name + ']' + f"({link}) | {unit.measurement.value} "
129+
f"| {violation_type} " + '[' + unit.measurement.unit_name + ']' + f"({link}) | {unit.measurement.value} "
130130
f"| {unit.file} |"
131131
)

0 commit comments

Comments
 (0)