From 02ae23b11d8b4a22639e206fc23527647dc6eca4 Mon Sep 17 00:00:00 2001 From: Sergio Garcia <38561120+sergargar@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:33:15 +0100 Subject: [PATCH] feat(release): add PyPi GitHub Action (#1724) Co-authored-by: sergargar Co-authored-by: Pepe Fagoaga --- .github/workflows/pypi-release.yml | 34 ++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pypi-release.yml diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 00000000..97ff06d0 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,34 @@ +name: pypi-release + +on: + release: + types: [published] + +env: + GITHUB_BRANCH: master + +jobs: + release-prowler-job: + runs-on: ubuntu-latest + name: Release Prowler to PyPI + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 + with: + ref: ${{ env.GITHUB_BRANCH }} + - name: setup python + uses: actions/setup-python@v2 + with: + python-version: 3.9 #install the python needed + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build --upgrade + #- name: Set version number + # run: python update_prowler_version.py ${{ env.VERSION }} + - name: Build package + run: python -m build + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }}