Skip to content

Commit

Permalink
Update Lambda Layer release notes description (#320)
Browse files Browse the repository at this point in the history
*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.
  • Loading branch information
liustve authored Jan 31, 2025
2 parents 768b335 + af8c69b commit 1a31e3c
Showing 1 changed file with 27 additions and 12 deletions.
39 changes: 27 additions & 12 deletions .github/workflows/release-lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:
inputs:
version:
description: The version to tag the lambda release with, e.g., 1.2.0
description: The version to tag the lambda release with (should be the same as the ADOT SDK version, e.g., 0.8.0)
required: true
aws_region:
description: 'Deploy to aws regions'
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
pip install tox
tox
- name: upload layer
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: layer.zip
path: lambda-layer/src/build/aws-opentelemetry-python-layer.zip
Expand Down Expand Up @@ -90,7 +90,7 @@ jobs:
run: |
echo BUCKET_NAME=python-lambda-layer-${{ github.run_id }}-${{ matrix.aws_region }} | tee --append $GITHUB_ENV
- name: download layer.zip
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: layer.zip
- name: publish
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
--action lambda:GetLayerVersion
- name: upload layer arn artifact
if: ${{ success() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.LAYER_NAME }}
path: ${{ env.LAYER_NAME }}/${{ matrix.aws_region }}
Expand All @@ -144,7 +144,7 @@ jobs:
uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v2
- name: download layerARNs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: ${{ env.LAYER_NAME }}
path: ${{ env.LAYER_NAME }}
Expand All @@ -158,14 +158,13 @@ jobs:
- name: generate layer-note
working-directory: ${{ env.LAYER_NAME }}
run: |
echo "| Region | Layer ARN |" >> ../layer-note
echo "| ---- | ---- |" >> ../layer-note
echo "| Region | Layer ARN |" >> layer-note
echo "| ---- | ---- |" >> layer-note
for file in *
do
read arn < $file
echo "| " $file " | " $arn " |" >> ../layer-note
echo "| " $file " | " $arn " |" >> layer-note
done
cd ..
cat layer-note
- name: generate tf layer
working-directory: ${{ env.LAYER_NAME }}
Expand All @@ -183,17 +182,33 @@ jobs:
terraform fmt layer.tf
cat layer.tf
- name: upload layer tf file
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: layer.tf
path: layer.tf
- name: Get commit hash
id: commit
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Create Release Notes
run: |
echo "AWS OpenTelemetry Lambda Layer for Python version ${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" > release_notes.md
echo "" >> release_notes.md
echo "" >> release_notes.md
echo "See new Lambda Layer ARNs:" >> release_notes.md
echo "" >> release_notes.md
cat layer-note >> release_notes.md
echo "" >> release_notes.md
echo "Notes:" >> release_notes.md
- name: Create GH release
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
run: |
gh release create --target "$GITHUB_REF_NAME" \
--title "Release lambda-v${{ github.event.inputs.version }}" \
--title "Release lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
--notes-file release_notes.md \
--draft \
"lambda-v${{ github.event.inputs.version }}" \
"lambda-v${{ github.event.inputs.version }}-${{ steps.commit.outputs.sha_short }}" \
layer.tf
echo Removing release_notes.md ...
rm -f release_notes.md

0 comments on commit 1a31e3c

Please sign in to comment.