Skip to content

Commit 13e5f5c

Browse files
authored
Global install of QMK bootstrap distribution. (#216)
1 parent f393ad0 commit 13e5f5c

2 files changed

Lines changed: 16 additions & 12 deletions

File tree

.github/workflows/cli_setup.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
matrix:
3434
os: [macos-latest, ubuntu-latest]
3535
python-version: ['3.9', '3.10', '3.11', '3.12']
36-
include:
37-
- os: macos-13
38-
python-version: '3.9'
3936

4037
steps:
4138
- uses: actions/checkout@v6

Dockerfile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,32 @@ FROM ghcr.io/qmk/qmk_base_container:latest as builder
44
ADD dist /tmp/dist
55

66
# Install QMK CLI via bootstrap script
7-
ARG TARGETPLATFORM
8-
RUN /bin/bash -c "curl -fsSL https://install.qmk.fm | sh -s -- --confirm"
7+
RUN mkdir -p /opt/uv/bin \
8+
&& export UV_PYTHON_INSTALL_DIR=/opt/uv/bin \
9+
&& /bin/bash -c "curl -fsSL https://install.qmk.fm | sh -s -- --confirm --uv-install-dir=/usr/local/bin --uv-tool-dir=/opt/uv/tools --qmk-distrib-dir=/opt/qmk"
910

1011
# Do the equivalent of entering the virtual environment
11-
ENV PATH=/home/qmk/.local/share/uv/tools/qmk/bin:/home/qmk/.local/bin:$PATH \
12-
VIRTUAL_ENV=/home/qmk/.local/share/uv/tools/qmk
12+
ENV PATH=/opt/qmk/bin:/opt/uv/tools/qmk/bin:/usr/local/bin:$PATH \
13+
VIRTUAL_ENV=/opt/uv/tools/qmk
1314

1415
# Install python packages
1516
RUN python3 -m pip uninstall -y qmk || true
1617
RUN python3 -m pip install --upgrade pip setuptools wheel nose2 && \
1718
python3 -m pip install /tmp/dist/qmk-*.whl
1819

20+
# Allow the uv-installed python to be usable by others
21+
RUN chmod -R go=u,go-w /opt/uv /opt/qmk
22+
1923
# 2nd stage so we don't have /tmp/dist in the final image
2024
FROM ghcr.io/qmk/qmk_base_container:latest
2125

26+
COPY --from=builder /opt/uv /opt/uv
27+
COPY --from=builder /opt/qmk /opt/qmk
28+
2229
# Do the equivalent of entering the virtual environment
23-
ENV PATH=/home/qmk/.local/share/uv/tools/qmk/bin:/home/qmk/.local/bin:$PATH \
24-
VIRTUAL_ENV=/home/qmk/.local/share/uv/tools/qmk
30+
ENV PATH=/opt/qmk/bin:/opt/uv/tools/qmk/bin:$PATH \
31+
VIRTUAL_ENV=/opt/uv/tools/qmk \
32+
QMK_DISTRIB_DIR=/opt/qmk \
33+
QMK_HOME=/qmk_firmware \
34+
QMK_USERSPACE=/qmk_userspace
2535

26-
ARG TARGETPLATFORM
27-
COPY --from=builder /home/qmk /home/qmk
28-
COPY --from=builder /usr/lib/udev/rules.d/50-qmk.rules /usr/lib/udev/rules.d/50-qmk.rules

0 commit comments

Comments
 (0)