diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index c9c9199..39df6a9 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,6 +7,11 @@ on: jobs: should_build: runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.12" + - "3.13" steps: - name: Set up Docker buildx uses: docker/setup-buildx-action@v3 @@ -17,8 +22,10 @@ jobs: username: ${{ github.actor }} password: ${{ github.token }} - name: Build image - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: + build-args: | + GO_VERSION=${{ matrix.python-version }} cache-from: type=gha platforms: linux/amd64 # GitHub only offers AMD64 codespaces pull: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6a4555c..c715f72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,9 +8,17 @@ on: branches: - main +env: + LATEST_PYTHON_VERSION: "3.13" + jobs: build_and_upload_image: runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - "3.12" + - "3.13" steps: - name: Set up Docker buildx uses: docker/setup-buildx-action@v3 @@ -20,15 +28,32 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ github.token }} - - name: Build and Push - uses: docker/build-push-action@v5 + - name: Build and Push Image + if: ${{ matrix.python-version != env.LATEST_PYTHON_VERSION }} + uses: docker/build-push-action@v6 with: + build-args: | + PYTHON_VERSION=${{ matrix.python-version }} platforms: linux/amd64 # GitHub only offers AMD64 codespaces pull: true push: true - tags: ghcr.io/${{ github.repository }}:latest + tags: ghcr.io/${{ github.repository }}:${{ matrix.python-version }} cache-from: type=gha # mode=max means "cache everything possible". This ensures maximum # use of the cache, but will use up GitHub's 10 GB cache size limit # faster. cache-to: type=gha,mode=max + - name: Build and Push 'latest' Image + if: ${{ matrix.python-version == env.LATEST_PYTHON_VERSION }} + uses: docker/build-push-action@v6 + with: + build-args: | + PYTHON_VERSION=${{ matrix.python-version }} + platforms: linux/amd64 # GitHub only offers AMD64 codespaces + pull: true + push: true + tags: ghcr.io/${{ github.repository }}:${{ matrix.python-version }},ghcr.io/${{ github.repository }}:latest + cache-from: type=gha + # mode=max means "cache everything possible". This ensures maximum + # use of the cache, but will use up GitHub's 10 GB cache size limit + # faster. diff --git a/Dockerfile b/Dockerfile index a7a243f..3d5b4cb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -ARG PYTHON_VERSION="3.12" +ARG PYTHON_VERSION="3.13" FROM mcr.microsoft.com/devcontainers/python:${PYTHON_VERSION} LABEL org.opencontainers.image.authors="Ryan Boehning <1250684+ryboe@users.noreply.github.com>"