diff --git a/.github/workflows/release-to-pypi.yml b/.github/workflows/release-to-pypi.yml new file mode 100644 index 0000000..dca5aa2 --- /dev/null +++ b/.github/workflows/release-to-pypi.yml @@ -0,0 +1,24 @@ +name: Release to PyPI +on: + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]+" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.9" + - name: Prepare Env + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build + run: python setup.py sdist bdist_wheel + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.4.1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/release-to-test-pypi.yml b/.github/workflows/release-to-test-pypi.yml new file mode 100644 index 0000000..f11d75a --- /dev/null +++ b/.github/workflows/release-to-test-pypi.yml @@ -0,0 +1,35 @@ +name: Release to Test PyPI +on: + push: + tags: + # To publish a test release to test.pypi.org, + # create and push a tag as follows: + # git tag -a 0.21.3.dev27 -m "Tag 0.21.3.dev27 for release to test.pypi.org" + # git push --tags + # Go to https://github.com/jab/bidict/actions?query=workflow%3A%22Release+to+Test+PyPI%22 + # and watch for a new run of this workflow to publish to test.pypi.org. + # IMPORTANT: Run the following to clean up after: + # git tag -d 0.21.3.dev27 + # git push origin :0.21.3.dev27 + - "[0-9]+.[0-9]+.[0-9]+.dev[0-9]+" +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: "3.9" + - name: Prepare Env + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + - name: Build + run: python setup.py sdist bdist_wheel + - name: Publish + uses: pypa/gh-action-pypi-publish@v1.4.1 + with: + user: __token__ + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + verbose: true diff --git a/setup.cfg b/setup.cfg index 68c6110..8f708be 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,7 +7,8 @@ # https://wheel.readthedocs.io/en/stable/user_guide.html#building-wheels [bdist_wheel] -universal = 1 +# No longer Python 2-compatible -> disable universal wheels: +universal = 0 # http://flake8.pycqa.org/en/latest/user/configuration.html