From ae1fc5848fc91183576755800b2180c6c3b428d5 Mon Sep 17 00:00:00 2001 From: Fasil | Python/Odoo Developer Date: Thu, 8 Aug 2024 21:19:12 +0300 Subject: [PATCH] Ready for Publish - Added publish.yml --- .github/workflows/publish.yml | 35 +++++++++++++++++++++++++++++++++++ MANIFEST.in | 3 +++ md2indexhtml/converter.py | 2 +- pyproject.toml | 3 +++ setup.py | 5 ++--- 5 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 MANIFEST.in create mode 100644 pyproject.toml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..19b996e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,35 @@ +# .github/workflows/publish.yml +name: Publish Python Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + + - name: Build package + run: | + python setup.py sdist bdist_wheel + + - name: Publish package + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + twine upload dist/* \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..db48425 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +include README.md +include LICENSE +include md2indexhtml/templates/*.html diff --git a/md2indexhtml/converter.py b/md2indexhtml/converter.py index 1ad8bd0..f189b7d 100644 --- a/md2indexhtml/converter.py +++ b/md2indexhtml/converter.py @@ -81,4 +81,4 @@ def main(): convert_md_to_html(args.md_file_path, args.output_dir, args.template, args.css, args.title) if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..8fe2f47 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools>=42", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index a4ea726..996aa07 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ # setup.py - from setuptools import setup, find_packages setup( @@ -25,7 +24,7 @@ ], }, package_data={ - 'md2indexhtml': ['templates/*.html'], # Include all HTML files in the templates directory + 'md2indexhtml': ['templates/*.html'], }, - include_package_data=True, # This flag is needed to include the data specified in package_data + include_package_data=True, )