@@ -3,6 +3,9 @@ name: Release Lambda layer
3
3
on :
4
4
workflow_dispatch :
5
5
inputs :
6
+ version :
7
+ description : The version to tag the lambda release with (should be the same as the current ADOT JavaScript SDK version, e.g., 0.6.0)
8
+ required : true
6
9
aws_region :
7
10
description : ' Deploy to aws regions'
8
11
required : true
49
52
- name : Build Lambda Layer
50
53
run : npm run build-lambda
51
54
- name : upload layer
52
- uses : actions/upload-artifact@v3
55
+ uses : actions/upload-artifact@v4
53
56
with :
54
57
name : layer.zip
55
58
path : lambda-layer/packages/layer/build/layer.zip
90
93
run : |
91
94
echo BUCKET_NAME=nodejs-lambda-layer-${{ github.run_id }}-${{ matrix.aws_region }} | tee --append $GITHUB_ENV
92
95
- name : download layer.zip
93
- uses : actions/download-artifact@v3
96
+ uses : actions/download-artifact@v4
94
97
with :
95
98
name : layer.zip
96
99
- name : publish
@@ -128,7 +131,7 @@ jobs:
128
131
--action lambda:GetLayerVersion
129
132
- name : upload layer arn artifact
130
133
if : ${{ success() }}
131
- uses : actions/upload-artifact@v3
134
+ uses : actions/upload-artifact@v4
132
135
with :
133
136
name : ${{ env.LAYER_NAME }}
134
137
path : ${{ env.LAYER_NAME }}/${{ matrix.aws_region }}
@@ -144,7 +147,7 @@ jobs:
144
147
uses : actions/checkout@v4
145
148
- uses : hashicorp/setup-terraform@v2
146
149
- name : download layerARNs
147
- uses : actions/download-artifact@v3
150
+ uses : actions/download-artifact@v4
148
151
with :
149
152
name : ${{ env.LAYER_NAME }}
150
153
path : ${{ env.LAYER_NAME }}
@@ -183,28 +186,35 @@ jobs:
183
186
terraform fmt layer.tf
184
187
cat layer.tf
185
188
- name : upload layer tf file
186
- uses : actions/upload-artifact@v3
189
+ uses : actions/upload-artifact@v4
187
190
with :
188
191
name : layer.tf
189
192
path : layer.tf
190
- create-release :
191
- runs-on : ubuntu-latest
192
- needs : generate-release-note
193
- steps :
194
- - name : Checkout Repo @ SHA - ${{ github.sha }}
195
- uses : actions/checkout@v4
196
- - name : Get latest commit SHA
193
+
194
+ - name : Get commit hash
195
+ id : commit
196
+ run : |
197
+ echo "sha_short=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_OUTPUT
198
+
199
+ - name : Create Release Notes
197
200
run : |
198
- echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
199
- SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
200
- echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
201
- - name : Create Release
202
- id : create_release
203
- uses : actions/create-release@v1
201
+ echo "AWS OpenTelemetry Lambda Layer for JavaScript version ${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" > release_notes.md
202
+ echo "" >> release_notes.md
203
+ echo "Lambda Layer ARNs:" >> release_notes.md
204
+ echo "" >> release_notes.md
205
+ cat layer-note >> release_notes.md
206
+ echo "" >> release_notes.md
207
+ echo "Notes:" >> release_notes.md
208
+ - name : Create GH release
204
209
env :
205
210
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
206
- with :
207
- release_name : " Release AWSOpenTelemetryDistroPython Lambda Layer"
208
- body_path : lambda-layer/terraform/lambda/layer.tf
209
- draft : true
210
- prerelease : false
211
+ run : |
212
+ gh release create \
213
+ --target "$GITHUB_REF_NAME" \
214
+ --title "Release lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
215
+ --notes-file release_notes.md \
216
+ --draft \
217
+ "lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
218
+ lambda-layer/terraform/lambda/layer.tf
219
+ echo Removing release_notes.md ...
220
+ rm -f release_notes.md
0 commit comments