Skip to content

Commit 1a31e3c

Browse files
authored
Update Lambda Layer release notes description (#320)
*Issue #, if available:* Updating Lambda layer release notes as well as the version format. The version will be {ADOT SDK version}-{Latest commit hash) By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
2 parents 768b335 + af8c69b commit 1a31e3c

File tree

1 file changed

+27
-12
lines changed

1 file changed

+27
-12
lines changed

.github/workflows/release-lambda.yml

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: The version to tag the lambda release with, e.g., 1.2.0
7+
description: The version to tag the lambda release with (should be the same as the ADOT SDK version, e.g., 0.8.0)
88
required: true
99
aws_region:
1010
description: 'Deploy to aws regions'
@@ -49,7 +49,7 @@ jobs:
4949
pip install tox
5050
tox
5151
- name: upload layer
52-
uses: actions/upload-artifact@v3
52+
uses: actions/upload-artifact@v4
5353
with:
5454
name: layer.zip
5555
path: lambda-layer/src/build/aws-opentelemetry-python-layer.zip
@@ -90,7 +90,7 @@ jobs:
9090
run: |
9191
echo BUCKET_NAME=python-lambda-layer-${{ github.run_id }}-${{ matrix.aws_region }} | tee --append $GITHUB_ENV
9292
- name: download layer.zip
93-
uses: actions/download-artifact@v3
93+
uses: actions/download-artifact@v4
9494
with:
9595
name: layer.zip
9696
- name: publish
@@ -128,7 +128,7 @@ jobs:
128128
--action lambda:GetLayerVersion
129129
- name: upload layer arn artifact
130130
if: ${{ success() }}
131-
uses: actions/upload-artifact@v3
131+
uses: actions/upload-artifact@v4
132132
with:
133133
name: ${{ env.LAYER_NAME }}
134134
path: ${{ env.LAYER_NAME }}/${{ matrix.aws_region }}
@@ -144,7 +144,7 @@ jobs:
144144
uses: actions/checkout@v4
145145
- uses: hashicorp/setup-terraform@v2
146146
- name: download layerARNs
147-
uses: actions/download-artifact@v3
147+
uses: actions/download-artifact@v4
148148
with:
149149
name: ${{ env.LAYER_NAME }}
150150
path: ${{ env.LAYER_NAME }}
@@ -158,14 +158,13 @@ jobs:
158158
- name: generate layer-note
159159
working-directory: ${{ env.LAYER_NAME }}
160160
run: |
161-
echo "| Region | Layer ARN |" >> ../layer-note
162-
echo "| ---- | ---- |" >> ../layer-note
161+
echo "| Region | Layer ARN |" >> layer-note
162+
echo "| ---- | ---- |" >> layer-note
163163
for file in *
164164
do
165165
read arn < $file
166-
echo "| " $file " | " $arn " |" >> ../layer-note
166+
echo "| " $file " | " $arn " |" >> layer-note
167167
done
168-
cd ..
169168
cat layer-note
170169
- name: generate tf layer
171170
working-directory: ${{ env.LAYER_NAME }}
@@ -183,17 +182,33 @@ jobs:
183182
terraform fmt layer.tf
184183
cat layer.tf
185184
- name: upload layer tf file
186-
uses: actions/upload-artifact@v3
185+
uses: actions/upload-artifact@v4
187186
with:
188187
name: layer.tf
189188
path: layer.tf
189+
- name: Get commit hash
190+
id: commit
191+
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
192+
- name: Create Release Notes
193+
run: |
194+
echo "AWS OpenTelemetry Lambda Layer for Python version ${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" > release_notes.md
195+
echo "" >> release_notes.md
196+
echo "" >> release_notes.md
197+
echo "See new Lambda Layer ARNs:" >> release_notes.md
198+
echo "" >> release_notes.md
199+
cat layer-note >> release_notes.md
200+
echo "" >> release_notes.md
201+
echo "Notes:" >> release_notes.md
190202
- name: Create GH release
191203
id: create_release
192204
env:
193205
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
194206
run: |
195207
gh release create --target "$GITHUB_REF_NAME" \
196-
--title "Release lambda-v${{ github.event.inputs.version }}" \
208+
--title "Release lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
209+
--notes-file release_notes.md \
197210
--draft \
198-
"lambda-v${{ github.event.inputs.version }}" \
211+
"lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
199212
layer.tf
213+
echo Removing release_notes.md ...
214+
rm -f release_notes.md

0 commit comments

Comments
 (0)