diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2f5836..ef0779d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/Makefile b/Makefile index 29435ee..1704224 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/ghostscript/layer_builder.sh b/ghostscript/layer_builder.sh index 4ef010e..376548f 100755 --- a/ghostscript/layer_builder.sh +++ b/ghostscript/layer_builder.sh @@ -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/ diff --git a/weasyprint/README.md b/weasyprint/README.md index 0a16360..d17e428 100644 --- a/weasyprint/README.md +++ b/weasyprint/README.md @@ -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 \ @@ -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: