diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 31e122f..d13d6d9 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -6,24 +6,44 @@ # separate terms of service, privacy policy, and support # documentation. -name: Publish to PyPI.org +name: Publish Python 🐍 distributions 📦 to PyPI + on: release: - types: [published] + types: [created] + jobs: - pypi: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to PyPI runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - run: python3 -m pip install --upgrade build && python3 -m build - - name: Publish package - uses: pypa/gh-action-pypi-publish@release/v1 - with: - password: ${{ secrets.PYPI_API_TOKEN }} - uses: pypa/gh-action-pypi-publish@master + - uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.11 + + - name: Install pip + run: python -m pip install --upgrade pip + + - name: Install dependencies + run: pip install -r requirements.txt + + - name : Install black + run: pip install black + + - name: Run black + run: black . + + - name: Install build + run: python -m pip install build + + - name: Build a binary wheel and a source tarball + run: python -m build --sdist --wheel --outdir dist/ + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }}