From b6f4794755c90d775fd58e9e1aa7fe7a28a83514 Mon Sep 17 00:00:00 2001 From: fok666 Date: Tue, 6 Jan 2026 16:07:40 +0100 Subject: [PATCH 1/5] feat: Add GitHub Actions package ecosystem to Dependabot configuration --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index debd3c9..caec7e1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" # Location of package manifests schedule: interval: "weekly" + - package-ecosystem: "github-actions" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" From 4c5f21203f80e3594872dfbf63e6473389d2b114 Mon Sep 17 00:00:00 2001 From: fok666 Date: Tue, 6 Jan 2026 16:07:51 +0100 Subject: [PATCH 2/5] feat: Add GitHub Actions workflow for building and releasing multi-arch Docker images --- .github/workflows/build-and-release.yml | 187 ++++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 .github/workflows/build-and-release.yml diff --git a/.github/workflows/build-and-release.yml b/.github/workflows/build-and-release.yml new file mode 100644 index 0000000..eba1e8d --- /dev/null +++ b/.github/workflows/build-and-release.yml @@ -0,0 +1,187 @@ +name: Build and Release Multi-Arch Docker Images + +on: + push: + branches: + - main + tags: + - 'v*' + pull_request: + branches: + - main + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-amd64: + name: Build AMD64 - Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=python${{ matrix.python-version }}-amd64-latest,enable={{is_default_branch}} + type=ref,event=branch,suffix=-python${{ matrix.python-version }}-amd64 + type=ref,event=pr,suffix=-python${{ matrix.python-version }}-amd64 + type=semver,pattern={{version}},suffix=-python${{ matrix.python-version }}-amd64 + type=semver,pattern={{major}}.{{minor}},suffix=-python${{ matrix.python-version }}-amd64 + type=sha,suffix=-python${{ matrix.python-version }}-amd64 + + - name: Build and push AMD64 image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64 + build-args: | + PYTHON_VERSION=${{ matrix.python-version }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=amd64-${{ matrix.python-version }} + cache-to: type=gha,mode=max,scope=amd64-${{ matrix.python-version }} + + build-arm64: + name: Build ARM64 - Python ${{ matrix.python-version }} + runs-on: ubuntu-24.04-arm64 + permissions: + contents: read + packages: write + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Container Registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=raw,value=python${{ matrix.python-version }}-arm64-latest,enable={{is_default_branch}} + type=ref,event=branch,suffix=-python${{ matrix.python-version }}-arm64 + type=ref,event=pr,suffix=-python${{ matrix.python-version }}-arm64 + type=semver,pattern={{version}},suffix=-python${{ matrix.python-version }}-arm64 + type=semver,pattern={{major}}.{{minor}},suffix=-python${{ matrix.python-version }}-arm64 + type=sha,suffix=-python${{ matrix.python-version }}-arm64 + + - name: Build and push ARM64 image + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/arm64 + build-args: | + PYTHON_VERSION=${{ matrix.python-version }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha,scope=arm64-${{ matrix.python-version }} + cache-to: type=gha,mode=max,scope=arm64-${{ matrix.python-version }} + + create-manifest: + name: Create Multi-Arch Manifest - Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + needs: [build-amd64, build-arm64] + if: github.event_name != 'pull_request' + permissions: + contents: read + packages: write + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + steps: + - name: Log in to Container Registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create and push manifest for latest + if: github.ref == 'refs/heads/main' + run: | + docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ matrix.python-version }}-latest \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ matrix.python-version }}-amd64-latest \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ matrix.python-version }}-arm64-latest + + - name: Create and push manifest for tags + if: startsWith(github.ref, 'refs/tags/') + run: | + TAG_VERSION=${GITHUB_REF#refs/tags/} + docker buildx imagetools create -t ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_VERSION}-python${{ matrix.python-version }} \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_VERSION}-python${{ matrix.python-version }}-amd64 \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${TAG_VERSION}-python${{ matrix.python-version }}-arm64 + + create-release: + name: Create GitHub Release + runs-on: ubuntu-latest + needs: [create-manifest] + if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + body: | + ## Multi-Arch Docker Images + + Images are available for Python 3.10, 3.11, 3.12, 3.13, and 3.14 on both AMD64 and ARM64 architectures. + + ### Usage + + Pull a specific Python version: + ```bash + docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python3.14 + ``` + + The images support both AMD64 and ARM64 architectures automatically. + + ### Available Tags + - `${{ github.ref_name }}-python3.10` (multi-arch) + - `${{ github.ref_name }}-python3.11` (multi-arch) + - `${{ github.ref_name }}-python3.12` (multi-arch) + - `${{ github.ref_name }}-python3.13` (multi-arch) + - `${{ github.ref_name }}-python3.14` (multi-arch) From e5ae16b40d17f0785a3831109402007fe641f917 Mon Sep 17 00:00:00 2001 From: fok666 Date: Tue, 6 Jan 2026 16:13:14 +0100 Subject: [PATCH 3/5] docs: Update README to include badges for Dependabot and Docker image builds --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index bcf3708..9331ab5 100644 --- a/readme.md +++ b/readme.md @@ -2,6 +2,10 @@ Build AWS Lambda deployment packages and layers for multiple Python versions (3.10+) and architectures (x86_64/arm64). +[![Dependabot Updates](https://github.com/fok666/lambda-python-layer/actions/workflows/dependabot/dependabot-updates/badge.svg)](https://github.com/fok666/lambda-python-layer/actions/workflows/dependabot/dependabot-updates) [![Build and Release Multi-Arch Docker Images](https://github.com/fok666/lambda-python-layer/actions/workflows/build-and-release.yml/badge.svg)](https://github.com/fok666/lambda-python-layer/actions/workflows/build-and-release.yml) + +Inspired by [LambdaZipper](https://github.com/tiivik/LambdaZipper) + ## Features - 🐍 **Multiple Python versions**: Support for Python 3.10, 3.11, 3.12, 3.13, and 3.14 (default) From 0391a5f45285b11495d4203d6aca3624f2f872f1 Mon Sep 17 00:00:00 2001 From: fok666 Date: Tue, 6 Jan 2026 16:15:33 +0100 Subject: [PATCH 4/5] feat: Add MIT License to the repository --- LICENSE | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e4daab2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) Microsoft Corporation + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 40e0dea6d2459e627b9ddaf1f04f78667ef93c23 Mon Sep 17 00:00:00 2001 From: fok666 Date: Tue, 6 Jan 2026 16:15:38 +0100 Subject: [PATCH 5/5] docs: Remove Migration Guide section and update usage instructions in README --- readme.md | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/readme.md b/readme.md index 9331ab5..e1791f2 100644 --- a/readme.md +++ b/readme.md @@ -313,41 +313,6 @@ docker run --rm \ lambda-zipper:custom numpy ``` -## Migration Guide - -### Migrating from Previous Versions - -**Old behavior** (required explicit flags): -```bash -./build-multiarch.sh --requirements requirements.txt --python 3.13 -``` - -**New behavior** (smart defaults): -```bash -./build-multiarch.sh # Uses requirements.txt and Python 3.14 by default -``` - -**Key Changes:** -- Default Python version changed from 3.13 → 3.14 -- `-r` or `--requirements` flag now optional (defaults to `requirements.txt`) -- Single combined archive is now the default (use `--individual` for old behavior) -- Both architectures built by default (use `--skip-arm64` or `--skip-x86` to build only one) - -### Updating Existing Scripts - -If you have scripts using the old syntax, they will continue to work. However, you can simplify them: - -```bash -# Old way (still works) -./build-multiarch.sh --requirements requirements.txt --python 3.13 - -# New simplified way (if using defaults) -./build-multiarch.sh --python 3.13 - -# Or just use all defaults -./build-multiarch.sh -``` - ## Output File Naming Archives are named with the following pattern: