This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "jobs": { | |
| "build": { | |
| "name": "build (${{ matrix.platform }}/${{ matrix.runtime }})", | |
| "runs-on": "${{ matrix.runner }}", | |
| "steps": [ | |
| { | |
| "uses": "docker/setup-buildx-action@v3" | |
| }, | |
| { | |
| "uses": "oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6" | |
| }, | |
| { | |
| "name": "docker login to ghcr.io", | |
| "uses": "docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef", | |
| "with": { | |
| "password": "${{ secrets.GITHUB_TOKEN }}", | |
| "registry": "ghcr.io", | |
| "username": "${{ github.actor }}" | |
| } | |
| }, | |
| { | |
| "id": "build-push", | |
| "uses": "docker/build-push-action@v6", | |
| "with": { | |
| "cache-from": "type=gha", | |
| "cache-to": "type=gha,mode=max", | |
| "context": "{{defaultContext}}:function-url-utils", | |
| "file": "Dockerfile.${{ matrix.runtime }}", | |
| "load": true, | |
| "platforms": "linux/${{ matrix.platform }}" | |
| } | |
| }, | |
| { | |
| "env": { | |
| "IMAGE": "${{ steps.build-push.outputs.imageid }}", | |
| "PLATFORM": "${{ matrix.platform }}", | |
| "REPO": "ghcr.io/ruby-no-kai/rknet-lambdalayer-function-url-utils", | |
| "RUNNER_TEMP": "${{ runner.temp }}", | |
| "RUNTIME": "${{ matrix.runtime }}" | |
| }, | |
| "name": "Upload zip", | |
| "run": "set -x\nLAYER_ZIP=\"${RUNNER_TEMP}/layer.zip\"\ndocker run --rm \"${IMAGE}\" cat /var/task/layer.zip > \"${LAYER_ZIP}\"\nmkdir -p \"${RUNNER_TEMP}/manifests\"\noras push --artifact-type application/x.rk.lambda-layer-zip \\\n --artifact-platform \"linux/${PLATFORM}:${RUNTIME}\" \\\n --export-manifest \"${RUNNER_TEMP}/manifests/${PLATFORM}-${RUNTIME}.json\" \\\n \"${REPO}\" \"${LAYER_ZIP}\"\n" | |
| }, | |
| { | |
| "uses": "actions/upload-artifact@v4", | |
| "with": { | |
| "if-no-files-found": "error", | |
| "name": "manifests-${{ matrix.platform }}-${{ matrix.runtime }}", | |
| "path": "${{ runner.temp }}/manifests/*", | |
| "retention-days": 1 | |
| } | |
| } | |
| ], | |
| "strategy": { | |
| "matrix": { | |
| "include": [ | |
| { | |
| "platform": "arm64", | |
| "runner": "ubuntu-24.04-arm", | |
| "runtime": "ruby33" | |
| }, | |
| { | |
| "platform": "amd64", | |
| "runner": "ubuntu-24.04", | |
| "runtime": "ruby33" | |
| }, | |
| { | |
| "platform": "arm64", | |
| "runner": "ubuntu-24.04-arm", | |
| "runtime": "ruby34" | |
| }, | |
| { | |
| "platform": "amd64", | |
| "runner": "ubuntu-24.04", | |
| "runtime": "ruby34" | |
| } | |
| ] | |
| } | |
| } | |
| }, | |
| "merge": { | |
| "needs": [ | |
| "build" | |
| ], | |
| "permissions": { | |
| "id-token": "write" | |
| }, | |
| "runs-on": "ubuntu-latest", | |
| "steps": [ | |
| { | |
| "uses": "docker/setup-buildx-action@v3" | |
| }, | |
| { | |
| "uses": "oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6" | |
| }, | |
| { | |
| "name": "docker login to ghcr.io", | |
| "uses": "docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef", | |
| "with": { | |
| "password": "${{ secrets.GITHUB_TOKEN }}", | |
| "registry": "ghcr.io", | |
| "username": "${{ github.actor }}" | |
| } | |
| }, | |
| { | |
| "name": "Download digests", | |
| "uses": "actions/download-artifact@v4", | |
| "with": { | |
| "merge-multiple": true, | |
| "path": "${{ runner.temp }}/manifests", | |
| "pattern": "manifests-*" | |
| } | |
| }, | |
| { | |
| "env": { | |
| "REPO": "${{ steps.login-ecr.outputs.registry }}/function-url-utils", | |
| "RUNNER_TEMP": "${{ runner.temp }}", | |
| "SHA": "${{ github.sha }}" | |
| }, | |
| "name": "Merge manifest", | |
| "run": "touch \"${RUNNER_TEMP}/digests.txt\"\nfor f in \"${RUNNER_TEMP}\"/manifests/*; do jq -r \".config.digest\" < \"$f\" >> \"${RUNNER_TEMP}/digests.txt\"; done\ncat \"${RUNNER_TEMP}/digests.txt\" | xargs -n1000 -x oras manifest index create \"${REPO}:${SHA}\"\n" | |
| } | |
| ] | |
| } | |
| }, | |
| "name": "lambdalayer-function-url-utils", | |
| "on": { | |
| "push": { | |
| "branches": [ | |
| "main", | |
| "test" | |
| ], | |
| "paths": [ | |
| "function-url-utils/**", | |
| ".github/workflows/lambdalayer-function-url-utils.yml" | |
| ] | |
| } | |
| }, | |
| "permissions": { | |
| "contents": "read", | |
| "packages": "write" | |
| } | |
| } |