Skip to content

Commit 2639271

Browse files
authored
Add layer compatibility metadata (aws-observability#667)
1 parent b52283a commit 2639271

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

.github/workflows/layer-publish.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ on:
1919
description: '(optional) amd64 or arm64'
2020
required: false
2121
type: string
22+
runtimes:
23+
description: '(optional) a space delimited list of compatible runtimes (from https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html)'
24+
required: false
25+
type: string
2226
release-group:
2327
description: 'Release to dev or prod? "prod" yields empty value. (Default: dev)'
2428
required: true
@@ -47,7 +51,16 @@ jobs:
4751
4852
if [[ -n "${{ inputs.architecture }}" ]]; then
4953
LAYER_NAME=$LAYER_NAME-${{ inputs.architecture }}
54+
ARCH=$(echo "${{ inputs.architecture }}" | sed -r 's/amd64/x86_64/g')
55+
else
56+
ARCH="x86_64 arm64"
57+
fi
58+
echo "ARCH=$ARCH" >> $GITHUB_ENV
59+
60+
if [[ -n "${{ inputs.runtimes }}" ]]; then
61+
RUNTIMES="--compatible-runtimes ${{ inputs.runtimes }}"
5062
fi
63+
echo "RUNTIMES=$RUNTIMES" >> $GITHUB_ENV
5164
5265
if [[ "${{ inputs.release-group }}" != "prod" ]]; then
5366
LAYER_NAME=$LAYER_NAME-${{ inputs.release-group }}
@@ -80,6 +93,7 @@ jobs:
8093
aws lambda publish-layer-version \
8194
--layer-name $LAYER_NAME \
8295
--license-info "Apache 2.0" \
96+
--compatible-architectures $ARCH $RUNTIMES \
8397
--zip-file fileb://${{ inputs.artifact-name }} \
8498
--query 'LayerVersionArn' \
8599
--output text

.github/workflows/release-layer-java.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
layer-name: opentelemetry-javaagent
7272
component-version: ${{needs.build-layer.outputs.JAVAAGENT_VERSION}}
7373
# architecture:
74+
runtimes: java8 java8.al2 java11 java17
7475
release-group: dev
7576
aws_region: ${{ matrix.aws_region }}
7677
secrets: inherit

.github/workflows/release-layer-nodejs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
layer-name: opentelemetry-nodejs
7272
component-version: ${{needs.build-layer.outputs.NODEJS_VERSION}}
7373
# architecture:
74+
runtimes: nodejs14.x nodejs16.x nodejs18.x
7475
release-group: dev
7576
aws_region: ${{ matrix.aws_region }}
7677
secrets: inherit

0 commit comments

Comments
 (0)