4
4
workflow_dispatch :
5
5
inputs :
6
6
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)
8
8
required : true
9
9
aws_region :
10
10
description : ' Deploy to aws regions'
49
49
pip install tox
50
50
tox
51
51
- name : upload layer
52
- uses : actions/upload-artifact@v3
52
+ uses : actions/upload-artifact@v4
53
53
with :
54
54
name : layer.zip
55
55
path : lambda-layer/src/build/aws-opentelemetry-python-layer.zip
90
90
run : |
91
91
echo BUCKET_NAME=python-lambda-layer-${{ github.run_id }}-${{ matrix.aws_region }} | tee --append $GITHUB_ENV
92
92
- name : download layer.zip
93
- uses : actions/download-artifact@v3
93
+ uses : actions/download-artifact@v4
94
94
with :
95
95
name : layer.zip
96
96
- name : publish
@@ -128,7 +128,7 @@ jobs:
128
128
--action lambda:GetLayerVersion
129
129
- name : upload layer arn artifact
130
130
if : ${{ success() }}
131
- uses : actions/upload-artifact@v3
131
+ uses : actions/upload-artifact@v4
132
132
with :
133
133
name : ${{ env.LAYER_NAME }}
134
134
path : ${{ env.LAYER_NAME }}/${{ matrix.aws_region }}
@@ -144,7 +144,7 @@ jobs:
144
144
uses : actions/checkout@v4
145
145
- uses : hashicorp/setup-terraform@v2
146
146
- name : download layerARNs
147
- uses : actions/download-artifact@v3
147
+ uses : actions/download-artifact@v4
148
148
with :
149
149
name : ${{ env.LAYER_NAME }}
150
150
path : ${{ env.LAYER_NAME }}
@@ -158,14 +158,13 @@ jobs:
158
158
- name : generate layer-note
159
159
working-directory : ${{ env.LAYER_NAME }}
160
160
run : |
161
- echo "| Region | Layer ARN |" >> ../ layer-note
162
- echo "| ---- | ---- |" >> ../ layer-note
161
+ echo "| Region | Layer ARN |" >> layer-note
162
+ echo "| ---- | ---- |" >> layer-note
163
163
for file in *
164
164
do
165
165
read arn < $file
166
- echo "| " $file " | " $arn " |" >> ../ layer-note
166
+ echo "| " $file " | " $arn " |" >> layer-note
167
167
done
168
- cd ..
169
168
cat layer-note
170
169
- name : generate tf layer
171
170
working-directory : ${{ env.LAYER_NAME }}
@@ -183,17 +182,33 @@ jobs:
183
182
terraform fmt layer.tf
184
183
cat layer.tf
185
184
- name : upload layer tf file
186
- uses : actions/upload-artifact@v3
185
+ uses : actions/upload-artifact@v4
187
186
with :
188
187
name : layer.tf
189
188
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
190
202
- name : Create GH release
191
203
id : create_release
192
204
env :
193
205
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
194
206
run : |
195
207
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 \
197
210
--draft \
198
- "lambda-v${{ github.event.inputs.version }}" \
211
+ "lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }} " \
199
212
layer.tf
213
+ echo Removing release_notes.md ...
214
+ rm -f release_notes.md
0 commit comments