chore: Release 0.3.1 (#878) #28
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: "Python: Publish python/serverless-aws-lambda-sdk" | |
on: | |
push: | |
tags: | |
- "python/serverless-aws-lambda-sdk@[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
publishNewVersion: | |
name: Publish new version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Python and Pip | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7" | |
# ensure project dependencies are cached | |
# When using only `pyproject.toml` for dependencies, see: | |
# https://github.com/actions/setup-python/issues/529#issuecomment-1367029699 | |
cache: "pip" | |
cache-dependency-path: | | |
**/pyproject.toml | |
- name: Publish New Version on PyPI | |
env: | |
TWINE_USERNAME: "__token__" | |
TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} | |
run: | | |
cd python/packages | |
python3 -m venv .venv | |
source .venv/bin/activate | |
python3 -m pip install --upgrade build twine wheel | |
python3 -m build --wheel --sdist ./aws-lambda-sdk --outdir dist | |
twine upload dist/*.tar.gz dist/*.whl | |
- name: Install main project dependencies | |
run: | | |
cd python/packages/aws-lambda-sdk | |
python3 -m venv .venv | |
source .venv/bin/activate | |
python3 -m pip install . --target=dist | |
python3 -m pip install pyclean | |
python3 -m pyclean dist | |
rm -rf dist/google/_upb | |
- name: Create lambda layer package | |
run: | | |
cd python/packages/aws-lambda-sdk | |
./scripts/build-layer-archive.sh dist/extension.internal.zip | |
- name: Install Node.js and npm | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
registry-url: https://registry.npmjs.org | |
- name: Install layer publishing script dependencies | |
run: | | |
cd node | |
npm update --save-dev --no-save | |
- name: Publish layers (dev) | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.OPEN_DEV_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPEN_DEV_AWS_SECRET_ACCESS_KEY }} | |
run: | | |
TEMP_ARRAY=($(echo $GITHUB_REF | tr "@" "\n")) | |
VERSION=${TEMP_ARRAY[@]: -1} | |
cd node | |
./scripts/publish-extension-layers.js \ | |
--bucket-name sls-dev-layers-registry \ | |
--layer-basename sls-sdk-python \ | |
--version $VERSION \ | |
--layer-filename ../python/packages/aws-lambda-sdk/dist/extension.internal.zip | |
- name: Publish layers (prod) | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.OPEN_PROD_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.OPEN_PROD_AWS_SECRET_ACCESS_KEY }} | |
run: | | |
TEMP_ARRAY=($(echo $GITHUB_REF | tr "@" "\n")) | |
VERSION=${TEMP_ARRAY[@]: -1} | |
TAG=${GITHUB_REF:10} | |
cd node | |
./scripts/publish-extension-layers.js \ | |
--bucket-name sls-layers-registry \ | |
--layer-basename sls-sdk-python \ | |
--version $VERSION \ | |
--layer-filename ../python/packages/aws-lambda-sdk/dist/extension.internal.zip \ |