Skip to content

tag_name

tag_name #5

name: Publish Extension Layer
on:
push:
tags:
- v**_extension
jobs:
publish-extension:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ 3.12 ]
steps:
- uses: actions/checkout@v4
- name: Check Tag
id: extension-check-tag
run: |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+(\.[0-9]+)*_extension$ ]]; then
echo "match=true" >> $GITHUB_OUTPUT
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
- name: Install publish dependencies
if: steps.extension-check-tag.outputs.match == 'true'
run: pip install -U awscli
- name: Publish extension layer
if: steps.extension-check-tag.outputs.match == 'true'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
cd extension
output=$(./publish-layer.sh)
echo "$output"
echo "LAYER_ARN=$(echo $output | grep 'ARN' | cut -d' ' -f2)" >> $GITHUB_ENV
echo "REGION=$(echo $output | grep 'Region' | cut -d' ' -f2)" >> $GITHUB_ENV
- name: Create Release
if: steps.extension-check-tag.outputs.match == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAG_NAME }}
release_name: Release for ${{ env.TAG_NAME }}
body: |
Release generated by GitHub Actions run [${{ github.run_id }}](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).
Layer ARN: ${{ env.LAYER_ARN }}
Region: ${{ env.REGION }}
draft: false
prerelease: false