Repository navigation
First release of Package Python Lambda, a composite GitHub Action that packages a Python AWS Lambda project built with uv into a reproducible deployment zip.
The action checks the target runtime and CPU architecture before it builds anything. If they don't match what your Lambda expects, the build fails in CI, not when the function runs.
What it does
- Installs and caches uv, with the cache keyed off your project's
uv.lock. - Checks
python-versionandplatformbefore any real work and fails fast with a clear::error::if either one is missing or unsupported. - Exports your locked dependencies (
uv export --frozen --no-dev), builds your project as a wheel, and installs both into a venv for the target Lambda platform. - Packages the venv with
package-python-functioninto a zip named after your project. - Leaves the zip on the runner's filesystem, so a Terraform or AWS CLI step in the same job can use it directly.
Highlights
- Reproducible output. The same inputs give the same zip and the same SHA-256, so you can skip redeploying an unchanged function.
- No silent architecture drift.
python-versionandplatformhave no defaults on purpose. You name both every time, so a compiled dependency can't quietly be built for the wrong ABI. - Size reporting against AWS's limit. The
uncompressed-bytesoutput is the figure AWS's 250 MiB limit applies to. If a package goes over, the packager's nested-zip fallback kicks in andnested-zipreports it. - Monorepo friendly. Each call packages one lambda. Use your own matrix to package several in parallel, with optional artifact upload under a derived name that is unique per lambda, platform and runtime.
Supported targets
- Runtimes: Python
3.11,3.12,3.13,3.14.3.11builds but shows a warning: AWS retires it on 2027-06-30. - Platforms:
aarch64-manylinux2014(Lambdaarm64) andx86_64-manylinux2014(Lambdax86_64). - Runners: Linux only.
Usage
- uses: actions/checkout@v7
- id: package
uses: dhrimov/package-python-lambda-gha@v1
with:
input-path: .
output-path: terraform
python-version: "3.13"
platform: aarch64-manylinux2014
The project needs a pyproject.toml and a uv.lock.
Outputs
zip-path (absolute), zip-sha256, package-size-bytes, uncompressed-bytes, nested-zip.
Good to know
- The action builds in
<input-path>/buildand deletes that directory before and after every build. Don't keep anything there. - The action makes no GitHub API calls of its own and needs no token scopes.
- Deploying the zip is out of scope. The action's job ends once the zip exists.
See the README for all inputs, the pinning advice and the artifact naming rules.