Skip to content

Commit

Permalink
py3.13 runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
kalekseev committed Dec 1, 2024
1 parent 3d9d7c0 commit f803250
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,43 @@ jobs:
weasyprint-build:
name: Build WeasyPrint
runs-on: ubuntu-latest
strategy:
matrix:
version: ["3.12", "3.13"]
env:
RUNTIME: ${{ matrix.version }}
steps:
- uses: actions/checkout@v4
- name: Build Layer
run: make build/weasyprint-layer-python3.12.zip
run: make build/weasyprint-layer-python${{ matrix.version }}.zip
- name: Test weasyprint
run: |
mkdir output
make test.start.container &
sleep 1
TEST_FILENAME=output/report.pdf make test.print.report
make test.print.report
rm -rf build/opt
env:
TEST_FILENAME: build/test-report-${{ matrix.version }}.pdf
- name: Upload Build
uses: actions/upload-artifact@v4
with:
name: WeasyPrint Layer Build
name: WeasyPrint Layer Build ${{ matrix.version }}
path: build
- name: Upload Test PDF
uses: actions/upload-artifact@v4
weasyprint-release:
name: Release WeasyPrint
runs-on: ubuntu-latest
needs: [weasyprint-build]
if: startsWith(github.ref, 'refs/tags/weasyprint-')
steps:
- name: Download build
uses: actions/download-artifact@v4
with:
name: WeasyPrint Test Results
path: output
path: artifacts
- name: Create WeasyPrint Release
if: startsWith(github.ref, 'refs/tags/weasyprint-')
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
with:
files: |
./build/weasyprint-layer-python3.12.zip
./build/weasyprint-layer-python3.12-no-fonts.zip
files: ./artifacts/**/weasyprint-layer-python*

ghostscript-build:
name: Build GhostScript
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PLATFORM ?= linux/amd64
RUNTIME ?= 3.12
TEST_FILENAME ?= report.pdf
DOCKER_RUN=docker run --rm --platform=${PLATFORM}
DOCKER_RUN=docker run --rm --platform=${PLATFORM} -e RUNTIME_VERSION=${RUNTIME}

.PHONY: stack.deploy.weasyprint clean test.start.container test.print.report

Expand Down
6 changes: 6 additions & 0 deletions weasyprint/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Build layer:
$ make test.print.report
# a report.pdf file will generate to the current directory


Deploy layer:

$ aws lambda publish-layer-version \
Expand All @@ -32,6 +33,11 @@ Lambda must be configured with these env vars:

If you are using the release zip files ensure your Lambda instruction set architecture is set to `x86_64` and not `arm64`.


To build a layer for python 3.13 use:

RUNTIME=3.13 make build/weasyprint-layer-python3.13.zip

## Docker Lambda

Build layer:
Expand Down

0 comments on commit f803250

Please sign in to comment.