Skip to content

Update dependency NixOS/patchelf to v0.19.0 #147

Update dependency NixOS/patchelf to v0.19.0

Update dependency NixOS/patchelf to v0.19.0 #147

Workflow file for this run

name: CI
on:
push:
paths:
- 'dockerfiles/**'
- 'scripts/deploy.py'
- 'scripts/create-layer.sh'
- 'tests/*'
- '.github/workflows/ci.yml'
branches:
- master
tags:
- '*'
pull_request:
workflow_dispatch:
jobs:
vars:
runs-on: ubuntu-24.04
outputs:
gdal_version_tag: ${{ steps.versions.outputs.gdal_version_tag }}
numpy_version: ${{ steps.versions.outputs.numpy_version }}
steps:
- uses: actions/checkout@v6
- name: Compute version outputs
id: versions
run: |
source versions.env
if ! [[ "$GDAL_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "GDAL_VERSION must be in X.Y.Z format, got: $GDAL_VERSION" >&2
exit 1
fi
echo "gdal_version_tag=${GDAL_VERSION%.*}" >> "$GITHUB_OUTPUT"
echo "numpy_version=${NUMPY_VERSION}" >> "$GITHUB_OUTPUT"
build:
needs: [vars]
if: "!contains(github.event.head_commit.message, '[skip ci]')"
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install boto3 click
- name: Load shared library versions
id: versions
run: |
{
echo 'content<<EOF'
grep -v '^#' versions.env | grep -v '^[[:space:]]*$'
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Github
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
uses: docker/build-push-action@v7
with:
platforms: linux/${{ matrix.arch }}
context: .
load: true
file: dockerfiles/Dockerfile
build-args: ${{ steps.versions.outputs.content }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-${{ matrix.arch }}
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
- name: Test
run: |
docker run \
--entrypoint bash \
-v ${{ github.workspace }}:/local \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-${{ matrix.arch }} \
/local/tests/tests.sh
deploy-gdal:
needs: [vars, build]
if: contains(github.ref, 'tags') && github.event_name == 'push'
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- name: Load shared library versions
id: versions
run: |
{
echo 'content<<EOF'
grep -v '^#' versions.env | grep -v '^[[:space:]]*$'
echo EOF
} >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Github
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish docker image (${{ matrix.arch }})
uses: docker/build-push-action@v7
with:
platforms: linux/${{ matrix.arch }}
context: .
file: dockerfiles/Dockerfile
build-args: ${{ steps.versions.outputs.content }}
push: true
cache-from: type=gha,scope=${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=${{ matrix.arch }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-${{ matrix.arch }}
deploy-gdal-manifest:
needs: [vars, deploy-gdal]
runs-on: ubuntu-24.04
if: contains(github.ref, 'tags') && github.event_name == 'push'
steps:
- name: Login to Github
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create multi-arch manifest
run: |
docker buildx imagetools create \
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }} \
ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-amd64 \
ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-arm64
deploy-layers:
needs: [vars, deploy-gdal]
if: contains(github.ref, 'tags') && github.event_name == 'push'
strategy:
matrix:
include:
- arch: amd64
lambda_arch: x86_64
runner: ubuntu-24.04
- arch: arm64
lambda_arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Build and Deploy layer (${{ matrix.arch }})
run: |
python -m pip install boto3 click
docker run \
--entrypoint bash \
-e OUTPUT_ZIP=package-${{ matrix.arch }}.zip \
-v ${{ github.workspace }}:/local \
--rm ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-${{ matrix.arch }} \
/local/scripts/create-layer.sh
python scripts/deploy.py ${{ needs.vars.outputs.gdal_version_tag }} --arch ${{ matrix.lambda_arch }} --package package-${{ matrix.arch }}.zip --deploy
deploy-runtime:
needs: [vars, deploy-gdal]
if: contains(github.ref, 'tags') && github.event_name == 'push'
strategy:
matrix:
runtime: ['3.12', '3.13', '3.14']
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v6
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to Github
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push runtime image (python${{ matrix.runtime }}, ${{ matrix.arch }})
uses: docker/build-push-action@v7
with:
platforms: linux/${{ matrix.arch }}
context: .
file: dockerfiles/runtimes/python
build-args: |
GDAL_VERSION_TAG=${{ needs.vars.outputs.gdal_version_tag }}-${{ matrix.arch }}
RUNTIME_VERSION=${{ matrix.runtime }}
NUMPY_VERSION=${{ needs.vars.outputs.numpy_version }}
PKG_INSTALLER=dnf
push: true
cache-from: type=gha,scope=python${{ matrix.runtime }}-${{ matrix.arch }}
cache-to: type=gha,mode=max,scope=python${{ matrix.runtime }}-${{ matrix.arch }}
tags: ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-python${{ matrix.runtime }}-${{ matrix.arch }}
deploy-runtime-manifest:
needs: [vars, deploy-runtime]
runs-on: ubuntu-24.04
if: contains(github.ref, 'tags') && github.event_name == 'push'
strategy:
matrix:
runtime: ['3.12', '3.13', '3.14']
steps:
- name: Login to Github
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create multi-arch manifest (python${{ matrix.runtime }})
run: |
docker buildx imagetools create \
-t ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-python${{ matrix.runtime }} \
ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-python${{ matrix.runtime }}-amd64 \
ghcr.io/${{ github.repository_owner }}/lambda-gdal:${{ needs.vars.outputs.gdal_version_tag }}-python${{ matrix.runtime }}-arm64
update-layer:
needs: [deploy-layers]
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.14'
- uses: actions/setup-node@v6
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v6
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: List layers
run: |
python -m pip install boto3
python scripts/list.py | jq > layer.json
- name: Update resources
uses: test-room-7/action-update-file@v2.1.0
with:
file-path: layer.json
commit-msg: Update layer [skip ci]
github-token: ${{ secrets.GITHUB_TOKEN }}