Skip to content

Commit

Permalink
fix(ci): Updated python version and fixed alpine build
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyVignelles committed May 13, 2024
1 parent 64e577f commit 4a51181
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 46 deletions.
34 changes: 9 additions & 25 deletions .build/Dockerfile.builder.alpine
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@
FROM alpine:3.13 as builder
# We can't use edge because of faccessat2 enabled in musl.
# https://wiki.alpinelinux.org/wiki/Draft_Release_Notes_for_Alpine_3.14.0#faccessat2

RUN apk add --no-cache python3 && python3 --version
RUN apk add --no-cache curl &&\
curl -fLo get-pip.py https://bootstrap.pypa.io/get-pip.py &&\
python3 get-pip.py &&\
rm get-pip.py &&\
apk del curl
RUN apk add --no-cache build-base python3-dev libffi-dev openssl-dev zlib-dev
FROM alpine:3.19 as builder

COPY . /docker-devbox-ddb
WORKDIR /docker-devbox-ddb

RUN CRYPTOGRAPHY_DONT_BUILD_RUST=1 pip install -e .[dev] && pip uninstall -y pyinstaller

# Build pyinstaller bootloader for alpine (from https://github.com/six8/pyinstaller-alpine)
RUN pip uninstall -y pyinstaller &&\
apk --no-cache add git &&\
git clone --depth 1 --single-branch --branch "v4.2" https://github.com/pyinstaller/pyinstaller.git /tmp/pyinstaller &&\
cd /tmp/pyinstaller/bootloader &&\
python3 ./waf configure --no-lsb all &&\
pip install --force-reinstall ..

RUN pyinstaller --dist ./dist ddb.spec
RUN cp ./dist/ddb /usr/local/bin
RUN apk add --no-cache build-base python3-dev libffi-dev openssl-dev zlib-dev
RUN python3 -m venv /venv && \
. /venv/bin/activate && \
pip install pyinstaller && \
pip install -e .[dev] && \
pyinstaller --dist ./dist ddb.spec

FROM alpine:3.13
COPY --from=builder "/usr/local/bin/ddb" "/usr/local/bin"
FROM alpine:3.19
COPY --from=builder "/docker-devbox-ddb/dist/ddb" "/usr/local/bin"

RUN chmod +x "/usr/local/bin/ddb"
CMD ["/usr/local/bin/ddb"]
42 changes: 21 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ]

steps:
- name: Setup docker
Expand Down Expand Up @@ -64,19 +64,19 @@ jobs:
runs-on: macos-latest
continue-on-error: true

name: Python 3.8 (MacOS)
name: Python 3.11 (MacOS)

steps:
- name: Setup docker
uses: docker-practice/actions-setup-docker@master
with:
docker_version: "20.10"
docker_version: "24.0"
docker_channel: "stable"

- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.1'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -117,13 +117,13 @@ jobs:
runs-on: windows-latest
continue-on-error: true

name: Python 3.8 (Windows)
name: Python 3.11 (Windows)

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -176,10 +176,10 @@ jobs:
name: Build (Linux Setuptools)

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -215,10 +215,10 @@ jobs:
name: Build (Linux Binary)

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -258,13 +258,13 @@ jobs:
- name: Setup docker
uses: docker-practice/actions-setup-docker@master
with:
docker_version: "20.10"
docker_version: "24.0"
docker_channel: "stable"

- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -307,10 +307,10 @@ jobs:
name: Build (Windows)

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -346,10 +346,10 @@ jobs:
name: Build (MacOS)

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -385,10 +385,10 @@ jobs:
name: Release

steps:
- name: Setup python 3.8
- name: Setup python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.11'

- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 4a51181

Please sign in to comment.