From 7087055f7ad378506be1cd5b7bb22675d147776f Mon Sep 17 00:00:00 2001 From: Edvard Rejthar Date: Fri, 17 Jan 2025 16:27:19 +0100 Subject: [PATCH] publish system --- .github/workflows/python-publish.yml | 37 +++++++++++----------------- CHANGELOG.md | 3 +++ Makefile | 6 +++++ pyproject.toml | 26 +++++++++++++++++++ requirements.txt | 4 --- setup.py | 2 +- 6 files changed, 51 insertions(+), 27 deletions(-) create mode 100644 Makefile create mode 100644 pyproject.toml delete mode 100644 requirements.txt diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 47623d9..0d17357 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,30 +1,23 @@ -# This workflows will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - name: Upload Python Package - on: push: tags: - - '[0-9].[0-9].[0-9]' - - '[0-9].[0-9].[0-9]-rc.[0-9]' + - '[0-9]+\.[0-9]+\.[0-9]+' + - '[0-9]+\.[0-9]+\.[0-9]+-?rc\.?[0-9]+' jobs: - deploy: + pypi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_GITHUB_ENVELOPE }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Replace media paths in README.md + run: sed -E 's#(\]\((asset/[a-zA-Z0-9._-]+))#](https://github.com/CZ-NIC/envelope/blob/main/\2?raw=True#g' README.md | less > README.md.tmp && mv README.md.tmp README.md + - name: Build the package + 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_GITHUB_ENVELOPE }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 5152570..5b85fef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # CHANGELOG +## 2.1.0 (2025-01-17) +- reworked s/mime cryptography + ## 2.0.4 (2024-07-18) - resilience against missing libmagic (useful on a contained environment) - better SMTP retries #35 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9fbe7a5 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +export TAG := `grep version pyproject.toml | pz --search '"(\d+\.\d+\.\d+(?:rc\d+)?)?"'` + +release: + git tag $(TAG) + git push origin $(TAG) + #mkdocs gh-deploy diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7d5763d --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" + +[tool.poetry] +name = "envelope" +version = "2.1.0-pre1" +description = "Insert a message and attachments and send e-mail / sign / encrypt contents by a single line." +authors = ["Edvard Rejthar "] +license = "GNU GPLv3" +homepage = "https://github.com/CZ-NIC/envelope" +readme = "README.md" +classifiers = ["Programming Language :: Python :: 3"] + +[tool.poetry.dependencies] +python = ">=3.10" +jsonpickle = "*" +python-magic = "*" +python-gnupg = ">=0.5" +py3-validate-email = "*" + +[tool.poetry.extras] +smime = ["cryptography>=43"] + +[tool.poetry.scripts] +envelope = "envelope.__main__:main" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d66dfe5..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -jsonpickle -python-magic -python-gnupg>=0.5 -py3-validate-email \ No newline at end of file diff --git a/setup.py b/setup.py index 2773541..f06aa3d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ setup( name='envelope', - version='2.0.6', + version='2.1.0-rc1', packages=['envelope'], author='Edvard Rejthar', author_email='edvard.rejthar@nic.cz',