Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion ghostscript/layer_builder.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
set -e
export VERSION="10.03.0"
export VERSION="10.04.0"

dnf install -y gcc tar
cd /tmp/
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