Skip to content

Commit

Permalink
Generate lambda layer release (#294)
Browse files Browse the repository at this point in the history
*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.
  • Loading branch information
wangzlei authored Nov 19, 2024
1 parent ca8e0e4 commit 39bcbc6
Showing 1 changed file with 11 additions and 40 deletions.
51 changes: 11 additions & 40 deletions .github/workflows/release_lambda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Release Lambda layer
on:
workflow_dispatch:
inputs:
version:
description: The version to tag the lambda release with, e.g., 1.2.0
required: true
aws_region:
description: 'Deploy to aws regions'
required: true
Expand Down Expand Up @@ -184,45 +187,13 @@ jobs:
with:
name: layer.tf
path: layer.tf
# - name: Commit changes
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# mv layer.tf lambda-layer/terraform/lambda/
# git add lambda-layer/terraform/lambda/layer.tf
# git commit -m "Update Lambda layer ARNs for releasing" || echo "No changes to commit"
# git push
create-release:
runs-on: ubuntu-latest
needs: generate-release-note
steps:
- name: Checkout Repo @ SHA - ${{ github.sha }}
uses: actions/checkout@v4
- name: Get latest commit SHA
run: |
echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-7)
echo "SHORT_SHA=${SHORT_SHA}" >> $GITHUB_ENV
# - name: Create Tag
# run: |
# git config user.name "github-actions[bot]"
# git config user.email "github-actions[bot]@users.noreply.github.com"
# TAG_NAME="lambda-${SHORT_SHA}"
# git tag -a "$TAG_NAME" -m "Release Lambda layer based on commit $TAG_NAME"
# git push origin "$TAG_NAME"
# echo "TAG_NAME=${TAG_NAME}" >> $GITHUB_ENV
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
- name: Create GH release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: "Release AWSOpenTelemetryDistroPython Lambda Layer"
body_path: lambda-layer/terraform/lambda/layer.tf
draft: true
prerelease: false
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 }}" \
--draft \
"lambda-v${{ github.event.inputs.version }}" \
layer.tf

0 comments on commit 39bcbc6

Please sign in to comment.