update git workflow python #32
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Python Layers | |
on: | |
push: | |
tags: | |
- v**_python | |
jobs: | |
publish-python: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Tag | |
id: python-check-tag | |
run: | | |
if [[ ${{ github.event.ref }} =~ ^refs/tags/v[0-9]+(\.[0-9]+)*_python$ ]]; then | |
echo "match=true" >> $GITHUB_OUTPUT | |
fi | |
- name: Install python dependencies | |
if: steps.python-check-tag.outputs.match == 'true' | |
run: pip install -U awscli | |
- name: Publish Python ${{ matrix.python-version }} layer | |
if: steps.python-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 python | |
./publish-layers.sh python${{ matrix.python-version }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: arm64, amd64 | |
- name: Publish ECR image for python${{ matrix.python-version }} | |
if: steps.python-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 nodejs | |
./publish-layers.sh publish-docker-ecr-image-python${{ matrix.python-version }} |