From 88a1191d4f0285d413a3ae46e7aae1fc6b1e6620 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 2 Feb 2021 06:37:04 +0300 Subject: [PATCH 1/2] Make package while CI run --- .github/workflows/test.yml | 2 ++ setup.cfg | 1 + 2 files changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6bf46d66..8baf2a2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,3 +29,5 @@ jobs: run: | pytest codecov --required + - name: Make packages + run: python setup.py sdist bdist_wheel diff --git a/setup.cfg b/setup.cfg index 3102a7e6..a9144bdd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,6 +35,7 @@ develop = %(tests)s pycodestyle pytest-cov codecov + wheel [pycodestyle] select = E101,W191,W291,W293,E111,E112,E113,W292,W391 exclude = .eggs,.git From 9be306bc7348cfe9a15141797cfd7793e7ceed60 Mon Sep 17 00:00:00 2001 From: Sergey B Kirpichev Date: Tue, 2 Feb 2021 06:44:36 +0300 Subject: [PATCH 2/2] Add step to publish package on PyPI Note, this uses https://pypi.org/help/#apitoken feature of PyPI. Instead of @master - I use the recent commit hash from the gh-action-pypi-publish repo to make action more stable. The secret used in ${{ secrets.PYPI_API_TOKEN }} needs to be created on the settings page of the mpmath project. --- .github/workflows/test.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8baf2a2c..9494cff9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,3 +31,9 @@ jobs: codecov --required - name: Make packages run: python setup.py sdist bdist_wheel + - name: Publish package on PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@f91f98d65eb3eb032447201d64f2c25d67c28efe + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }}