From a52f865b913ac9b8411efceb17aa54dacbabce32 Mon Sep 17 00:00:00 2001 From: saieshwarm <112009130+saieshwarm@users.noreply.github.com> Date: Fri, 12 Apr 2024 08:35:28 -0700 Subject: [PATCH] Create pypi-release.yaml This helps in automating the PyPi release when the package version is bumped. --- .github/workflows/pypi-release.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/pypi-release.yaml diff --git a/.github/workflows/pypi-release.yaml b/.github/workflows/pypi-release.yaml new file mode 100644 index 0000000..824a015 --- /dev/null +++ b/.github/workflows/pypi-release.yaml @@ -0,0 +1,27 @@ +# This workflow will release project to PyPI +name: CloudFormation CLI Python Plugin Release + +on: + release: + types: [ published ] + +jobs: + build: + if: endsWith(github.ref, '-plugin') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.11 + uses: actions/setup-python@v2 + with: + python-version: 3.11 + - name: Install dependencies + run: | + pip install --upgrade wheel twine + - name: Package project + run: | + python setup.py sdist bdist_wheel + - name: Publish distribution 📦 to PyPI (If triggered from release) + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_KEY_CLOUDFORMATION_CLI_PYTHON_PLUGIN }}