diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6eb4a4..706177b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ on: push: pull_request: release: - # types: [published] + types: [published] jobs: style-python: @@ -29,3 +29,32 @@ jobs: - name: Check style run: | flake8 . --max-line-length=100 --ignore=E731 + + publish: + # if: github.event_name == 'release' && github.event.action == 'published' + needs: [style-python] + name: 📦 Publish to PyPi + runs-on: ubuntu-latest + environment: + name: release + url: https://pypi.org/p/inventree-zebra-plugin + permissions: + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install build dependencies + run: pip install --upgrade wheel setuptools twine build + + - name: Build pip package + run: python3 -m build + + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@release/v1