From 8da3105ab90a743e2c925953fa434c2992059435 Mon Sep 17 00:00:00 2001 From: Firq Date: Mon, 22 Jul 2024 18:16:13 +0200 Subject: [PATCH] Added matrix build for multiple python versions --- .forgejo/workflows/build_release.yml | 16 +++++++++++++--- Dockerfile | 4 +++- README.md | 6 +++++- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/.forgejo/workflows/build_release.yml b/.forgejo/workflows/build_release.yml index fe08249..63ac974 100644 --- a/.forgejo/workflows/build_release.yml +++ b/.forgejo/workflows/build_release.yml @@ -1,11 +1,19 @@ on: push: - tags: - - '[0-9]+\.[0-9]+' + branches: + - 'main' + paths: + - '.forgejo/workflows/*' + - 'Dockerfile' + - 'pip.conf' jobs: build: runs-on: dind + strategy: + matrix: + python-version: [ '3.9', '3.10', '3.11', '3.12' ] + name: build-python-${{ matrix.python-version }} steps: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -19,7 +27,9 @@ jobs: uses: docker/build-push-action@v5 with: push: true - tags: forgejo.neshweb.net/ci-docker-images/python-neshweb:${{ github.ref_name }} + build-args: | + PYTHON_VERSION=${{ matrix.python-version }} + tags: forgejo.neshweb.net/ci-docker-images/python-neshweb:${{ matrix.python-version }} release: needs: [ build ] diff --git a/Dockerfile b/Dockerfile index df3f0b8..b5117de 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,6 @@ -FROM nikolaik/python-nodejs:python3.11-nodejs21-alpine +ARG PYTHON_VERSION=3.12 + +FROM nikolaik/python-nodejs:python${PYTHON_VERSION}-nodejs22-alpine RUN apk -U upgrade && apk add --no-cache git openssh COPY pip.conf /etc/pip.conf diff --git a/README.md b/README.md index dc2052c..f7bc0fd 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ # python-neshweb -A Python 3.11 and NodeJS 21 container preconfigured with the correct settings to pull from PyPi indexes on Neshweb +A python container bundled with NodeJS 22 based on an alpine image. + +Build in a matrix for Python 3.10, 3.11 and 3.12 + +Comes bundled with git and OpenSSH installed as well