diff --git a/.github/workflows/publish-to-live-pypi.yml b/.github/workflows/publish-to-live-pypi.yml new file mode 100644 index 0000000..d5b955c --- /dev/null +++ b/.github/workflows/publish-to-live-pypi.yml @@ -0,0 +1,38 @@ +name: Publish Python 🐍 distributions 📦 to pypi + +on: + release: + types: + - created + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to pypi + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff --git a/.github/workflows/publish-to-test-pypi.yml b/.github/workflows/publish-to-test-pypi.yml new file mode 100644 index 0000000..8ce9ada --- /dev/null +++ b/.github/workflows/publish-to-test-pypi.yml @@ -0,0 +1,35 @@ +name: Publish Python 🐍 distributions 📦 to TestPyPI + +on: push + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distributions 📦 to TestPyPI + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a86854..c49c3fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,9 +4,14 @@ Change Log This document records all notable changes to [django-bleach](https://github.com/marksweb/django-bleach). This project adheres to [Semantic Versioning](https://semver.org/). -[unreleased](https://github.com/marksweb/django-bleach/compare/0.9.0...master) changes +[unreleased](https://github.com/marksweb/django-bleach/compare/1.0.0...master) changes ------------------------------------------------------------------------------------- +Version 1.0.0 +============= +###### 13-11-2021 +Going to 1.0 is long overdue, especially considering SemVer. +* automated pypi releases via github actions * pre-commit hooks * python 3.10 support * docs syntax highlighting [#38](https://github.com/marksweb/django-bleach/pull/38) diff --git a/django_bleach/__init__.py b/django_bleach/__init__.py index e4be4ce..44675e6 100644 --- a/django_bleach/__init__.py +++ b/django_bleach/__init__.py @@ -1,4 +1,4 @@ __author__ = "Tim Heap & Mark Walker" -__version__ = "0.9.0" +__version__ = "1.0.0" VERSION = __version__.split(".") diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..019b0d8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +# Minimum requirements for the build system to execute. +requires = ["setuptools", "wheel"] # PEP 508 specifications. diff --git a/setup.py b/setup.py index f51ef8e..136c1ef 100755 --- a/setup.py +++ b/setup.py @@ -55,21 +55,6 @@ def find_variable(variable, *parts): release = find_variable('__version__', 'django_bleach', '__init__.py') version = release.rstrip('.') -if sys.argv[-1] == 'build': - os.system('python setup.py sdist bdist_wheel') - sys.exit() - -if sys.argv[-1] == 'release': - os.system('twine upload -r django-bleach --skip-existing dist/*') - sys.exit() - -if sys.argv[-1] == 'tag': - print("Tagging the version on github:") - os.system(f"git tag -a {version} -m 'version {version}'") - os.system("git push --tags") - sys.exit() - - setup( name=name, version=version,