@@ -3,6 +3,9 @@ name: Release Lambda layer
33on :
44 workflow_dispatch :
55 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
69 aws_region :
710 description : ' Deploy to aws regions'
811 required : true
4952 - name : Build Lambda Layer
5053 run : npm run build-lambda
5154 - name : upload layer
52- uses : actions/upload-artifact@v3
55+ uses : actions/upload-artifact@v4
5356 with :
5457 name : layer.zip
5558 path : lambda-layer/packages/layer/build/layer.zip
9093 run : |
9194 echo BUCKET_NAME=nodejs-lambda-layer-${{ github.run_id }}-${{ matrix.aws_region }} | tee --append $GITHUB_ENV
9295 - name : download layer.zip
93- uses : actions/download-artifact@v3
96+ uses : actions/download-artifact@v4
9497 with :
9598 name : layer.zip
9699 - name : publish
@@ -128,7 +131,7 @@ jobs:
128131 --action lambda:GetLayerVersion
129132 - name : upload layer arn artifact
130133 if : ${{ success() }}
131- uses : actions/upload-artifact@v3
134+ uses : actions/upload-artifact@v4
132135 with :
133136 name : ${{ env.LAYER_NAME }}
134137 path : ${{ env.LAYER_NAME }}/${{ matrix.aws_region }}
@@ -144,7 +147,7 @@ jobs:
144147 uses : actions/checkout@v4
145148 - uses : hashicorp/setup-terraform@v2
146149 - name : download layerARNs
147- uses : actions/download-artifact@v3
150+ uses : actions/download-artifact@v4
148151 with :
149152 name : ${{ env.LAYER_NAME }}
150153 path : ${{ env.LAYER_NAME }}
@@ -183,28 +186,35 @@ jobs:
183186 terraform fmt layer.tf
184187 cat layer.tf
185188 - name : upload layer tf file
186- uses : actions/upload-artifact@v3
189+ uses : actions/upload-artifact@v4
187190 with :
188191 name : layer.tf
189192 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
197200 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
204209 env :
205210 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