Skip to content

Commit 39bcbc6

Browse files
authored
Generate lambda layer release (#294)
*Issue #, if available:* *Description of changes:* Create github release for releasing lambda layer, the tag name is "lambda-v<version>", the version follows the SDK version. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
1 parent ca8e0e4 commit 39bcbc6

File tree

1 file changed

+11
-40
lines changed

1 file changed

+11
-40
lines changed

.github/workflows/release_lambda.yml

Lines changed: 11 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Release Lambda layer
33
on:
44
workflow_dispatch:
55
inputs:
6+
version:
7+
description: The version to tag the lambda release with, e.g., 1.2.0
8+
required: true
69
aws_region:
710
description: 'Deploy to aws regions'
811
required: true
@@ -184,45 +187,13 @@ jobs:
184187
with:
185188
name: layer.tf
186189
path: layer.tf
187-
# - name: Commit changes
188-
# env:
189-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190-
# run: |
191-
# git config user.name "github-actions[bot]"
192-
# git config user.email "github-actions[bot]@users.noreply.github.com"
193-
# mv layer.tf lambda-layer/terraform/lambda/
194-
# git add lambda-layer/terraform/lambda/layer.tf
195-
# git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
196-
# git push
197-
create-release:
198-
runs-on: ubuntu-latest
199-
needs: generate-release-note
200-
steps:
201-
- name: Checkout Repo @ SHA - ${{ github.sha }}
202-
uses: actions/checkout@v4
203-
- name: Get latest commit SHA
204-
run: |
205-
echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
206-
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
207-
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
208-
# - name: Create Tag
209-
# run: |
210-
# git config user.name "github-actions[bot]"
211-
# git config user.email "github-actions[bot]@users.noreply.github.com"
212-
# TAG_NAME="lambda-${SHORT_SHA}"
213-
# git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
214-
# git push origin "$TAG_NAME"
215-
# echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
216-
# env:
217-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218-
- name: Create Release
190+
- name: Create GH release
219191
id: create_release
220-
uses: actions/create-release@v1
221192
env:
222-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
223-
with:
224-
tag_name: ${{ env.TAG_NAME }}
225-
release_name: "Release AWSOpenTelemetryDistroPython Lambda Layer"
226-
body_path: lambda-layer/terraform/lambda/layer.tf
227-
draft: true
228-
prerelease: false
193+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
194+
run: |
195+
gh release create --target "$GITHUB_REF_NAME" \
196+
--title "Release lambda-v${{ github.event.inputs.version }}" \
197+
--draft \
198+
"lambda-v${{ github.event.inputs.version }}" \
199+
layer.tf

0 commit comments

Comments
 (0)