diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb3e2a2..b5dcf76 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,4 +66,66 @@ jobs: - name: Install tox run: pip install tox tox-gh-actions - name: Test with tox - run: tox -r \ No newline at end of file + run: tox -r + + build: + name: Build distribution 📦 + needs: + - test-linux + - test-windows + - test-macos + + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + python-version: ['3.10', '3.11', '3.12'] + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install pypa/build + run: >- + python3 -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: python3 -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish_to_pypi: + name: Publish Python 🐍 wheels 🛞 to PyPI + if: github.event_name == 'release' + needs: + - build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/project/ugropy + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + path: dist/ + pattern: ugropy-* + merge-multiple: true + - run: ls -R dist + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true \ No newline at end of file